[dpdk-dev] [PATCH RFC 06/11] mbuf: replace data pointer by an offset

Stephen Hemminger stephen at networkplumber.org
Mon May 12 19:13:16 CEST 2014


On Mon, 12 May 2014 18:13:26 +0200
Olivier MATZ <olivier.matz at 6wind.com> wrote:

> Hi Stephen,
> 
> On 05/12/2014 05:59 PM, Stephen Hemminger wrote:
> > There is one case which this case might make problematic.
> > Right now it is possible to clone an mbuf and in the cloned mbuf
> > use the associated data buffer as private meta data store.
> > This is convenient (like skb->cb in Linux) and avoids addtional
> > allocation.
> 
> I don't get your point. Why using rte_pktmbuf_mtod(m, char *)
> wouldn't work in your case?

In cloned mbuf
rte_pktmbuf_mtod(m, char *) points to the original data.
RTE_MBUF_TO_BADDR(m) points to buffer in the mbuf which we
use for metadata (timestamp).


More information about the dev mailing list