[dpdk-users] rte_pktmbuf_free does not reset headroom
Girard, Guillaume
guillaume.girard at intel.com
Thu Jan 16 09:51:52 CET 2020
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Wednesday, 15 January 2020 19:29
> To: Girard, Guillaume <guillaume.girard at intel.com>
> Cc: users at dpdk.org
> Subject: Re: [dpdk-users] rte_pktmbuf_free does not reset headroom
>
> On Wed, 15 Jan 2020 16:40:47 +0000
> "Girard, Guillaume" <guillaume.girard at intel.com> wrote:
>
> > Hi,
> >
> > From my experiments prepending data to an mbuf, rte_pktmbuf_free() does
> not reset the headroom. Is that intended?
> >
> > Thanks,
> > Guillaume
> >
> > Intel Deutschland GmbH
> > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> > Tel: +49 89 99 8853-0, www.intel.de
> > Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of
> > the Supervisory Board: Nicole Lau Registered Office: Munich Commercial
> > Register: Amtsgericht Muenchen HRB 186928
> >
>
> Free doesn't need to do anything to the mbuf. After free the state of the mbuf is
> indeterminate (ie. it can be what ever rte_mbuf code wants).
>
> The headroom is reset in rte_pktmbuf_reset() which is called by
> rte_pktmbuf_alloc().
Thank you, that makes sense. In that case, I was fetching mbufs directly from the pool, which is why I saw that behavior. I will change my code.
Best regards,
Guillaume
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
More information about the users
mailing list