mbuf: fix data room size calculation in pool init
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 22 Apr 2015 09:57:18 +0000 (11:57 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 27 Apr 2015 20:39:20 +0000 (22:39 +0200)
commit1d493a49490fa90e09689d49280cff0d51d0193e
tree2ab6c8e4ac9458427d5b6b79a15b4bc6b0e1144a
parent37f9a7270e800df5c603b2c76c73ed3bca3328d9
mbuf: fix data room size calculation in pool init

Deduct the mbuf data room size from mempool->elt_size and priv_size,
instead of using an hardcoded value that is not related to the real
buffer size.

To use rte_pktmbuf_pool_init(), the user can either:
- give a NULL parameter to rte_pktmbuf_pool_init(): in this case, the
  private size is assumed to be 0, and the room size is
  mp->elt_size - sizeof(struct rte_mbuf).
- give the rte_pktmbuf_pool_private filled with appropriate
  data_room_size and priv_size values.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
app/test-pmd/testpmd.c
doc/guides/rel_notes/updating_apps.rst
examples/vhost/main.c
lib/librte_mbuf/rte_mbuf.c
lib/librte_mbuf/rte_mbuf.h