examples/vhost: fix calculation of mbuf count
authorYong Wang <wang.yong19@zte.com.cn>
Thu, 12 Jan 2017 03:52:17 +0000 (22:52 -0500)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 17 Jan 2017 08:20:18 +0000 (09:20 +0100)
When calculating 'nr_mbufs_per_core', 'MAX_PKT_BURST' was mutiplied
twice. Fix it by removing one of them.

Fixes: bdb19b771e6f ("examples/vhost: fix mbuf allocation failure")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
examples/vhost/main.c

index ac1f6e2..81a6a8c 100644 (file)
@@ -1393,7 +1393,7 @@ create_mbuf_pool(uint16_t nr_port, uint32_t nr_switch_core, uint32_t mbuf_size,
                mtu = 64 * 1024;
 
        nr_mbufs_per_core  = (mtu + mbuf_size) * MAX_PKT_BURST /
-                       (mbuf_size - RTE_PKTMBUF_HEADROOM) * MAX_PKT_BURST;
+                       (mbuf_size - RTE_PKTMBUF_HEADROOM);
        nr_mbufs_per_core += nr_rx_desc;
        nr_mbufs_per_core  = RTE_MAX(nr_mbufs_per_core, nr_mbuf_cache);