X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fl2fwd-ivshmem%2Fhost%2Fhost.c;h=cd284b7d3a91322e519f9ca8229e87ce8abf52ce;hb=72ceac0fcab2baab8f4e3ce40fd2cb84aaefafc3;hp=4f8d23edb0d92a8789a10fe2fd48d0bc9cbd7020;hpb=81f7ecd934372fc9f592d1322f8eff86350fa4f5;p=dpdk.git diff --git a/examples/l2fwd-ivshmem/host/host.c b/examples/l2fwd-ivshmem/host/host.c index 4f8d23edb0..cd284b7d3a 100644 --- a/examples/l2fwd-ivshmem/host/host.c +++ b/examples/l2fwd-ivshmem/host/host.c @@ -41,7 +41,6 @@ #include #include -#include #include #include #include @@ -71,7 +70,6 @@ static uint32_t l2fwd_ivshmem_enabled_port_mask = 0; static struct ether_addr l2fwd_ivshmem_ports_eth_addr[RTE_MAX_ETHPORTS]; #define NB_MBUF 8192 -#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) #define MAX_RX_QUEUE_PER_LCORE 16 #define MAX_TX_QUEUE_PER_PORT 16 @@ -373,7 +371,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) continue; } /* clear all_ports_up flag if any link down */ - if (link.link_status == 0) { + if (link.link_status == ETH_LINK_DOWN) { all_ports_up = 0; break; } @@ -670,12 +668,8 @@ int main(int argc, char **argv) /* create a shared mbuf pool */ l2fwd_ivshmem_pktmbuf_pool = - rte_mempool_create(MBUF_MP_NAME, NB_MBUF, - MBUF_SIZE, 32, - sizeof(struct rte_pktmbuf_pool_private), - rte_pktmbuf_pool_init, NULL, - rte_pktmbuf_init, NULL, - rte_socket_id(), 0); + rte_pktmbuf_pool_create(MBUF_MP_NAME, NB_MBUF, 32, + 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); if (l2fwd_ivshmem_pktmbuf_pool == NULL) rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n"); @@ -683,9 +677,6 @@ int main(int argc, char **argv) if (nb_ports == 0) rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); - if (nb_ports > RTE_MAX_ETHPORTS) - nb_ports = RTE_MAX_ETHPORTS; - /* * reserve memzone to communicate with VMs - we cannot use rte_malloc here * because while it is technically possible, it is a very bad idea to share