mbuf: add macro for offset arithmetic
authorCyril Chemparathy <cchemparathy@ezchip.com>
Mon, 22 Jun 2015 18:34:21 +0000 (11:34 -0700)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 24 Jun 2015 10:00:42 +0000 (12:00 +0200)
commitb2906abb0dd7207c237c81540c1d8e59e151a5bc
treeb4f3308d02c3e64f728ac348bbc4b5563d880ede
parente446bc731e9f678e7aa6381eb76bdf6cf48c0522
mbuf: add macro for offset arithmetic

There are a number of instances in the code where rte_pktmbuf_mtod()
is used to get the mbuf data pointer, only to add an offset before
casting the result to some other header type.  This patch adds a new
rte_pktmbuf_mtod_offset() macro to eliminate these awful double cast
situations.

Signed-off-by: Cyril Chemparathy <cchemparathy@ezchip.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mbuf/rte_mbuf.h