From: Yong Wang Date: Thu, 12 Jan 2017 03:52:17 +0000 (-0500) Subject: examples/vhost: fix calculation of mbuf count X-Git-Tag: spdx-start~5174 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=12ee45a3620b30a99d21cbf5a25d787f088f0de9;p=dpdk.git examples/vhost: fix calculation of mbuf count 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 Acked-by: Yuanhan Liu --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ac1f6e203c..81a6a8cf91 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -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);