mbuf: fix cloning with private mbuf data
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 22 Apr 2015 09:57:25 +0000 (11:57 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 28 Apr 2015 09:34:10 +0000 (11:34 +0200)
commit355e6735b3359223f32485c3cbd4e99583eacb7c
treedef49af8de0885a7b3f12dacb6706dae5bcd1ba3
parentea0c20ea95fd5d71a10757e6598ac66233ea1495
mbuf: fix cloning with private mbuf data

Add a new priv_size field in mbuf structure that should
be initialized at mbuf pool creation. This field contains the
size of the application private data in mbufs.

Introduce new static inline functions rte_mbuf_from_indirect()
and rte_mbuf_to_baddr() to replace the existing macros, which
take the private size in account when attaching and detaching
mbufs.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
examples/vhost/main.c
lib/librte_mbuf/rte_mbuf.c
lib/librte_mbuf/rte_mbuf.h