[dpdk-dev] [PATCH v3 0/5] mbuf: enhancements of mbuf clones

Olivier Matz olivier.matz at 6wind.com
Tue Mar 31 21:22:59 CEST 2015


This series fixes the support of indirect mbufs when the application
reserves a private area in mbufs. This is done adding a new field
in each mbuf storing the size of this private area. Another option
would have been to store that in the mbuf pool private info, but
as we have enough room in mbuf, it's faster to have it in the mbuf.

The series also removes the limitation that rte_pktmbuf_clone() is
only allowed on direct (non-cloned) mbufs.

Changes in v3:
- a mbuf can now attach to another one that have a different private
  size. In this case, the m->priv_size corresponds to the size of the
  private area of the direct mbuf.
- add comments to reflect these changes
- minor style modifications

Changes in v2:
- do not change the use of MBUF_EXT_MEM() in vhost
- change rte_mbuf_from_baddr() to rte_mbuf_from_indirect(), removing
  one parameter
- fix and rework rte_pktmbuf_detach()
- move m->priv_size in second mbuf cache line
- fix mbuf free in test error case

Olivier Matz (5):
  mbuf: fix clone support when application uses private mbuf data
  mbuf: allow to clone an indirect mbuf
  test/mbuf: rename mc variable in m
  test/mbuf: enhance mbuf refcnt test
  test/mbuf: verify that cloning a clone works properly

 app/test-pmd/testpmd.c     |   1 +
 app/test/test_mbuf.c       |  88 +++++++++++++++++++++++++++-----
 examples/vhost/main.c      |   4 +-
 lib/librte_mbuf/rte_mbuf.c |   1 +
 lib/librte_mbuf/rte_mbuf.h | 123 +++++++++++++++++++++++++++++++--------------
 5 files changed, 164 insertions(+), 53 deletions(-)

-- 
2.1.4



More information about the dev mailing list