[dpdk-dev] examples/vhost: fix calc err of nr_mbufs_per_core
Checks
Commit Message
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@zte.com.cn>
---
examples/vhost/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Jan 11, 2017 at 10:52:17PM -0500, Yong Wang wrote:
> 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@zte.com.cn>
Applied to dpdk-next-virtio.
Thanks.
--yliu
@@ -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);