All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private structure
Date: Wed, 20 Nov 2019 07:56:14 -0800	[thread overview]
Message-ID: <20191120075614.07bf2207@hermes.lan> (raw)
In-Reply-To: <AM0PR0502MB3795933B2398576A4CBE997CC34F0@AM0PR0502MB3795.eurprd05.prod.outlook.com>

On Wed, 20 Nov 2019 07:01:26 +0000
Shahaf Shuler <shahafs@mellanox.com> wrote:

> Wednesday, November 20, 2019 1:51 AM, Stephen Hemminger:
> > Subject: Re: [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private
> > structure
> > 
> > On Tue, 19 Nov 2019 23:30:15 +0100
> > Thomas Monjalon <thomas@monjalon.net> wrote:
> >   
> > > 19/11/2019 17:25, Stephen Hemminger:  
> > > > On Tue, 19 Nov 2019 15:23:50 +0000
> > > > Shahaf Shuler <shahafs@mellanox.com> wrote:
> > > >  
> > > > > Tuesday, November 19, 2019 11:33 AM, Thomas Monjalon:  
> > > > > > Subject: Re: [PATCH] mbuf: extend pktmbuf pool private structure
> > > > > >
> > > > > > 18/11/2019 11:02, Shahaf Shuler:  
> > > > > > >  struct rte_pktmbuf_pool_private {
> > > > > > >  	uint16_t mbuf_data_room_size; /**< Size of data space in  
> > each  
> > > > > > mbuf. */  
> > > > > > >  	uint16_t mbuf_priv_size;      /**< Size of private area in each  
> > mbuf.  
> > > > > > */  
> > > > > > > +	uint32_t reserved; /**< reserved for future use. */  
> > > > > >
> > > > > > Maybe simpler to give the future name "flags" and keep the  
> > comment  
> > > > > > "reserved for future use".  
> > > > >
> > > > > I'm am OK w/ changing to flags.
> > > > > If Olivier accepts maybe you can change while applying?  
> > > >
> > > > After the Linux openat experience if you want to add flags.
> > > > Then all usage of API needs to validate that flags is 0.  
> > >
> > > Sorry Stephen, I don't understand what you mean.
> > > Please could you explain?
> > >
> > >  
> > 
> > Any time a new field is added that maybe used later you can not guarantee
> > that existing code correctly initializes the value to zero. What happened with
> > openat() was that there was a flag value that was originally unused, but since
> > kernel did not enforce that it was zero; it could not later be used for
> > extensions.
> > 
> > You need to make sure that all reserved fields are initialized.
> > That means when a private pool is created it is zeroed. And if a flag is new
> > argument to an API, check for zero at create time.  
> 
> I guess we can hard code the value for 0 on the rte_pktmbuf_pool_create function and have some assert on the rte_pktmbuf_pool_init callback (we cannot fail as this function returns void).
> Any other places you find problematic? 

No. that should be good. 

  reply	other threads:[~2019-11-20 15:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 10:02 [dpdk-dev] [PATCH] mbuf: extend pktmbuf pool private structure Shahaf Shuler
2019-11-18 16:12 ` Stephen Hemminger
2019-11-19  6:35   ` Shahaf Shuler
2019-11-19  9:32 ` Thomas Monjalon
2019-11-19 15:23   ` Shahaf Shuler
2019-11-19 16:25     ` Stephen Hemminger
2019-11-19 22:30       ` Thomas Monjalon
2019-11-19 23:50         ` Stephen Hemminger
2019-11-20  7:01           ` Shahaf Shuler
2019-11-20 15:56             ` Stephen Hemminger [this message]
2019-11-21 14:15               ` Olivier Matz
2019-11-21 12:28 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
2019-11-21 14:31   ` Olivier Matz
2019-11-24  5:52     ` Shahaf Shuler
2019-11-24  5:53   ` [dpdk-dev] [PATCH v3] " Shahaf Shuler
2019-11-24 17:50     ` Stephen Hemminger
2019-11-24 18:05       ` Thomas Monjalon
2019-11-24 18:10         ` Shahaf Shuler
2019-11-25  8:12     ` Olivier Matz
2019-11-25 10:21     ` [dpdk-dev] [PATCH v4] " Shahaf Shuler
2019-11-25 10:27       ` Olivier Matz
2019-11-25 21:42         ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191120075614.07bf2207@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.