MCPcopy Create free account
hub / github.com/F-Stack/f-stack / main

Function main

dpdk/examples/vhost_blk/vhost_blk.c:869–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869int main(int argc, char *argv[])
870{
871 int ret;
872
873 /* init EAL */
874 ret = rte_eal_init(argc, argv);
875 if (ret < 0)
876 rte_exit(EXIT_FAILURE, "Error with EAL initialization\n");
877
878 g_vhost_ctrlr = vhost_blk_ctrlr_construct(CTRLR_NAME);
879 if (g_vhost_ctrlr == NULL) {
880 fprintf(stderr, "Construct vhost blk controller failed\n");
881 return 0;
882 }
883
884 if (sem_init(&exit_sem, 0, 0) < 0) {
885 fprintf(stderr, "Error init exit_sem\n");
886 return -1;
887 }
888
889 signal(SIGINT, signal_handler);
890
891 ret = rte_vhost_driver_start(dev_pathname);
892 if (ret < 0) {
893 fprintf(stderr, "Failed to start vhost driver.\n");
894 return -1;
895 }
896
897 /* loop for exit the application */
898 while (1)
899 sleep(1);
900
901 /* clean up the EAL */
902 rte_eal_cleanup();
903
904 return 0;
905}

Callers

nothing calls this directly

Calls 5

rte_exitFunction · 0.85
rte_vhost_driver_startFunction · 0.85
rte_eal_initFunction · 0.50
rte_eal_cleanupFunction · 0.50

Tested by

no test coverage detected