New upstream version 16.11.4
[deb_dpdk.git] / examples / multi_process / l2fwd_fork / main.c
index 2dc8b82..88b336e 100644 (file)
@@ -163,7 +163,7 @@ static const struct rte_eth_conf port_conf = {
                .hw_ip_checksum = 0, /**< IP checksum offload disabled */
                .hw_vlan_filter = 0, /**< VLAN filtering disabled */
                .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 0, /**< CRC stripped by hardware */
+               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
@@ -442,7 +442,8 @@ reset_slave_all_ports(unsigned slaveid)
                pool = rte_mempool_lookup(buf_name);
                if (pool)
                        printf("Port %d mempool free object is %u(%u)\n", slave->port[i],
-                               rte_mempool_count(pool), (unsigned)NB_MBUF);
+                               rte_mempool_avail_count(pool),
+                               (unsigned int)NB_MBUF);
                else
                        printf("Can't find mempool %s\n", buf_name);
 
@@ -671,6 +672,8 @@ l2fwd_main_loop(void)
                                        port_statistics[portid].tx += sent;
 
                        }
+
+                       prev_tsc = cur_tsc;
                }
 
                /*
@@ -979,9 +982,6 @@ 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;
-
        /* create the mbuf pool */
        for (portid = 0; portid < nb_ports; portid++) {
                /* skip ports that are not enabled */
@@ -1205,10 +1205,7 @@ main(int argc, char **argv)
        message_pool = rte_mempool_create("ms_msg_pool",
                           NB_CORE_MSGBUF * RTE_MAX_LCORE,
                           sizeof(enum l2fwd_cmd), NB_CORE_MSGBUF / 2,
-                          0,
-                          rte_pktmbuf_pool_init, NULL,
-                          rte_pktmbuf_init, NULL,
-                          rte_socket_id(), 0);
+                          0, NULL, NULL, NULL, NULL, rte_socket_id(), 0);
 
        if (message_pool == NULL)
                rte_exit(EXIT_FAILURE, "Create msg mempool failed\n");