doc: fix references to old binding script
[dpdk.git] / examples / l2fwd-ivshmem / host / host.c
index 197f22b..da7b00d 100644 (file)
@@ -41,7 +41,6 @@
 #include <signal.h>
 
 #include <rte_eal.h>
-#include <rte_config.h>
 #include <rte_cycles.h>
 #include <rte_eal_memconfig.h>
 #include <rte_debug.h>
@@ -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_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
 
 #define MAX_RX_QUEUE_PER_LCORE 16
 #define MAX_TX_QUEUE_PER_PORT 16
@@ -112,7 +110,8 @@ static void
 print_stats(void)
 {
        uint64_t total_packets_dropped, total_packets_tx, total_packets_rx;
-       uint64_t total_vm_packets_dropped, total_vm_packets_tx, total_vm_packets_rx;
+       uint64_t total_vm_packets_dropped = 0;
+       uint64_t total_vm_packets_tx, total_vm_packets_rx;
        unsigned portid;
 
        total_packets_dropped = 0;
@@ -373,7 +372,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;
                        }
@@ -671,7 +670,7 @@ int main(int argc, char **argv)
        /* create a shared mbuf pool */
        l2fwd_ivshmem_pktmbuf_pool =
                rte_pktmbuf_pool_create(MBUF_MP_NAME, NB_MBUF, 32,
-                       0, MBUF_DATA_SIZE, rte_socket_id());
+                       0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
        if (l2fwd_ivshmem_pktmbuf_pool == NULL)
                rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
 
@@ -679,9 +678,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