X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Ftep_termination%2Fmain.c;h=83c2189fff845888ca562805af856959a00f940b;hb=02c217b1543c09b37772c6e917801d61cc3c2ca0;hp=20dafdb8fc7fe7167bb61bc972f6771dc2f840d2;hpb=5a11168d9bf3d687950e84a9ddc8e13a77a2ef2a;p=dpdk.git diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 20dafdb8fc..83c2189fff 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" @@ -559,7 +559,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 +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, }; @@ -1248,15 +1248,28 @@ main(int argc, char *argv[]) rte_eal_remote_launch(switch_worker, mbuf_pool, lcore_id); } - rte_vhost_feature_disable(1ULL << VIRTIO_NET_F_MRG_RXBUF); ret = rte_vhost_driver_register((char *)&dev_basename, 0); if (ret != 0) rte_exit(EXIT_FAILURE, "failed to register vhost driver.\n"); - rte_vhost_driver_callback_register(&virtio_net_device_ops); + rte_vhost_driver_disable_features(dev_basename, + 1ULL << VIRTIO_NET_F_MRG_RXBUF); - rte_vhost_driver_session_start(); + 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_LCORE_FOREACH_SLAVE(lcore_id) + rte_eal_wait_lcore(lcore_id); return 0; }