Lines Matching refs:ret

197 	int ret;  in port_info_get()  local
206 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in port_info_get()
207 if (ret != 0) { in port_info_get()
209 return ret; in port_info_get()
241 int ret; in port_register() local
264 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in port_register()
265 if (ret != 0) { in port_register()
267 return ret; in port_register()
320 int ret; in niocregif() local
337 ret = ioctl(ctx->fd, NIOCREGIF, &req); in niocregif()
338 if (ret != 0) { in niocregif()
340 return ret; in niocregif()
381 return ret; in niocregif()
552 int ret; in vale_attach() local
567 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_attach()
568 if (ret != 0) { in vale_attach()
570 return ret; in vale_attach()
588 int ret; in vale_detach() local
597 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_detach()
598 if (ret != 0) { in vale_detach()
600 return ret; in vale_detach()
610 int ret; in vale_attach_detach() local
612 if ((ret = vale_attach(ctx)) != 0) { in vale_attach_detach()
613 return ret; in vale_attach_detach()
633 int ret; in port_hdr_set_and_get() local
642 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in port_hdr_set_and_get()
643 if (ret != 0) { in port_hdr_set_and_get()
645 return ret; in port_hdr_set_and_get()
655 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in port_hdr_set_and_get()
656 if (ret != 0) { in port_hdr_set_and_get()
658 return ret; in port_hdr_set_and_get()
676 int ret; in vale_ephemeral_port_hdr_manipulation() local
680 if ((ret = port_register(ctx))) { in vale_ephemeral_port_hdr_manipulation()
681 return ret; in vale_ephemeral_port_hdr_manipulation()
685 if ((ret = port_hdr_set_and_get(ctx))) { in vale_ephemeral_port_hdr_manipulation()
686 return ret; in vale_ephemeral_port_hdr_manipulation()
689 if ((ret = port_hdr_set_and_get(ctx))) { in vale_ephemeral_port_hdr_manipulation()
690 return ret; in vale_ephemeral_port_hdr_manipulation()
693 if ((ret = port_hdr_set_and_get(ctx))) { in vale_ephemeral_port_hdr_manipulation()
694 return ret; in vale_ephemeral_port_hdr_manipulation()
705 int ret; in vale_persistent_port() local
720 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_persistent_port()
721 if (ret != 0) { in vale_persistent_port()
723 return ret; in vale_persistent_port()
732 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_persistent_port()
733 if (ret != 0) { in vale_persistent_port()
736 result = ret; in vale_persistent_port()
749 int ret; in pools_info_get() local
758 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in pools_info_get()
759 if (ret != 0) { in pools_info_get()
761 return ret; in pools_info_get()
791 int ret; in pools_info_get_and_register() local
795 ret = pools_info_get(ctx); in pools_info_get_and_register()
796 if (ret != 0) { in pools_info_get_and_register()
797 return ret; in pools_info_get_and_register()
801 ret = port_register(ctx); in pools_info_get_and_register()
802 if (ret != 0) { in pools_info_get_and_register()
803 return ret; in pools_info_get_and_register()
867 int ret; in vale_polling_enable() local
881 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_polling_enable()
882 if (ret != 0) { in vale_polling_enable()
884 return ret; in vale_polling_enable()
901 int ret; in vale_polling_disable() local
912 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in vale_polling_disable()
913 if (ret != 0) { in vale_polling_disable()
915 return ret; in vale_polling_disable()
924 int ret = 0; in vale_polling_enable_disable() local
926 if ((ret = vale_attach(ctx)) != 0) { in vale_polling_enable_disable()
927 return ret; in vale_polling_enable_disable()
933 if ((ret = vale_polling_enable(ctx))) { in vale_polling_enable_disable()
941 return ret; in vale_polling_enable_disable()
945 if ((ret = vale_polling_disable(ctx))) { in vale_polling_enable_disable()
947 return ret; in vale_polling_enable_disable()
1104 int ret; in pop_extmem_option() local
1109 if ((ret = checkoption(&e->nro_opt, &exp->nro_opt))) { in pop_extmem_option()
1110 return ret; in pop_extmem_option()
1124 if ((ret = munmap((void *)(uintptr_t)e->nro_usrptr, in pop_extmem_option()
1126 return ret; in pop_extmem_option()
1136 int ret; in _extmem_option() local
1138 if ((ret = push_extmem_option(ctx, pi, &e)) < 0) in _extmem_option()
1139 return ret; in _extmem_option()
1147 if ((ret = port_register_hwall(ctx))) in _extmem_option()
1148 return ret; in _extmem_option()
1150 ret = pop_extmem_option(ctx, &save); in _extmem_option()
1152 return ret; in _extmem_option()
1216 int ret; in duplicate_extmem_options() local
1222 if ((ret = push_extmem_option(ctx, &pools_info, &e1)) < 0) in duplicate_extmem_options()
1223 return ret; in duplicate_extmem_options()
1225 if ((ret = push_extmem_option(ctx, &pools_info, &e2)) < 0) { in duplicate_extmem_options()
1227 return ret; in duplicate_extmem_options()
1237 ret = port_register_hwall(ctx); in duplicate_extmem_options()
1238 if (ret >= 0) { in duplicate_extmem_options()
1244 if ((ret = pop_extmem_option(ctx, &save2))) in duplicate_extmem_options()
1245 return ret; in duplicate_extmem_options()
1248 if ((ret = pop_extmem_option(ctx, &save1))) in duplicate_extmem_options()
1249 return ret; in duplicate_extmem_options()
1260 int ret; in push_csb_option() local
1265 ret = port_info_get(ctx); in push_csb_option()
1266 if (ret != 0) { in push_csb_option()
1267 return ret; in push_csb_option()
1277 ret = posix_memalign(&ctx->csb, sizeof(struct nm_csb_atok), csb_size); in push_csb_option()
1278 if (ret != 0) { in push_csb_option()
1299 int ret; in csb_mode() local
1301 ret = push_csb_option(ctx, &opt); in csb_mode()
1302 if (ret != 0) { in csb_mode()
1303 return ret; in csb_mode()
1306 ret = port_register_hwall(ctx); in csb_mode()
1309 return ret; in csb_mode()
1316 int ret; in csb_mode_invalid_memory() local
1325 ret = port_register_hwall(ctx); in csb_mode_invalid_memory()
1328 return (ret < 0) ? 0 : -1; in csb_mode_invalid_memory()
1335 int ret; in sync_kloop_stop() local
1341 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in sync_kloop_stop()
1342 if (ret != 0) { in sync_kloop_stop()
1346 return ret; in sync_kloop_stop()
1355 int ret; in sync_kloop_worker() local
1365 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in sync_kloop_worker()
1366 if (ret != 0) { in sync_kloop_worker()
1374 pthread_exit(ret ? (void *)THRET_FAILURE : (void *)THRET_SUCCESS); in sync_kloop_worker()
1382 int ret; in sync_kloop_start_stop() local
1384 ret = pthread_create(&th, NULL, sync_kloop_worker, ctx); in sync_kloop_start_stop()
1385 if (ret != 0) { in sync_kloop_start_stop()
1386 printf("pthread_create(kloop): %s\n", strerror(ret)); in sync_kloop_start_stop()
1390 ret = sync_kloop_stop(ctx); in sync_kloop_start_stop()
1391 if (ret != 0) { in sync_kloop_start_stop()
1392 return ret; in sync_kloop_start_stop()
1395 ret = pthread_join(th, &thret); in sync_kloop_start_stop()
1396 if (ret != 0) { in sync_kloop_start_stop()
1397 printf("pthread_join(kloop): %s\n", strerror(ret)); in sync_kloop_start_stop()
1406 int ret; in sync_kloop() local
1408 ret = csb_mode(ctx); in sync_kloop()
1409 if (ret != 0) { in sync_kloop()
1410 return ret; in sync_kloop()
1424 int ret, i; in sync_kloop_eventfds() local
1449 ret = sync_kloop_start_stop(ctx); in sync_kloop_eventfds()
1450 if (ret != 0) { in sync_kloop_eventfds()
1453 return ret; in sync_kloop_eventfds()
1461 ret = checkoption(&evopt->nro_opt, &evsave); in sync_kloop_eventfds()
1465 return ret; in sync_kloop_eventfds()
1472 int ret; in sync_kloop_eventfds_all_mode() local
1474 ret = csb_mode(ctx); in sync_kloop_eventfds_all_mode()
1475 if (ret != 0) { in sync_kloop_eventfds_all_mode()
1476 return ret; in sync_kloop_eventfds_all_mode()
1494 int ret; in sync_kloop_eventfds_all_tx() local
1496 ret = push_csb_option(ctx, &opt); in sync_kloop_eventfds_all_tx()
1497 if (ret != 0) { in sync_kloop_eventfds_all_tx()
1498 return ret; in sync_kloop_eventfds_all_tx()
1501 ret = port_register_hwall_tx(ctx); in sync_kloop_eventfds_all_tx()
1502 if (ret != 0) { in sync_kloop_eventfds_all_tx()
1503 return ret; in sync_kloop_eventfds_all_tx()
1534 int ret; in sync_kloop_nocsb() local
1536 ret = port_register_hwall(ctx); in sync_kloop_nocsb()
1537 if (ret != 0) { in sync_kloop_nocsb()
1538 return ret; in sync_kloop_nocsb()
1552 int ret; in csb_enable() local
1554 ret = push_csb_option(ctx, &opt); in csb_enable()
1555 if (ret != 0) { in csb_enable()
1556 return ret; in csb_enable()
1568 ret = ioctl(ctx->fd, NIOCCTRL, &hdr); in csb_enable()
1569 if (ret != 0) { in csb_enable()
1571 return ret; in csb_enable()
1574 ret = checkoption(&opt.nro_opt, &saveopt); in csb_enable()
1577 return ret; in csb_enable()
1583 int ret; in sync_kloop_csb_enable() local
1586 ret = port_register_hwall(ctx); in sync_kloop_csb_enable()
1587 if (ret != 0) { in sync_kloop_csb_enable()
1588 return ret; in sync_kloop_csb_enable()
1591 ret = csb_enable(ctx); in sync_kloop_csb_enable()
1592 if (ret != 0) { in sync_kloop_csb_enable()
1593 return ret; in sync_kloop_csb_enable()
1608 int ret; in sync_kloop_conflict() local
1610 ret = push_csb_option(ctx, &opt); in sync_kloop_conflict()
1611 if (ret != 0) { in sync_kloop_conflict()
1612 return ret; in sync_kloop_conflict()
1615 ret = port_register_hwall(ctx); in sync_kloop_conflict()
1616 if (ret != 0) { in sync_kloop_conflict()
1617 return ret; in sync_kloop_conflict()
1621 ret = sem_init(&sem, 0, 0); in sync_kloop_conflict()
1622 if (ret != 0) { in sync_kloop_conflict()
1623 printf("sem_init() failed: %s\n", strerror(ret)); in sync_kloop_conflict()
1624 return ret; in sync_kloop_conflict()
1628 ret = pthread_create(&th1, NULL, sync_kloop_worker, ctx); in sync_kloop_conflict()
1629 err |= ret; in sync_kloop_conflict()
1630 if (ret != 0) { in sync_kloop_conflict()
1631 printf("pthread_create(kloop1): %s\n", strerror(ret)); in sync_kloop_conflict()
1634 ret = pthread_create(&th2, NULL, sync_kloop_worker, ctx); in sync_kloop_conflict()
1635 err |= ret; in sync_kloop_conflict()
1636 if (ret != 0) { in sync_kloop_conflict()
1637 printf("pthread_create(kloop2): %s\n", strerror(ret)); in sync_kloop_conflict()
1645 ret = sem_timedwait(&sem, &to); in sync_kloop_conflict()
1646 err |= ret; in sync_kloop_conflict()
1647 if (ret != 0) { in sync_kloop_conflict()
1653 ret = pthread_join(th1, &thret1); in sync_kloop_conflict()
1654 err |= ret; in sync_kloop_conflict()
1655 if (ret != 0) { in sync_kloop_conflict()
1656 printf("pthread_join(kloop1): %s\n", strerror(ret)); in sync_kloop_conflict()
1659 ret = pthread_join(th2, &thret2); in sync_kloop_conflict()
1660 err |= ret; in sync_kloop_conflict()
1661 if (ret != 0) { in sync_kloop_conflict()
1662 printf("pthread_join(kloop2): %s %d\n", strerror(ret), ret); in sync_kloop_conflict()
1682 int ret; in sync_kloop_eventfds_mismatch() local
1684 ret = push_csb_option(ctx, &opt); in sync_kloop_eventfds_mismatch()
1685 if (ret != 0) { in sync_kloop_eventfds_mismatch()
1686 return ret; in sync_kloop_eventfds_mismatch()
1689 ret = port_register_hwall_rx(ctx); in sync_kloop_eventfds_mismatch()
1690 if (ret != 0) { in sync_kloop_eventfds_mismatch()
1691 return ret; in sync_kloop_eventfds_mismatch()
1707 int ret; in null_port() local
1715 ret = port_register(ctx); in null_port()
1716 if (ret != 0) { in null_port()
1717 return ret; in null_port()
1725 int ret; in null_port_all_zero() local
1733 ret = port_register(ctx); in null_port_all_zero()
1734 if (ret != 0) { in null_port_all_zero()
1735 return ret; in null_port_all_zero()
1743 int ret; in null_port_sync() local
1751 ret = port_register(ctx); in null_port_sync()
1752 if (ret != 0) { in null_port_sync()
1753 return ret; in null_port_sync()
1755 ret = ioctl(ctx->fd, NIOCTXSYNC, 0); in null_port_sync()
1756 if (ret != 0) { in null_port_sync()
1757 return ret; in null_port_sync()
1963 int ret = 0; in nmreq_parsing() local
1981 ret = -1; in nmreq_parsing()
1983 ret = -1; in nmreq_parsing()
1988 ret = -1; in nmreq_parsing()
1992 return ret; in nmreq_parsing()
2183 int ret = 0; in main() local
2285 ret = sigaction(SIGINT, &sa, NULL); in main()
2286 if (ret) { in main()
2290 ret = sigaction(SIGTERM, &sa, NULL); in main()
2291 if (ret) { in main()
2304 ret = fd; in main()
2311 ret = tests[i].test(&ctxcopy); in main()
2312 if (ret != 0) { in main()
2322 return ret; in main()