From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 54193A3295 for ; Wed, 23 Oct 2019 13:49:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B20311C10F; Wed, 23 Oct 2019 13:49:22 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 796E81C10C for ; Wed, 23 Oct 2019 13:49:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 04:49:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,220,1569308400"; d="scan'208";a="372854434" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga005.jf.intel.com with ESMTP; 23 Oct 2019 04:49:18 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.252]) by IRSMSX152.ger.corp.intel.com ([169.254.6.76]) with mapi id 14.03.0439.000; Wed, 23 Oct 2019 12:49:17 +0100 From: "Ananyev, Konstantin" To: Olivier Matz CC: "dev@dpdk.org" , Andrew Rybchenko , "Richardson, Bruce" , "Wang, Haiyue" , "Jerin Jacob Kollanukkaran" , "Wiles, Keith" , =?iso-8859-1?Q?Morten_Br=F8rup?= , Stephen Hemminger , Thomas Monjalon Thread-Topic: [PATCH v2] mbuf: support dynamic fields and flags Thread-Index: AQHVhPkmj10y/x3Gj0mcCTjWlAS5/6dnRDsAgAC32ACAABgUgIAAEXqg Date: Wed, 23 Oct 2019 11:49:17 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801A8C6E964@IRSMSX104.ger.corp.intel.com> References: <20190710092907.5565-1-olivier.matz@6wind.com> <20191017144219.32708-1-olivier.matz@6wind.com> <2601191342CEEE43887BDE71AB97725801A8C6E2BD@IRSMSX104.ger.corp.intel.com> <20191023101946.GH25286@glumotte.dev.6wind.com> <20191023114557.GL25286@glumotte.dev.6wind.com> In-Reply-To: <20191023114557.GL25286@glumotte.dev.6wind.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWEzODgyMTQtMjNjZi00ZGU2LWI3ZmQtNjU5N2EwMmIyM2Y4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTWpPSTArbHhoS1VBVnZNb2hJWGphb0JYdUt3OTJqRVwvZzdwRmhcL1dadlJYMDNadG1ncUVYVTY3OVhmR0c4TVU0In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] mbuf: support dynamic fields and flags 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Olivier Matz > Sent: Wednesday, October 23, 2019 12:46 PM > To: Ananyev, Konstantin > Cc: dev@dpdk.org; Andrew Rybchenko ; Richardso= n, Bruce ; Wang, > Haiyue ; Jerin Jacob Kollanukkaran ; Wiles, Keith ; Morten > Br=F8rup ; Stephen Hemminger ; Thomas Monjalon > > Subject: Re: [PATCH v2] mbuf: support dynamic fields and flags >=20 > On Wed, Oct 23, 2019 at 12:19:46PM +0200, Olivier Matz wrote: > > On Tue, Oct 22, 2019 at 10:51:51PM +0000, Ananyev, Konstantin wrote: >=20 > (...) >=20 > > > > +/* Allocate and initialize the shared memory. Assume tailq is lock= ed */ > > > > +static int > > > > +init_shared_mem(void) > > > > +{ > > > > + const struct rte_memzone *mz; > > > > + uint64_t mask; > > > > + > > > > + if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > > > > + mz =3D rte_memzone_reserve_aligned(RTE_MBUF_DYN_MZNAME, > > > > + sizeof(struct mbuf_dyn_shm), > > > > + SOCKET_ID_ANY, 0, > > > > + RTE_CACHE_LINE_SIZE); > > > > + } else { > > > > + mz =3D rte_memzone_lookup(RTE_MBUF_DYN_MZNAME); > > > > + } > > > > + if (mz =3D=3D NULL) > > > > + return -1; > > > > + > > > > + shm =3D mz->addr; > > > > + > > > > +#define mark_free(field) \ > > > > + memset(&shm->free_space[offsetof(struct rte_mbuf, field)], \ > > > > + 1, sizeof(((struct rte_mbuf *)0)->field)) > > > > > > Still think it would look nicer without multi-line macro defines/unde= f in the middle of the function. > > > > I rather think that macro helps to make the code more readable, but it'= s > > probably just a matter of taste. Will someone puts a contract on me if = I > > keep it like this? If yes I'll do the change ;) >=20 > More seriously, do you prefer if I move the macro definition above the > function? Yes, would look better to me.