X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Ftep_termination%2Fmain.c;h=aee36c6e48be3a4a272e089a6cd5166be98c82ae;hb=0cc67a96e4867d0b35b94fcb29114c6ddfe46efb;hp=8097dcdd4401fc388ee6597ce5d6b7cc9b5f82a9;hpb=0917f9d1f059284d4fcb8e6342fd2557d6da9c9b;p=dpdk.git diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 8097dcdd44..aee36c6e48 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -49,7 +49,8 @@ #include #include #include -#include +#include +#include #include "main.h" #include "vxlan.h" @@ -559,7 +560,7 @@ check_ports_num(unsigned max_nb_ports) * This function routes the TX packet to the correct interface. This may be a local device * or the physical port. */ -static inline void __attribute__((always_inline)) +static __rte_always_inline void virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m) { struct mbuf_table *tx_q; @@ -1081,7 +1082,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 +1257,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; }