mbuf: add a function to linearize a packet
authorTomasz Kulasek <tomaszx.kulasek@intel.com>
Thu, 12 Jan 2017 09:40:44 +0000 (10:40 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sun, 15 Jan 2017 18:30:00 +0000 (19:30 +0100)
commit1feda4d8fc422ceb1700d32175501f4f691eb844
tree5445f4abd47aa192637e7e257082c77e5d01df91
parentbb98856f24fcfc5cefade9a569479ddbe2a29494
mbuf: add a function to linearize a packet

This patch adds function rte_pktmbuf_linearize to let crypto PMD coalesce
chained mbuf before crypto operation and extend their capabilities to
support segmented mbufs when device cannot handle them natively.

Included unit tests for rte_pktmbuf_linearize functionality:

 1) Creates banch of segmented mbufs with different size and number of
    segments.
 2) Fills noncontigouos mbuf with sequential values.
 3) Uses rte_pktmbuf_linearize to coalesce segmented buffer into one
    contiguous.
 4) Verifies data in linearized buffer.

Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_mbuf.c
lib/librte_mbuf/rte_mbuf.h