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, jasvinder.singh@intel.com,
	cristian.dumitrescu@intel.com
Cc: Reshma Pattan <reshma.pattan@intel.com>
Subject: [dpdk-dev] [PATCH v3 1/2] eal: add new rte color definition
Date: Thu, 13 Dec 2018 18:08:50 +0000	[thread overview]
Message-ID: <20181213180851.4862-1-reshma.pattan@intel.com> (raw)
In-Reply-To: <1544193116-7058-1-git-send-email-reshma.pattan@intel.com>

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

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>
---
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

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 += rte_pci_dev_feature_defs.h rte_pci_dev_features.h
 INC += rte_malloc.h rte_keepalive.h rte_time.h
 INC += rte_service.h rte_service_component.h
 INC += rte_bitmap.h rte_vfio.h rte_hypervisor.h rte_test.h
-INC += rte_reciprocal.h rte_fbarray.h rte_uuid.h
+INC += rte_reciprocal.h rte_fbarray.h rte_uuid.h rte_color.h
 
 GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h
 GENERIC_INC += 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 = 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 = 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 <stdint.h>
 #include <rte_compat.h>
 #include <rte_common.h>
+#include <rte_color.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -91,6 +92,13 @@ enum rte_mtr_color {
 	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..cce8230b6 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_color.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -125,6 +126,13 @@ enum rte_tm_color {
 	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..e8d878b12 100644
--- a/lib/librte_meter/rte_meter.h
+++ b/lib/librte_meter/rte_meter.h
@@ -21,6 +21,7 @@ extern "C" {
 
 #include <stdint.h>
 
+#include <rte_color.h>
 /*
  * Application Programmer's Interface (API)
  *
@@ -34,6 +35,13 @@ enum rte_meter_color {
 	e_RTE_METER_COLORS     /**< Number of available 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. */
-- 
2.17.1

  parent reply	other threads:[~2018-12-13 18:08 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   ` Reshma Pattan [this message]
2018-12-13 18:08     ` [dpdk-dev] [PATCH v3 2/2] " 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           ` [dpdk-dev] [PATCH v7 1/2] meter: add new rte color definition Reshma Pattan
2018-12-20 12:16             ` [dpdk-dev] [PATCH v7 2/2] mbuf: implement generic format for sched field 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=20181213180851.4862-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=nikhil.rao@intel.com \
    /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).