From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2F77D1B5C0 for ; Tue, 18 Dec 2018 16:40:30 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Dec 2018 07:40:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,368,1539673200"; d="scan'208";a="130983421" Received: from silpixa00398672.ir.intel.com (HELO silpixa00398672.ger.corp.intel.com) ([10.237.222.112]) by fmsmga001.fm.intel.com with ESMTP; 18 Dec 2018 07:40:27 -0800 From: Reshma Pattan To: dev@dpdk.org, jerin.jacob@caviumnetworks.com, nikhil.rao@intel.com, jasvinder.singh@intel.com, cristian.dumitrescu@intel.com Cc: Reshma Pattan Date: Tue, 18 Dec 2018 15:40:24 +0000 Message-Id: <20181218154025.66059-1-reshma.pattan@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181213180851.4862-1-reshma.pattan@intel.com> References: <20181213180851.4862-1-reshma.pattan@intel.com> Subject: [dpdk-dev] [PATCH v4 1/2] meter: 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 15:40:30 -0000 Added new rte_color definition in librte_meter to consolidate color definition which is currently replicated in various places such as rte_meter.h, rte_tm.h and rte_mtr.h Created aliases for rte_tm_color, rte_mtr_color and rte_meter_color to use new rte_color values. The definitions of rte_tm_color, rte_mtr_color and rte_meter_color will be deprecated in future. Signed-off-by: Jasvinder Singh Signed-off-by: Reshma Pattan --- v4: Removed rte_meter, rte_mtr and rte_tm color definitions. Moved rte_color definition from eal to meter library. v3:Addressed review comments given in the below link http://patches.dpdk.org/patch/48588/ Added rte_color.h to meson build. --- --- lib/Makefile | 1 + lib/librte_ethdev/Makefile | 2 +- lib/librte_ethdev/meson.build | 2 +- lib/librte_ethdev/rte_mtr.h | 16 +++++++--------- lib/librte_ethdev/rte_tm.h | 16 +++++++--------- lib/librte_meter/rte_meter.h | 21 +++++++++++++++------ lib/meson.build | 4 ++-- 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index b7370ef97..8dbdc9bca 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -26,6 +26,7 @@ DEPDIRS-librte_ethdev := librte_net librte_eal librte_mempool librte_ring DEPDIRS-librte_ethdev += librte_mbuf DEPDIRS-librte_ethdev += librte_kvargs DEPDIRS-librte_ethdev += librte_cmdline +DEPDIRS-librte_ethdev += librte_meter DIRS-$(CONFIG_RTE_LIBRTE_BBDEV) += librte_bbdev DEPDIRS-librte_bbdev := librte_eal librte_mempool librte_mbuf DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += librte_cryptodev diff --git a/lib/librte_ethdev/Makefile b/lib/librte_ethdev/Makefile index 3e27ae466..e09c4263a 100644 --- a/lib/librte_ethdev/Makefile +++ b/lib/librte_ethdev/Makefile @@ -12,7 +12,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) LDLIBS += -lrte_net -lrte_eal -lrte_mempool -lrte_ring -LDLIBS += -lrte_mbuf -lrte_kvargs -lrte_cmdline +LDLIBS += -lrte_mbuf -lrte_kvargs -lrte_cmdline -lrte_meter EXPORT_MAP := rte_ethdev_version.map diff --git a/lib/librte_ethdev/meson.build b/lib/librte_ethdev/meson.build index a4d850268..e98942ff8 100644 --- a/lib/librte_ethdev/meson.build +++ b/lib/librte_ethdev/meson.build @@ -26,4 +26,4 @@ headers = files('rte_ethdev.h', 'rte_tm.h', 'rte_tm_driver.h') -deps += ['net', 'kvargs', 'cmdline'] +deps += ['net', 'kvargs', 'cmdline', 'meter'] diff --git a/lib/librte_ethdev/rte_mtr.h b/lib/librte_ethdev/rte_mtr.h index c4819b274..c667f87e1 100644 --- a/lib/librte_ethdev/rte_mtr.h +++ b/lib/librte_ethdev/rte_mtr.h @@ -76,20 +76,18 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #endif -/** - * Color - */ -enum rte_mtr_color { - RTE_MTR_GREEN = 0, /**< Green */ - RTE_MTR_YELLOW, /**< Yellow */ - RTE_MTR_RED, /**< Red */ - RTE_MTR_COLORS /**< Number of colors. */ -}; +/* 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..c4a788b85 100644 --- a/lib/librte_ethdev/rte_tm.h +++ b/lib/librte_ethdev/rte_tm.h @@ -51,6 +51,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -115,15 +116,12 @@ extern "C" { */ #define RTE_TM_NODE_LEVEL_ID_ANY UINT32_MAX -/** - * Color - */ -enum rte_tm_color { - RTE_TM_GREEN = 0, /**< Green */ - RTE_TM_YELLOW, /**< Yellow */ - RTE_TM_RED, /**< Red */ - RTE_TM_COLORS /**< Number of colors */ -}; +/* 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..c2ea47332 100644 --- a/lib/librte_meter/rte_meter.h +++ b/lib/librte_meter/rte_meter.h @@ -26,14 +26,23 @@ extern "C" { * ***/ -/** Packet Color Set */ -enum rte_meter_color { - e_RTE_METER_GREEN = 0, /**< Green */ - e_RTE_METER_YELLOW, /**< Yellow */ - e_RTE_METER_RED, /**< Red */ - e_RTE_METER_COLORS /**< Number of available colors */ +/** + * Color + */ +enum rte_color { + RTE_COLOR_GREEN = 0, /**< Green */ + RTE_COLOR_YELLOW, /**< Yellow */ + RTE_COLOR_RED, /**< Red */ + RTE_COLORS /**< Number of colors */ }; +/* 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 least one of the CBS or EBS parameters has to be greater than zero. */ diff --git a/lib/meson.build b/lib/meson.build index bb7f443f9..930ae48fd 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -11,7 +11,7 @@ libraries = [ 'compat', # just a header, used for versioning 'cmdline', # ethdev depends on cmdline for parsing functions 'kvargs', # eal depends on kvargs - 'eal', 'ring', 'mempool', 'mbuf', 'net', 'ethdev', 'pci', # core + 'eal', 'ring', 'mempool', 'meter', 'mbuf', 'net', 'ethdev', 'pci', # core 'metrics', # bitrate/latency stats depends on this 'hash', # efd depends on this 'timer', # eventdev depends on this @@ -20,7 +20,7 @@ libraries = [ 'compat', # just a header, used for versioning 'distributor', 'efd', 'eventdev', 'gro', 'gso', 'ip_frag', 'jobstats', 'kni', 'latencystats', 'lpm', 'member', - 'meter', 'power', 'pdump', 'rawdev', + 'power', 'pdump', 'rawdev', 'reorder', 'sched', 'security', 'vhost', # add pkt framework libs which use other libs from above 'port', 'table', 'pipeline', -- 2.17.1