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 CD9601B90E for ; Fri, 14 Dec 2018 23:19:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Dec 2018 14:19:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,354,1539673200"; d="scan'208";a="126060464" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga002.fm.intel.com with ESMTP; 14 Dec 2018 14:19:40 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.26]) by IRSMSX101.ger.corp.intel.com ([169.254.1.237]) with mapi id 14.03.0415.000; Fri, 14 Dec 2018 22:19:39 +0000 From: "Dumitrescu, Cristian" To: "Pattan, Reshma" , "dev@dpdk.org" , "jerin.jacob@caviumnetworks.com" , "Rao, Nikhil" , "Singh, Jasvinder" Thread-Topic: [PATCH v3 1/2] eal: add new rte color definition Thread-Index: AQHUkw71roTnYhv2qUCg3e0Tnot2saV+zzRQ Date: Fri, 14 Dec 2018 22:19:38 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E8153D4@IRSMSX108.ger.corp.intel.com> References: <1544193116-7058-1-git-send-email-reshma.pattan@intel.com> <20181213180851.4862-1-reshma.pattan@intel.com> In-Reply-To: <20181213180851.4862-1-reshma.pattan@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzEwNmYxMjItNWQxYS00OThlLWI2YjctZWU3Yjg4OTJmOTM1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWmVjQW1IUGw4M01mTFcxR0s2ZzFHRENENHZkYVdJTXJLTVJMXC9BSmJ1dnQ3a3JCYkROWHZpQTE5UmU1SkVXdXIifQ== 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 v3 1/2] 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: Fri, 14 Dec 2018 22:19:42 -0000 > -----Original Message----- > From: Pattan, Reshma > Sent: Thursday, December 13, 2018 6:09 PM > To: dev@dpdk.org; jerin.jacob@caviumnetworks.com; Rao, Nikhil > ; Singh, Jasvinder ; > Dumitrescu, Cristian > Cc: Pattan, Reshma > Subject: [PATCH v3 1/2] 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 > Created aliases for rte_tm_color, rte_mtr_color and rte_meter_color > to use new rte_color values. >=20 > The definitions of rte_tm_color, rte_mtr_color and rte_meter_color > will be deprecated in future. >=20 > Signed-off-by: Jasvinder Singh > Signed-off-by: Reshma Pattan > --- > v2: Addressed review comments given in the below link > http://patches.dpdk.org/patch/48588/ > Added rte_color.h to meson build. > --- > --- > lib/librte_eal/common/Makefile | 2 +- > lib/librte_eal/common/include/rte_color.h | 26 > +++++++++++++++++++++++ > lib/librte_eal/common/meson.build | 1 + > lib/librte_ethdev/rte_mtr.h | 8 +++++++ > lib/librte_ethdev/rte_tm.h | 8 +++++++ > lib/librte_meter/rte_meter.h | 8 +++++++ > 6 files changed, 52 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eal/common/include/rte_color.h >=20 > diff --git a/lib/librte_eal/common/Makefile > b/lib/librte_eal/common/Makefile > index 87d8c455d..c76bb2dd7 100644 > --- a/lib/librte_eal/common/Makefile > +++ b/lib/librte_eal/common/Makefile > @@ -17,7 +17,7 @@ INC +=3D rte_pci_dev_feature_defs.h > rte_pci_dev_features.h > INC +=3D rte_malloc.h rte_keepalive.h rte_time.h > INC +=3D rte_service.h rte_service_component.h > INC +=3D rte_bitmap.h rte_vfio.h rte_hypervisor.h rte_test.h > -INC +=3D rte_reciprocal.h rte_fbarray.h rte_uuid.h > +INC +=3D rte_reciprocal.h rte_fbarray.h rte_uuid.h rte_color.h >=20 > GENERIC_INC :=3D rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.= h > GENERIC_INC +=3D rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.h > 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..fafe1146d > --- /dev/null > +++ b/lib/librte_eal/common/include/rte_color.h > @@ -0,0 +1,26 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018 Intel Corporation > + */ > + > +#ifndef __INCLUDE_RTE_COLOR_H__ > +#define __INCLUDE_RTE_COLOR_H__ > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/** > + * Color > + */ > +enum rte_color { > + RTE_COLOR_GREEN =3D 0, /**< Green */ > + RTE_COLOR_YELLOW, /**< Yellow */ > + RTE_COLOR_RED, /**< Red */ > + RTE_COLORS /**< Number of colors */ > +}; > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __RTE_COLOR_H__ */ > diff --git a/lib/librte_eal/common/meson.build > b/lib/librte_eal/common/meson.build > index 2a10d57d8..f0a561f21 100644 > --- a/lib/librte_eal/common/meson.build > +++ b/lib/librte_eal/common/meson.build > @@ -52,6 +52,7 @@ common_headers =3D files( > 'include/rte_bus.h', > 'include/rte_bitmap.h', > 'include/rte_class.h', > + 'include/rte_color.h', > 'include/rte_common.h', > 'include/rte_debug.h', > 'include/rte_devargs.h', > diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h > index c4819b274..1de20ef2b 100644 > --- a/lib/librte_ethdev/rte_mtr.h > +++ b/lib/librte_ethdev/rte_mtr.h > @@ -76,6 +76,7 @@ > #include > #include > #include > +#include >=20 > #ifdef __cplusplus > extern "C" { > @@ -91,6 +92,13 @@ enum rte_mtr_color { > RTE_MTR_COLORS /**< Number of colors. */ > }; >=20 > +/* New rte_color is defined and used to deprecate rte_mtr_color soon. */ > +#define rte_mtr_color rte_color > +#define RTE_MTR_GREEN RTE_COLOR_GREEN > +#define RTE_MTR_YELLOW RTE_COLOR_YELLOW > +#define RTE_MTR_RED RTE_COLOR_RED > +#define RTE_MTR_COLORS RTE_COLORS > + > /** > * Statistics counter type > */ > diff --git a/lib/librte_ethdev/rte_tm.h b/lib/librte_ethdev/rte_tm.h > index 646ef3880..cce8230b6 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" { > @@ -125,6 +126,13 @@ enum rte_tm_color { > RTE_TM_COLORS /**< Number of colors */ > }; >=20 > +/* New rte_color is defined and used to deprecate rte_tm_color soon. */ > +#define rte_tm_color rte_color > +#define RTE_TM_GREEN RTE_COLOR_GREEN > +#define RTE_TM_YELLOW RTE_COLOR_YELLOW > +#define RTE_TM_RED RTE_COLOR_RED > +#define RTE_TM_COLORS RTE_COLORS > + > /** > * Node statistics counter type > */ > diff --git a/lib/librte_meter/rte_meter.h b/lib/librte_meter/rte_meter.h > index 58a051583..e8d878b12 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,13 @@ 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 > +#define e_RTE_METER_COLORS RTE_COLORS > + > /** 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 This makes sense to me, but you need to remove the definitions of the exist= ing enums (rte_mtr_color, rte_tm_color, rte_meter_color) first, otherwise w= hat is the purpose of aliasing them to the new rte_color enum through the a= bove macros?