X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Ftep_termination%2Fmain.c;h=a14d2e3791602f8da7bd947fe894ab9a26a2e1bc;hb=f2f020d21049cb6439c35276b767d1c42e047618;hp=18b977e64df96d6e9a287af3d17fb75321e5f572;hpb=93433b639d07eed499612b32286122791b0d3639;p=dpdk.git diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index 18b977e64d..a14d2e3791 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" @@ -97,7 +98,7 @@ #define MBUF_HEADROOM_UINT32(mbuf) (*(uint32_t *)((uint8_t *)(mbuf) \ + sizeof(struct rte_mbuf))) -#define INVALID_PORT_ID 0xFF +#define INVALID_PORT_ID 0xFFFF /* Size of buffers used for snprintfs. */ #define MAX_PRINT_BUFF 6072 @@ -183,7 +184,7 @@ static uint32_t burst_rx_retry_num = BURST_RX_RETRIES; static char dev_basename[MAX_BASENAME_SZ] = "vhost-net"; static unsigned lcore_ids[RTE_MAX_LCORE]; -uint8_t ports[RTE_MAX_ETHPORTS]; +uint16_t ports[RTE_MAX_ETHPORTS]; static unsigned nb_ports; /**< The number of ports specified in command line */ @@ -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, }; @@ -1160,7 +1161,7 @@ main(int argc, char *argv[]) unsigned lcore_id, core_id = 0; unsigned nb_ports, valid_nb_ports; int ret; - uint8_t portid; + uint16_t portid; uint16_t queue_id; static pthread_t tid; char thread_name[RTE_MAX_THREAD_NAME_LEN]; @@ -1263,7 +1264,13 @@ main(int argc, char *argv[]) "failed to register vhost driver callbacks.\n"); } - rte_vhost_driver_session_start(); + 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; }