From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 29E271B207 for ; Mon, 14 Jan 2019 15:58:43 +0100 (CET) Received: from lfbn-1-5920-128.w90-110.abo.wanadoo.fr ([90.110.126.128] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gj3j6-0004KT-4R; Mon, 14 Jan 2019 16:00:33 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Mon, 14 Jan 2019 15:58:38 +0100 Date: Mon, 14 Jan 2019 15:58:38 +0100 From: Olivier Matz To: "Dumitrescu, Cristian" Cc: "Van Haaren, Harry" , "dev@dpdk.org" , "Pattan, Reshma" , "thomas@monjalon.net" , "stephen@networkplumber.org" , "gavin.hu@arm.com" , "honnappa.nagarahalli@arm.com" Message-ID: <20190114145838.lqdq3c5y23wsr3hq@platinum> References: <20190110180658.23302-1-harry.van.haaren@intel.com> <20190111113239.61275-1-harry.van.haaren@intel.com> <3EB4FA525960D640B5BDFFD6A3D891268E82929F@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D891268E82929F@IRSMSX108.ger.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v3] mbuf: fix compile by making sched struct visible X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2019 14:58:43 -0000 On Fri, Jan 11, 2019 at 02:33:16PM +0000, Dumitrescu, Cristian wrote: > > > > -----Original Message----- > > From: Van Haaren, Harry > > Sent: Friday, January 11, 2019 11:33 AM > > To: dev@dpdk.org > > Cc: Van Haaren, Harry ; Pattan, Reshma > > ; Dumitrescu, Cristian > > ; olivier.matz@6wind.com; > > thomas@monjalon.net; stephen@networkplumber.org; > > gavin.hu@arm.com; honnappa.nagarahalli@arm.com > > Subject: [PATCH v3] mbuf: fix compile by making sched struct visible > > > > Although C compilation works with the struct rte_mbuf_sched > > declared inside the struct rte_mbuf namespace, C++ fails to > > compile. This fix moves the rte_mbuf_sched struct up to the > > global namespace, instead of declaring it inside the struct > > mbuf namespace. > > > > The struct rte_mbuf_sched is being used on the stack in > > rte_mbuf_sched_get() and as a cast in _set(). For this > > reason, it must be exposed as an available type. > > > > Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") > > > > Signed-off-by: Harry van Haaren > > > > --- > > > > v3: > > - Update comment in mbuf to state size of struct sched (Crisitian) > > > > v2: > > - Different solution, not applicable, v3 based on v1 (ML discussion) > > > > Cc: reshma.pattan@intel.com > > Cc: cristian.dumitrescu@intel.com > > Cc: olivier.matz@6wind.com > > Cc: thomas@monjalon.net > > Cc: stephen@networkplumber.org > > Cc: gavin.hu@arm.com > > Cc: honnappa.nagarahalli@arm.com > > --- > > lib/librte_mbuf/rte_mbuf.h | 23 +++++++++++++---------- > > 1 file changed, 13 insertions(+), 10 deletions(-) > > > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > > index bc562dc8a..d53b68253 100644 > > --- a/lib/librte_mbuf/rte_mbuf.h > > +++ b/lib/librte_mbuf/rte_mbuf.h > > @@ -468,6 +468,17 @@ __extension__ > > typedef uint64_t MARKER64[0]; /**< marker that allows us to overwrite 8 > > bytes > > * with a single assignment */ > > > > +struct rte_mbuf_sched { > > + uint32_t queue_id; /**< Queue ID. */ > > + uint8_t traffic_class; > > + /**< Traffic class ID. Traffic class 0 > > + * is the highest priority traffic class. > > + */ > > + uint8_t color; > > + /**< Color. @see enum rte_color.*/ > > + uint16_t reserved; /**< Reserved. */ > > +}; /**< Hierarchical scheduler */ > > + > > /** > > * The generic rte_mbuf, containing a packet mbuf. > > */ > > @@ -574,16 +585,8 @@ struct rte_mbuf { > > * on PKT_RX_FDIR_* flag in ol_flags. > > */ > > } fdir; /**< Filter identifier if FDIR enabled */ > > - struct rte_mbuf_sched { > > - uint32_t queue_id; /**< Queue ID. */ > > - uint8_t traffic_class; > > - /**< Traffic class ID. Traffic class 0 > > - * is the highest priority traffic class. > > - */ > > - uint8_t color; > > - /**< Color. @see enum rte_color.*/ > > - uint16_t reserved; /**< Reserved. */ > > - } sched; /**< Hierarchical scheduler */ > > + struct rte_mbuf_sched sched; > > + /**< Hierarchical scheduler : 8 bytes */ > > struct { > > uint32_t reserved1; > > uint16_t reserved2; > > -- > > 2.17.1 > > Acked-by: Cristian Dumitrescu > > Of course, final say belongs to Olivier, so Olivier please let un know your vote. Acked-by: Olivier Matz