DPDK patches and discussions
 help / color / mirror / Atom feed
From: Reshma Pattan <reshma.pattan@intel.com>
To: dev@dpdk.org, jerin.jacob@caviumnetworks.com,
	nikhil.rao@intel.com, olivier.matz@6wind.com,
	thomas@monjalon.net, jasvinder.singh@intel.com,
	cristian.dumitrescu@intel.com, konstantin.ananyev@intel.com
Cc: Reshma Pattan <reshma.pattan@intel.com>
Subject: [dpdk-dev] [PATCH v7 1/2] meter: add new rte color definition
Date: Thu, 20 Dec 2018 12:16:08 +0000	[thread overview]
Message-ID: <20181220121609.16314-1-reshma.pattan@intel.com> (raw)
In-Reply-To: <20181219154237.836-1-reshma.pattan@intel.com>

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 <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
v5: Removed meter library from librte_mbuf dependency list.

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 <stdint.h>
 #include <rte_compat.h>
 #include <rte_common.h>
+#include <rte_meter.h>
 
 #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 <stdint.h>
 
 #include <rte_common.h>
+#include <rte_meter.h>
 
 #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..a2dd52e17 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', 'mbuf', 'net', 'meter', '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

  parent reply	other threads:[~2018-12-20 12:16 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-23 16:54 [dpdk-dev] [PATCH] mbuf: implement generic format for sched field Jasvinder Singh
2018-11-26 11:37 ` Dumitrescu, Cristian
2018-11-29 10:42   ` Singh, Jasvinder
2018-12-04 17:39     ` Dumitrescu, Cristian
2018-12-05 12:22       ` Singh, Jasvinder
2018-12-01 14:22 ` Jerin Jacob
2018-12-05 11:15   ` Singh, Jasvinder
2018-12-10 17:49   ` Dumitrescu, Cristian
2018-12-07 14:31 ` [dpdk-dev] [PATCH v2 1/3] " Reshma Pattan
2018-12-11 19:02   ` Dumitrescu, Cristian
2018-12-12 18:17   ` Dumitrescu, Cristian
2018-12-13  8:51   ` Rao, Nikhil
2018-12-13 18:08   ` [dpdk-dev] [PATCH v3 1/2] eal: add new rte color definition Reshma Pattan
2018-12-13 18:08     ` [dpdk-dev] [PATCH v3 2/2] mbuf: implement generic format for sched field Reshma Pattan
2018-12-14 22:52       ` Dumitrescu, Cristian
2018-12-20  8:32         ` Olivier Matz
2018-12-20 11:19           ` Dumitrescu, Cristian
2018-12-14 22:19     ` [dpdk-dev] [PATCH v3 1/2] eal: add new rte color definition Dumitrescu, Cristian
2018-12-17 20:35     ` Thomas Monjalon
2018-12-18 15:40     ` [dpdk-dev] [PATCH v4 1/2] meter: " Reshma Pattan
2018-12-18 15:40       ` [dpdk-dev] [PATCH v4 2/2] mbuf: implement generic format for sched field Reshma Pattan
2018-12-19 15:34       ` [dpdk-dev] [PATCH v5 1/2] meter: add new rte color definition Reshma Pattan
2018-12-19 15:34         ` [dpdk-dev] [PATCH v5 2/2] mbuf: implement generic format for sched field Reshma Pattan
2018-12-19 15:42         ` [dpdk-dev] [PATCH v6 1/2] meter: add new rte color definition Reshma Pattan
2018-12-19 15:42           ` [dpdk-dev] [PATCH v6 2/2] mbuf: implement generic format for sched field Reshma Pattan
2018-12-19 18:14             ` Ananyev, Konstantin
2018-12-20  8:29             ` Olivier Matz
2018-12-20 11:28               ` Dumitrescu, Cristian
2018-12-20 12:41                 ` Olivier Matz
2018-12-20 12:16           ` Reshma Pattan [this message]
2018-12-20 12:16             ` [dpdk-dev] [PATCH v7 " Reshma Pattan
2018-12-20 12:43               ` Olivier Matz
2018-12-20 19:11                 ` Dumitrescu, Cristian
2018-12-20 14:55               ` Rao, Nikhil
2019-01-15 22:37               ` Stephen Hemminger
2019-01-16  9:19                 ` Pattan, Reshma
2019-01-16  9:33                   ` Dumitrescu, Cristian
2019-01-16 10:09                     ` Singh, Jasvinder
2019-01-15 23:11               ` Stephen Hemminger
2019-01-16  8:41                 ` Thomas Monjalon
2018-12-07 14:31 ` [dpdk-dev] [PATCH v2 2/3] eal: add new rte color definition Reshma Pattan
2018-12-10 18:24   ` Dumitrescu, Cristian
2018-12-14 23:35   ` Ananyev, Konstantin
2018-12-15  0:16     ` Dumitrescu, Cristian
2018-12-17 11:21       ` Ananyev, Konstantin
2018-12-17 17:15         ` Pattan, Reshma
2018-12-17 18:51           ` Dumitrescu, Cristian
2018-12-17 23:11             ` Thomas Monjalon
2018-12-18 10:30               ` Dumitrescu, Cristian
2018-12-18 11:18               ` Dumitrescu, Cristian
2018-12-18 12:38                 ` Thomas Monjalon
2018-12-18 13:19                   ` Dumitrescu, Cristian
2018-12-18 13:39                     ` Thomas Monjalon
2018-12-18 17:07                       ` Ananyev, Konstantin
2018-12-18 19:34                         ` Dumitrescu, Cristian
2018-12-18 20:19                           ` Thomas Monjalon
2018-12-19 10:47                             ` Dumitrescu, Cristian
2018-12-19 10:50                               ` Thomas Monjalon
2018-12-19 10:52                             ` Ananyev, Konstantin
2018-12-19 10:49                           ` Ananyev, Konstantin
2018-12-19 11:04                             ` Dumitrescu, Cristian
2018-12-18 10:15             ` Ananyev, Konstantin
2018-12-18 10:25               ` Pattan, Reshma
2018-12-18 10:38                 ` Ananyev, Konstantin
2018-12-18 10:41                   ` Pattan, Reshma
2018-12-18 10:52                     ` Singh, Jasvinder
2018-12-18 12:10                       ` Ananyev, Konstantin
2018-12-15 14:15     ` Mattias Rönnblom
2018-12-17  7:27       ` Pattan, Reshma
2018-12-17  9:41       ` Dumitrescu, Cristian
2018-12-17 19:36         ` Mattias Rönnblom
2018-12-17 23:24           ` Ferruh Yigit
2018-12-07 14:31 ` [dpdk-dev] [PATCH v2 3/3] doc: add deprecation notice to remove rte meter color Reshma Pattan
2018-12-11 14:58   ` Dumitrescu, Cristian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181220121609.16314-1-reshma.pattan@intel.com \
    --to=reshma.pattan@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=jasvinder.singh@intel.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=nikhil.rao@intel.com \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).