X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Ftep_termination%2Fmain.c;h=cd6e3f1cfa74a5bc9611f989b8c3eedf71067d35;hb=0f31eb0cf248acd997b6e56fde63b1edeea9a425;hp=8097dcdd4401fc388ee6597ce5d6b7cc9b5f82a9;hpb=0917f9d1f059284d4fcb8e6342fd2557d6da9c9b;p=dpdk.git diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 8097dcdd44..cd6e3f1cfa 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "main.h" #include "vxlan.h" @@ -1081,7 +1081,7 @@ new_device(int vid) * These callback allow devices to be added to the data core when configuration * has been fully complete. */ -static const struct virtio_net_device_ops virtio_net_device_ops = { +static const struct vhost_device_ops virtio_net_device_ops = { .new_device = new_device, .destroy_device = destroy_device, }; @@ -1256,9 +1256,20 @@ main(int argc, char *argv[]) rte_vhost_driver_disable_features(dev_basename, 1ULL << VIRTIO_NET_F_MRG_RXBUF); - rte_vhost_driver_callback_register(&virtio_net_device_ops); + ret = rte_vhost_driver_callback_register(dev_basename, + &virtio_net_device_ops); + if (ret != 0) { + rte_exit(EXIT_FAILURE, + "failed to register vhost driver callbacks.\n"); + } + + if (rte_vhost_driver_start(dev_basename) < 0) { + rte_exit(EXIT_FAILURE, + "failed to start vhost driver.\n"); + } - rte_vhost_driver_session_start(); + RTE_LCORE_FOREACH_SLAVE(lcore_id) + rte_eal_wait_lcore(lcore_id); return 0; }