mbuf: add a copy routine
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 8 Oct 2019 16:33:49 +0000 (09:33 -0700)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 16 Oct 2019 10:43:53 +0000 (12:43 +0200)
commitc3a90c381daa68a0ea65906ad15bc96c247ac5cd
tree5d6fe77ff303af7ca6867122b39293715563abf9
parent1d2db47c9f8e49231f3fa9603e4fd83d0a827bcb
mbuf: add a copy routine

This is a commonly used operation that surprisingly the
DPDK has not supported. The new rte_pktmbuf_copy does a
deep copy of packet. This is a complete copy including
meta-data.

It handles the case where the source mbuf comes from a pool
with larger data area than the destination pool. The routine
also has options for skipping data, or truncating at a fixed
length.

This patch also introduces internal inline to copy the
metadata fields of mbuf.

Add a test for this new function, based of the clone tests.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_mbuf.c
lib/librte_mbuf/rte_mbuf.c
lib/librte_mbuf/rte_mbuf.h
lib/librte_mbuf/rte_mbuf_version.map