From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 2A1CE1B586 for ; Tue, 18 Dec 2018 13:10:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2018 04:10:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,367,1539673200"; d="scan'208";a="119373212" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by FMSMGA003.fm.intel.com with ESMTP; 18 Dec 2018 04:10:39 -0800 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.227]) by IRSMSX153.ger.corp.intel.com ([169.254.9.112]) with mapi id 14.03.0415.000; Tue, 18 Dec 2018 12:10:38 +0000 From: "Ananyev, Konstantin" To: "Singh, Jasvinder" , "Pattan, Reshma" , "Dumitrescu, Cristian" , "dev@dpdk.org" , "jerin.jacob@caviumnetworks.com" Thread-Topic: [dpdk-dev] [PATCH v2 2/3] eal: add new rte color definition Thread-Index: AQHUjjm2Aa3ZqX88DkWLrO3Mc2yE4qV+7o9ggAALzYCAA9e5IIAAaaCAgAAayACAAQGN4IAAA3+AgAAC85CAAAFogIAAAyKAgAATs3A= Date: Tue, 18 Dec 2018 12:10:38 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258010D8BBD75@IRSMSX106.ger.corp.intel.com> References: <20181123165423.134922-1-jasvinder.singh@intel.com> <1544193116-7058-2-git-send-email-reshma.pattan@intel.com> <2601191342CEEE43887BDE71AB977258010D8BA5F8@IRSMSX106.ger.corp.intel.com> <3EB4FA525960D640B5BDFFD6A3D891268E81545F@IRSMSX108.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258010D8BB16D@IRSMSX106.ger.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3EB753@irsmsx110.ger.corp.intel.com> <3EB4FA525960D640B5BDFFD6A3D891268E816063@IRSMSX108.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258010D8BBB63@IRSMSX106.ger.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3EBC37@irsmsx110.ger.corp.intel.com> <2601191342CEEE43887BDE71AB977258010D8BBC1C@IRSMSX106.ger.corp.intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3EC4A0@irsmsx110.ger.corp.intel.com> <54CBAA185211B4429112C315DA58FF6D33682C92@IRSMSX103.ger.corp.intel.com> In-Reply-To: <54CBAA185211B4429112C315DA58FF6D33682C92@IRSMSX103.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTNjMWM0MjEtZDA0Ny00ZGQ3LWJlMmUtMDFmY2Y3NjZkZjhlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMnZGcWJyNE1kdDZ4OU9KbjlSbFhVK1FONWFBZkdtbFRiWmdBMk56UE56TTExRFp6Zk1kQ3RoWVVGYVdmVGxnWCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/3] eal: add new rte color definition 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: Tue, 18 Dec 2018 12:10:42 -0000 > > > > > > > > > > > diff --git a/lib/librte_eal/common/include/rte_color.= h > > > > > > > > > > b/lib/librte_eal/common/include/rte_color.h > > > > > > > > > > > new file mode 100644 > > > > > > > > > > > index 000000000..f4387071b > > > > > > > > > > > --- /dev/null > > > > > > > > > > > +++ b/lib/librte_eal/common/include/rte_color.h > > > > > > > > > > > @@ -0,0 +1,18 @@ > > > > > > > > > > > +/* SPDX-License-Identifier: BSD-3-Clause > > > > > > > > > > > + * Copyright(c) 2018 Intel Corporation */ > > > > > > > > > > > + > > > > > > > > > > > +#ifndef _RTE_COLOR_H_ #define _RTE_COLOR_H_ > > > > > > > > > > > + > > > > > > > > > > > +/** > > > > > > > > > > > + * Color > > > > > > > > > > > + */ > > > > > > > > > > > +enum rte_color { > > > > > > > > > > > + RTE_COLOR_GREEN =3D 0, /**< Green */ > > > > > > > > > > > + RTE_COLOR_YELLOW, /**< Yellow */ > > > > > > > > > > > + RTE_COLOR_RED, /**< Red */ > > > > > > > > > > > + RTE_COLORS /**< Number of colors */ }; > > > > > > > > > > > > > > > > > > > > Does it really belong to EAL? > > > > > > > > > > Konstantin > > > > > > > > > > > > > > > > > > > > > > > > > > > > Why not? > > > > > > > > > > > > > > > > > > It needs to be visible to multiple libraries: ethdev, > > > > > > > > > meter, sched, as well as drivers. We'd like to avoid > > > > > > > > > adding more complexity to > > > > > > > dependencies > > > > > > > > between libraries. > > > > > > > > > > > > > > > > > > It is very generic. EAL common/include is currently the > > > > > > > > > place to put generic data structures, functions, algs, et= c > > > > > > > > > that are widely used by DPDK > > > > > > > > libraries. Lots of similar examples are easy to find in thi= s folder. > > > > > > > > > > > > > > > > I don't think it is *that* generic to be in EAL. > > > > > > > > Yes it is used by few libs, ethdev and by softnic PMD, but > > > > > > > > it doesn't look as core dpdk thing to me. > > > > > > > > > > > > > > > > > > > > > > > > > > Where else would you put it? > > > > > > > > > > > > > > > > If it defines format of rte_mbuf fileds, then probably new > > > > > > > > .h inside > > > > > > > librte_mbuf is > > > > > > > > a good place. > > > > > > > > Other alternatives would be rte_ethdev or rte_net. > > > > > > > > > > > > > > After going through the lib/Makefile dependencies, I see we > > > > > > > can have rte_color.h in eal or mbuf library only. > > > > > > > Cannot keep it inside ethdev or net libraries because these > > > > > > > two libraries already have dependency on mbuf library, so > > > > > > > cannot create loop dependency. > > > > > > > > > > > > > > Snippet > > > > > > > > > > > > > > 1) DEPDIRS-librte_eal :=3D librte_kvargs > > > > > > > > > > > > > > 2)DEPDIRS-librte_mbuf :=3D librte_eal librte_mempool > > > > > > > > > > > > > > 3)DEPDIRS-librte_ethdev :=3D librte_net librte_eal > > > > > > > librte_mempool librte_ring DEPDIRS-librte_ethdev +=3D > > > > > > > librte_mbuf DEPDIRS-librte_ethdev +=3D librte_kvargs > > > > > > > DEPDIRS-librte_ethdev +=3D librte_cmdline > > > > > > > > > > > > > > 4) DEPDIRS-librte_net :=3D librte_mbuf librte_eal > > > > > > > > > > > > > > 5) DEPDIRS-librte_meter :=3D librte_eal > > > > > > > > > > > > > > Thanks, > > > > > > > Reshma > > > > > > > > > > > > Yes, I wound not mind to put this header file in librte_net, it > > > > > > makes sense to me. But librte_net depends on librte_mbuf, so > > > > > > then librte_net is not > > > > > an option. > > > > > > > > > > > > The only two options are librte_eal and librte_mbuf. Between > > > > > > these two, my vote was librte_eal (as we already have plenty of > > > > > > similar items in librte_eal/common/include) instead of > > > > > > librte_mbuf, as to me the > > > > > packet color is not related to how DPDK decides to pick its packe= t > > > > > meta- > > > data. > > > > > > > > > > > > To me, librte_eal/common/include is still the best option, but = I > > > > > > guess I can live > > > > > with librte_mbuf in case Konstantin has a hard opinion on it. > > > > > > > > > > > > What is your choice, Konstantin? > > > > > > > > > > If to choose between EAL and mbuf - I would choose mbuf, that wha= t > > > > > I stated in my previous mail, see above. > > > > > BTW, I probably missing something, but why rte_net is not an opti= on? > > > > > What circular dependency you are talking about? > > > > > Konstantin > > > > > > > > > > > > > Since librte_net has mbuf in its dependent list as below from lib/M= akefile. > > > > i.e. DEPDIRS-librte_net :=3D librte_mbuf librte_eal > > > > > > > > So now, If we move rte_color.h to librte_net, then need to add > > > > librte_net to mbuf dependency list(as we are using rte_color.h in > > > > rte_mbuf.h) > > > > > > > > Current mbuf dependency list is > > > > DEPDIRS-librte_mbuf :=3D librte_eal librte_mempool > > > > > > > > The new will be > > > > DEPDIRS-librte_mbuf :=3D librte_eal librte_mempool librte_net > > > > > > > > So this will create circular dependency, I think this is not allowe= d in DPDK > > right? > > > > > > I understand that part, but why rte_color definitions have to be > > > visible by rte_mbuf? > > > Do you refer it in rte_mbuf functions? > > > > > > Oh yes, in 2nd patch of this patchset we have added new set/get functio= ns in > > librte_mbuf, there ,we are referring the rte_color. > > I am sorry I would have been more explicit in my earlier mail. > > >=20 > I guess Reshma is referring to 2nd patch of the v3 version which is the l= atest version of this series. > Patchwork: https://patches.dpdk.org/patch/48788/ > Mail list: https://mails.dpdk.org/archives/dev/2018-December/120848.html >=20 Thanks for clarification. In theory inside mbuf color is just uint8_t, so I think you can keep mrte_m= buf.h as it is, and have rte_color and realted function definitions in different place (rte= _net/rte_meter).=20 Another possible option is to create a new .h file inside librte_mbuf (rte_= mbuf_meter.h or so), put related struct/enum/function definitions into it and include it from r= te_mbuf.h =20 Konstantin