numam-dpdk/doc/guides/rel_notes
Jianfeng Tan 5499c1fc9b examples/vhost: fix mbuf allocation
How to reproduce:

1. Start vhost-switch
./examples/vhost/build/vhost-switch -c 0x3 -n 4 -- -p 1 --stat 0
2. Start VM with a virtio port
$ $QEMU -smp cores=2,sockets=1 -m 4G -cpu host -enable-kvm \
  -chardev socket,id=char1,path=<path to vhost-user socket> \
  -device virtio-net-pci,netdev=vhostuser1 \
  -netdev vhost-user,id=vhostuser1,chardev=char1
  -object memory-backend-file,id=mem,size=4G,mem-path=<hugetlbfs path>,share=on \
  -numa node,memdev=mem -mem-prealloc \
  -hda <path to VM img>
3. Start l2fwd in VM
$ ./examples/l2fwd/build/l2fwd -c 0x1 -n 4 -m 1024 -- -p 0x1
4. Use ixia to inject packets in a small data bit rate.

Error:

vhost-switch keeps printing error message:
failed to allocate memory for mbuf.

Root cause:

How many mbufs allocated for a port is calculated by below formula.
NUM_MBUFS_PER_PORT = ((MAX_QUEUES*RTE_TEST_RX_DESC_DEFAULT) + \
(num_switching_cores*MAX_PKT_BURST) + \
(num_switching_cores*RTE_TEST_TX_DESC_DEFAULT) +\
(num_switching_cores*MBUF_CACHE_SIZE))
We suppose num_switching_cores is 1 and MBUF_CACHE_SIZE is 128.
And when initializing port, master core fills mbuf mempool cache,
so there would be some left in that cache, for example 121.
So total mbufs which can be used is:
(MAX_PKT_BURST + MBUF_CACHE_SIZE - 121) = (32 + 128 - 121) = 39.
What makes it worse is that there is a buffer to store mbufs
(which will be tx_burst to physical port), if it occupies some mbufs,
there will be possible < 32 mbufs left, so vhost dequeue prints out
this msg.

In all, it fails to include master core's mbuf mempool cache.

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
2016-02-28 22:35:59 +01:00
..
deprecation.rst doc: fix ABI change announce for RETA configuration 2015-12-15 17:14:47 +01:00
index.rst doc: rename release notes 2.3 to 16.04 2016-02-10 22:43:32 +01:00
known_issues.rst doc: drop old naming of the project 2016-02-10 15:47:51 +01:00
rel_description.rst doc: simplify release notes cover 2015-08-12 09:15:27 +02:00
release_1_8.rst doc: fix spellings 2015-12-15 13:50:42 +01:00
release_2_0.rst doc: add missing release notes for mlx4 availability in 2.0 2015-08-17 19:35:37 +02:00
release_2_1.rst doc: add mlx4 release notes for version 2.1 2015-08-17 19:35:37 +02:00
release_2_2.rst doc: add statistics fixes in release notes 2015-12-15 13:50:42 +01:00
release_16_04.rst examples/vhost: fix mbuf allocation 2016-02-28 22:35:59 +01:00
supported_os.rst doc: restructure release notes 2015-08-11 17:28:13 +02:00