From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B4CCF1BBFB for ; Fri, 11 Jan 2019 15:33:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2019 06:33:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,466,1539673200"; d="scan'208";a="107508817" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga006.jf.intel.com with ESMTP; 11 Jan 2019 06:33:18 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.205]) by IRSMSX151.ger.corp.intel.com ([169.254.4.172]) with mapi id 14.03.0415.000; Fri, 11 Jan 2019 14:33:17 +0000 From: "Dumitrescu, Cristian" To: "Van Haaren, Harry" , "dev@dpdk.org" CC: "Pattan, Reshma" , "olivier.matz@6wind.com" , "thomas@monjalon.net" , "stephen@networkplumber.org" , "gavin.hu@arm.com" , "honnappa.nagarahalli@arm.com" Thread-Topic: [PATCH v3] mbuf: fix compile by making sched struct visible Thread-Index: AQHUqaFWZJ5wME8PckKki1hO/3o/x6WqIVUQ Date: Fri, 11 Jan 2019 14:33:16 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E82929F@IRSMSX108.ger.corp.intel.com> References: <20190110180658.23302-1-harry.van.haaren@intel.com> <20190111113239.61275-1-harry.van.haaren@intel.com> In-Reply-To: <20190111113239.61275-1-harry.van.haaren@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjU3NDI2Y2YtM2M3Mi00ODljLWE1YWQtMWE2MjA3MGMxZjRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS1N6Wk1xUVwvelhaUWd2YzBGRkl6aDlxSG42eVUzNFRaZXVXZ3R1RUNtMXd5NHp4SG5jTitNcEdST25HaGl6bUcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 11 Jan 2019 14:33:21 -0000 > -----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 >=20 > 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. >=20 > 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. >=20 > Fixes: 5d3f72100904 ("mbuf: implement generic format for sched field") >=20 > Signed-off-by: Harry van Haaren >=20 > --- >=20 > v3: > - Update comment in mbuf to state size of struct sched (Crisitian) >=20 > v2: > - Different solution, not applicable, v3 based on v1 (ML discussion) >=20 > 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(-) >=20 > 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 */ >=20 > +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.