mbuf: provide bulk allocation
authorHuawei Xie <huawei.xie@intel.com>
Sun, 28 Feb 2016 12:44:56 +0000 (20:44 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 29 Feb 2016 16:26:38 +0000 (17:26 +0100)
commit9ec201f5d6e7f67cf4cf0141ff5a0459667e945f
tree6179bced36ce4a89de0dc12298337343173cf2a7
parentbb66588304632a7e4a043d2921d06709d40f9ed4
mbuf: provide bulk allocation

rte_pktmbuf_alloc_bulk allocates a bulk of packet mbufs.

There is related thread about this bulk API.
http://dpdk.org/dev/patchwork/patch/4718/
Thanks to Konstantin's loop unrolling.

Attached the wiki page about duff's device. It explains the performance
optimization through loop unwinding, and also the most dramatic use of
case label fall-through.
https://en.wikipedia.org/wiki/Duff%27s_device

In this implementation, while() loop is used because we could not assume
count is strictly positive. Using while() loop saves one line of check.

Signed-off-by: Gerald Rogers <gerald.rogers@intel.com>
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
doc/guides/rel_notes/release_16_04.rst
lib/librte_mbuf/rte_mbuf.h