From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Pattan, Reshma" <reshma.pattan@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"jerin.jacob@caviumnetworks.com"
<jerin.jacob@caviumnetworks.com>,
"Singh, Jasvinder" <jasvinder.singh@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] eal: add new rte color definition
Date: Mon, 10 Dec 2018 18:24:20 +0000 [thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891268E811F42@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1544193116-7058-2-git-send-email-reshma.pattan@intel.com>
Hi Reshma,
> -----Original Message-----
> From: Pattan, Reshma
> Sent: Friday, December 7, 2018 2:32 PM
> To: dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>;
> jerin.jacob@caviumnetworks.com; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Cc: Pattan, Reshma <reshma.pattan@intel.com>
> Subject: [PATCH v2 2/3] eal: add new rte color definition
>
> 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
>
> Removed rte_tm_color and rte_mtr_color and used the new color
> definition in rte_tm* and rte_mtr* files.
>
> Updated softnic and testpmd to use new color definition.
>
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> ---
> 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
>
This patch should come first in the set, i.e. before the redefinition of the sched field in struct rte_mbuf, as it defines the format for the new sched color field.
At this point, we should not remove the usage of rte_meter_color, rte_mtr_color, rte_mtr_color in any of the files using them, as this will break people's apps. We should first deprecate them by adding a deprecation note in the current release and then in one of the next releases (hopefully 19.5) remove them completely by replacing with the new rte_color, as you do in this 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 such as rte_meter.h, rte_tm.h, rte_mtr.h. Makes sense? This patch should be very small :)
<snip>
> 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 = 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
<snip>
> 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 <stdint.h>
> #include <rte_compat.h>
> #include <rte_common.h>
> +#include <rte_color.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. */
> -};
> -
We should not use rte_color yet, we should simply create alias of current rte_mtr_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 changes for now.
<snip>
> 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 <stdint.h>
>
> #include <rte_common.h>
> +#include <rte_color.h>
>
> #ifdef __cplusplus
> extern "C" {
> @@ -115,16 +116,6 @@ 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 */
> -};
> -
We should not use rte_color yet, we should simply create alias of current rte_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 changes for now.
<snip>
> 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" {
>
> #include <stdint.h>
>
> +#include <rte_color.h>
> /*
> * Application Programmer's Interface (API)
> *
> @@ -34,6 +35,12 @@ 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
> +
> /** 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
The changes for rte_meter.h are perfect, please do the same to rte_mtr.h and rte_tm.h.
Regards,
Cristian
next prev parent reply other threads:[~2018-12-10 18:24 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 ` [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 [this message]
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=3EB4FA525960D640B5BDFFD6A3D891268E811F42@IRSMSX108.ger.corp.intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=jerin.jacob@caviumnetworks.com \
--cc=reshma.pattan@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).