DPDK usage discussions
 help / color / mirror / Atom feed
* [dpdk-users] rte_pktmbuf_free does not reset headroom
@ 2020-01-15 16:40 Girard, Guillaume
  2020-01-15 18:29 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Girard, Guillaume @ 2020-01-15 16:40 UTC (permalink / raw)
  To: users

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] rte_pktmbuf_free does not reset headroom
  2020-01-15 16:40 [dpdk-users] rte_pktmbuf_free does not reset headroom Girard, Guillaume
@ 2020-01-15 18:29 ` Stephen Hemminger
  2020-01-16  8:51   ` Girard, Guillaume
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2020-01-15 18:29 UTC (permalink / raw)
  To: Girard, Guillaume; +Cc: users

On Wed, 15 Jan 2020 16:40:47 +0000
"Girard, Guillaume" <guillaume.girard@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().

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-users] rte_pktmbuf_free does not reset headroom
  2020-01-15 18:29 ` Stephen Hemminger
@ 2020-01-16  8:51   ` Girard, Guillaume
  0 siblings, 0 replies; 3+ messages in thread
From: Girard, Guillaume @ 2020-01-16  8:51 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Wednesday, 15 January 2020 19:29
> To: Girard, Guillaume <guillaume.girard@intel.com>
> Cc: users@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@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-16  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 16:40 [dpdk-users] rte_pktmbuf_free does not reset headroom Girard, Guillaume
2020-01-15 18:29 ` Stephen Hemminger
2020-01-16  8:51   ` Girard, Guillaume

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).