From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EA9F35F2F for ; Mon, 10 Dec 2018 19:24:29 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 10:24:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,339,1539673200"; d="scan'208";a="108461274" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by fmsmga008.fm.intel.com with ESMTP; 10 Dec 2018 10:24:22 -0800 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX154.ger.corp.intel.com (163.33.192.96) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 18:24:21 +0000 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.26]) by irsmsx111.ger.corp.intel.com ([169.254.2.183]) with mapi id 14.03.0415.000; Mon, 10 Dec 2018 18:24:21 +0000 From: "Dumitrescu, Cristian" To: "Pattan, Reshma" , "dev@dpdk.org" , "jerin.jacob@caviumnetworks.com" , "Singh, Jasvinder" Thread-Topic: [PATCH v2 2/3] eal: add new rte color definition Thread-Index: AQHUjjmhPYRdjupnb0WkxL3z2vq4LKV4RdyA Date: Mon, 10 Dec 2018 18:24:20 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E811F42@IRSMSX108.ger.corp.intel.com> References: <20181123165423.134922-1-jasvinder.singh@intel.com> <1544193116-7058-2-git-send-email-reshma.pattan@intel.com> In-Reply-To: <1544193116-7058-2-git-send-email-reshma.pattan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWVjY2MyNDgtMzM0My00ZWYxLWFjZWItODA5ODY0NzQ5OTRiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUWJTaFwvNkYyTjlMV1FNQ1h3TTlBNEMyOVNRRFlnelpXRFwvRDFZN3h1cTROMGhRdEFRbmpXNWVQeTZ6eEQzSFdlIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.180] 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: Mon, 10 Dec 2018 18:24:31 -0000 Hi Reshma, > -----Original Message----- > From: Pattan, Reshma > Sent: Friday, December 7, 2018 2:32 PM > To: dev@dpdk.org; Dumitrescu, Cristian ; > jerin.jacob@caviumnetworks.com; Singh, Jasvinder > > Cc: Pattan, Reshma > Subject: [PATCH v2 2/3] eal: add new rte color definition >=20 > Added new rte_color definition in eal to > consolidate color definition which is currently replicated > in various places such as rte_meter.h, rte_tm.h and rte_mtr.h >=20 > Removed rte_tm_color and rte_mtr_color and used the new color > definition in rte_tm* and rte_mtr* files. >=20 > Updated softnic and testpmd to use new color definition. >=20 > Signed-off-by: Jasvinder Singh > Signed-off-by: Reshma Pattan > --- > app/test-pmd/cmdline_mtr.c | 47 +++++++++++---------- > app/test-pmd/cmdline_tm.c | 23 +++++----- > drivers/net/softnic/rte_eth_softnic_flow.c | 10 +++-- > drivers/net/softnic/rte_eth_softnic_meter.c | 28 ++++++------ > drivers/net/softnic/rte_eth_softnic_tm.c | 31 ++++++++------ > lib/librte_eal/common/Makefile | 2 +- > lib/librte_eal/common/include/rte_color.h | 18 ++++++++ > lib/librte_ethdev/rte_mtr.c | 2 +- > lib/librte_ethdev/rte_mtr.h | 21 +++------ > lib/librte_ethdev/rte_mtr_driver.h | 2 +- > lib/librte_ethdev/rte_tm.h | 25 ++++------- > lib/librte_meter/rte_meter.h | 7 +++ > 12 files changed, 118 insertions(+), 98 deletions(-) > create mode 100644 lib/librte_eal/common/include/rte_color.h >=20 This patch should come first in the set, i.e. before the redefinition of th= e sched field in struct rte_mbuf, as it defines the format for the new sche= d color field. At this point, we should not remove the usage of rte_meter_color, rte_mtr_c= olor, rte_mtr_color in any of the files using them, as this will break peop= le's apps. We should first deprecate them by adding a deprecation note in t= he current release and then in one of the next releases (hopefully 19.5) re= move them completely by replacing with the new rte_color, as you do in thi= s patch. So, for now, please do not do this replacement in any of the above= files. Bottom line: remove (for now) the above changes in the .c files of = test-pmd, softnic, librte_ethdev; keep the above changes in the .h files s= uch as rte_meter.h, rte_tm.h, rte_mtr.h. Makes sense? This patch should be = very small :) > 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 */ > +}; > + > +#endif /* _RTE_COLOR_H_ */ Please add the C++ pattern at the beginning and end of this file: #ifndef __INCLUDE_RTE_COLOR__ #define __INCLUDE_RTE_COLOR__ #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index c4819b274..113db06a9 100644 > --- a/lib/librte_ethdev/rte_mtr.h > +++ b/lib/librte_ethdev/rte_mtr.h > @@ -76,21 +76,12 @@ > #include > #include > #include > +#include >=20 > #ifdef __cplusplus > extern "C" { > #endif >=20 > -/** > - * Color > - */ > -enum rte_mtr_color { > - RTE_MTR_GREEN =3D 0, /**< Green */ > - RTE_MTR_YELLOW, /**< Yellow */ > - RTE_MTR_RED, /**< Red */ > - RTE_MTR_COLORS /**< Number of colors. */ > -}; > - We should not use rte_color yet, we should simply create alias of current r= te_mtr_color enum and values to the new rte_color enum and enum values, jus= t like you do it below for rte_meter.h. So please remove the rest of the ch= anges for now. > diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h > index 646ef3880..95f322313 100644 > --- a/lib/librte_ethdev/rte_tm.h > +++ b/lib/librte_ethdev/rte_tm.h > @@ -51,6 +51,7 @@ > #include >=20 > #include > +#include >=20 > #ifdef __cplusplus > extern "C" { > @@ -115,16 +116,6 @@ extern "C" { > */ > #define RTE_TM_NODE_LEVEL_ID_ANY UINT32_MAX >=20 > -/** > - * Color > - */ > -enum rte_tm_color { > - RTE_TM_GREEN =3D 0, /**< Green */ > - RTE_TM_YELLOW, /**< Yellow */ > - RTE_TM_RED, /**< Red */ > - RTE_TM_COLORS /**< Number of colors */ > -}; > - We should not use rte_color yet, we should simply create alias of current r= te_tm_color enum and values to the new rte_color enum and enum values, just= like you do it below for rte_meter.h. So please remove the rest of the cha= nges for now. > diff --git a/lib/librte_meter/rte_meter.h b/lib/librte_meter/rte_meter.h > index 58a051583..e6187c49d 100644 > --- a/lib/librte_meter/rte_meter.h > +++ b/lib/librte_meter/rte_meter.h > @@ -21,6 +21,7 @@ extern "C" { >=20 > #include >=20 > +#include > /* > * Application Programmer's Interface (API) > * > @@ -34,6 +35,12 @@ enum rte_meter_color { > e_RTE_METER_COLORS /**< Number of available colors */ > }; >=20 > +/* New rte_color is defined and used to deprecate rte_meter_color soon. > */ > +#define rte_meter_color rte_color > +#define e_RTE_METER_GREEN RTE_COLOR_GREEN > +#define e_RTE_METER_YELLOW RTE_COLOR_YELLOW > +#define e_RTE_METER_RED RTE_COLOR_RED > + > /** srTCM parameters per metered traffic flow. The CIR, CBS and EBS > parameters only > count bytes of IP packets and do not include link specific headers. At l= east > one of > the CBS or EBS parameters has to be greater than zero. */ > -- > 2.17.1 The changes for rte_meter.h are perfect, please do the same to rte_mtr.h an= d rte_tm.h. Regards, Cristian