[dpdk-dev] [PATCH] examples/vhost: fix calc err of nr_mbufs_per_core

Yong Wang wang.yong19 at zte.com.cn
Thu Jan 12 04:52:17 CET 2017


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")

Signed-off-by: Yong Wang <wang.yong19 at zte.com.cn>
---
 examples/vhost/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index ac1f6e2..81a6a8c 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1393,7 +1393,7 @@ static inline void __attribute__((always_inline))
 		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);
 
-- 
1.8.3.1




More information about the dev mailing list