DPDK usage discussions
 help / color / 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, back to index

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

DPDK usage discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/users/0 users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 users users/ http://inbox.dpdk.org/users \
		users@dpdk.org
	public-inbox-index users


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox