DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
@ 2022-12-22  1:39 Rakesh Kudurumalla
  2022-12-22  1:39 ` [PATCH 2/3] app/testpmd: add skip red for testpmd Rakesh Kudurumalla
                   ` (3 more replies)
  0 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2022-12-22  1:39 UTC (permalink / raw)
  To: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, adrien.mazarguil, Rakesh Kudurumalla

Dropping of packets based on RED can be skipped
with meter action, when RED is configured using
rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 lib/ethdev/rte_flow.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..d72374a0b8 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,16 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip packet drops base on RED
+	 *
+	 * Dropping of packets is based on RED when RED is configured
+	 * uing rte_eth_cman_config_set(). RED drop can be skipped
+	 * with this action
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_RED,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH 2/3] app/testpmd: add skip red for testpmd
  2022-12-22  1:39 [PATCH 1/3] lib: dpdk spec to skip red for ingress policer Rakesh Kudurumalla
@ 2022-12-22  1:39 ` Rakesh Kudurumalla
  2022-12-22  1:39 ` [PATCH 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2022-12-22  1:39 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: dev, adrien.mazarguil, Rakesh Kudurumalla

added support for testpmd application to accept
skip_red action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..a1094bf00f 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_RED,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_RED,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_RED] = {
+		.name = "skip_red",
+		.help = "disable dropping of packets based on RED",
+		.priv = PRIV_ACTION(SKIP_RED, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH 3/3] net/cnxk: skip red drop for ingress policer
  2022-12-22  1:39 [PATCH 1/3] lib: dpdk spec to skip red for ingress policer Rakesh Kudurumalla
  2022-12-22  1:39 ` [PATCH 2/3] app/testpmd: add skip red for testpmd Rakesh Kudurumalla
@ 2022-12-22  1:39 ` Rakesh Kudurumalla
  2022-12-22  3:01 ` [PATCH 1/3] lib: dpdk spec to skip red " Stephen Hemminger
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2022-12-22  1:39 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, adrien.mazarguil, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index 651ef45ea8..4fe4aa320b 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -222,6 +222,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index 0fa18f01c7..ff8fa35428 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -359,6 +359,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_RED)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -398,6 +401,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_RED)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1307,6 +1314,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1484,6 +1530,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2022-12-22  1:39 [PATCH 1/3] lib: dpdk spec to skip red for ingress policer Rakesh Kudurumalla
  2022-12-22  1:39 ` [PATCH 2/3] app/testpmd: add skip red for testpmd Rakesh Kudurumalla
  2022-12-22  1:39 ` [PATCH 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2022-12-22  3:01 ` Stephen Hemminger
  2022-12-22  5:27   ` Jerin Jacob
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
  3 siblings, 1 reply; 70+ messages in thread
From: Stephen Hemminger @ 2022-12-22  3:01 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, dev,
	adrien.mazarguil

On Thu, 22 Dec 2022 07:09:02 +0530
Rakesh Kudurumalla <rkudurumalla@marvell.com> wrote:

> Dropping of packets based on RED can be skipped
> with meter action, when RED is configured using
> rte_eth_cman_config_set()
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

Should this be more general and apply to all congestion
management options. Assuming the hardware can do something
better than RED.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2022-12-22  3:01 ` [PATCH 1/3] lib: dpdk spec to skip red " Stephen Hemminger
@ 2022-12-22  5:27   ` Jerin Jacob
  2022-12-26 17:00     ` Ori Kam
  0 siblings, 1 reply; 70+ messages in thread
From: Jerin Jacob @ 2022-12-22  5:27 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Ferruh Yigit,
	Andrew Rybchenko, dev, adrien.mazarguil

On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Thu, 22 Dec 2022 07:09:02 +0530
> Rakesh Kudurumalla <rkudurumalla@marvell.com> wrote:
>
> > Dropping of packets based on RED can be skipped
> > with meter action, when RED is configured using
> > rte_eth_cman_config_set()
> >
> > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>
> Should this be more general and apply to all congestion
> management options. Assuming the hardware can do something
> better than RED.

Yes. We can use "enum rte_cman_mode mode" in the descriptor to future-proof.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2022-12-22  5:27   ` Jerin Jacob
@ 2022-12-26 17:00     ` Ori Kam
  2023-01-10  6:42       ` Rakesh Kudurumalla
  0 siblings, 1 reply; 70+ messages in thread
From: Ori Kam @ 2022-12-26 17:00 UTC (permalink / raw)
  To: Jerin Jacob, Stephen Hemminger
  Cc: Rakesh Kudurumalla, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)

Hi All,

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Thursday, 22 December 2022 7:27
> 
> On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Thu, 22 Dec 2022 07:09:02 +0530
> > Rakesh Kudurumalla <rkudurumalla@marvell.com> wrote:
> >
> > > Dropping of packets based on RED can be skipped
> > > with meter action, when RED is configured using
> > > rte_eth_cman_config_set()
> > >
> > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> >
> > Should this be more general and apply to all congestion
> > management options. Assuming the hardware can do something
> > better than RED.
> 
> Yes. We can use "enum rte_cman_mode mode" in the descriptor to future-
> proof.

I'm missing the idea of this new action,
I understand that is related to Jerin congestion patches.
But I fail to see why we need it? Is it to mark some metadata that will
have some effect on the congestion result? (I assume the system is implemented in the HW)

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2022-12-26 17:00     ` Ori Kam
@ 2023-01-10  6:42       ` Rakesh Kudurumalla
  2023-01-18  8:09         ` Rakesh Kudurumalla
  0 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-01-10  6:42 UTC (permalink / raw)
  To: Ori Kam, Jerin Jacob, Stephen Hemminger
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)



> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Monday, December 26, 2022 10:30 PM
> To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> <stephen@networkplumber.org>
> Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> 
> External Email
> 
> ----------------------------------------------------------------------
> Hi All,
> 
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Thursday, 22 December 2022 7:27
> >
> > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > <stephen@networkplumber.org> wrote:
> > >
> > > On Thu, 22 Dec 2022 07:09:02 +0530
> > > Rakesh Kudurumalla <rkudurumalla@marvell.com> wrote:
> > >
> > > > Dropping of packets based on RED can be skipped with meter action,
> > > > when RED is configured using
> > > > rte_eth_cman_config_set()
> > > >
> > > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > >
> > > Should this be more general and apply to all congestion management
> > > options. Assuming the hardware can do something better than RED.
> >
> > Yes. We can use "enum rte_cman_mode mode" in the descriptor to future-
> > proof.
> 
> I'm missing the idea of this new action, I understand that is related to Jerin
> congestion patches.
> But I fail to see why we need it? Is it to mark some metadata that will have
> some effect on the congestion result? (I assume the system is implemented
> in the HW)

Yes. It is implemented in HW. Congestion management is applied on ethdev Rx queue using rte_eth_cman_config() API. Once it is configured, it applies to all the packets that steer towards that particular ethdev Rx queue. This feature help to skip the congestion management processing based on the packet color identified by the rte_flow meter object. For example, If one Rx queue configured as RED congestion  and application wants to bypass the RED congestion  processing for all GREEN color packet can be expressed though this API proposal.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-01-10  6:42       ` Rakesh Kudurumalla
@ 2023-01-18  8:09         ` Rakesh Kudurumalla
  2023-01-23 13:13           ` Jerin Jacob
  2023-01-26 15:13           ` Ori Kam
  0 siblings, 2 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-01-18  8:09 UTC (permalink / raw)
  To: Ori Kam, Jerin Jacob, Stephen Hemminger
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)



> -----Original Message-----
> From: Rakesh Kudurumalla
> Sent: Tuesday, January 10, 2023 12:12 PM
> To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> Stephen Hemminger <stephen@networkplumber.org>
> Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> 
> 
> 
> > -----Original Message-----
> > From: Ori Kam <orika@nvidia.com>
> > Sent: Monday, December 26, 2022 10:30 PM
> > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > <stephen@networkplumber.org>
> > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> Thomas
> > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > policer
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > Hi All,
> >
> > > -----Original Message-----
> > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > Sent: Thursday, 22 December 2022 7:27
> > >
> > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > <stephen@networkplumber.org> wrote:
> > > >
> > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > <rkudurumalla@marvell.com> wrote:
> > > >
> > > > > Dropping of packets based on RED can be skipped with meter
> > > > > action, when RED is configured using
> > > > > rte_eth_cman_config_set()
> > > > >
> > > > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > >
> > > > Should this be more general and apply to all congestion management
> > > > options. Assuming the hardware can do something better than RED.
> > >
> > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > future- proof.
> >
> > I'm missing the idea of this new action, I understand that is related
> > to Jerin congestion patches.
> > But I fail to see why we need it? Is it to mark some metadata that
> > will have some effect on the congestion result? (I assume the system
> > is implemented in the HW)
> 
> Yes. It is implemented in HW. Congestion management is applied on ethdev
> Rx queue using rte_eth_cman_config() API. Once it is configured, it applies to
> all the packets that steer towards that particular ethdev Rx queue. This
> feature help to skip the congestion management processing based on the
> packet color identified by the rte_flow meter object. For example, If one Rx
> queue configured as RED congestion  and application wants to bypass the
> RED congestion  processing for all GREEN color packet can be expressed
> though this API proposal.

Hi Ori Kam,

Let me know if above information  would give clear idea on skip RED action


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-01-18  8:09         ` Rakesh Kudurumalla
@ 2023-01-23 13:13           ` Jerin Jacob
  2023-01-26 15:13           ` Ori Kam
  1 sibling, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-01-23 13:13 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Ori Kam, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)

On Wed, Jan 18, 2023 at 1:39 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Rakesh Kudurumalla
> > Sent: Tuesday, January 10, 2023 12:12 PM
> > To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> > Stephen Hemminger <stephen@networkplumber.org>
> > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> >
> >
> >
> > > -----Original Message-----
> > > From: Ori Kam <orika@nvidia.com>
> > > Sent: Monday, December 26, 2022 10:30 PM
> > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > <stephen@networkplumber.org>
> > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> > Thomas
> > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > policer
> > >
> > > External Email
> > >
> > > ----------------------------------------------------------------------
> > > Hi All,
> > >
> > > > -----Original Message-----
> > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > Sent: Thursday, 22 December 2022 7:27
> > > >
> > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > <stephen@networkplumber.org> wrote:
> > > > >
> > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > <rkudurumalla@marvell.com> wrote:
> > > > >
> > > > > > Dropping of packets based on RED can be skipped with meter
> > > > > > action, when RED is configured using
> > > > > > rte_eth_cman_config_set()
> > > > > >
> > > > > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > >
> > > > > Should this be more general and apply to all congestion management
> > > > > options. Assuming the hardware can do something better than RED.
> > > >
> > > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > > future- proof.
> > >
> > > I'm missing the idea of this new action, I understand that is related
> > > to Jerin congestion patches.
> > > But I fail to see why we need it? Is it to mark some metadata that
> > > will have some effect on the congestion result? (I assume the system
> > > is implemented in the HW)
> >
> > Yes. It is implemented in HW. Congestion management is applied on ethdev
> > Rx queue using rte_eth_cman_config() API. Once it is configured, it applies to
> > all the packets that steer towards that particular ethdev Rx queue. This
> > feature help to skip the congestion management processing based on the
> > packet color identified by the rte_flow meter object. For example, If one Rx
> > queue configured as RED congestion  and application wants to bypass the
> > RED congestion  processing for all GREEN color packet can be expressed
> > though this API proposal.
>
> Hi Ori Kam,
>
> Let me know if above information  would give clear idea on skip RED action


Rakesh, Adding extra rewording to make it clear.

git comment:

ethdev: introduce flow action to skip congestion management configuration

Using rte_eth_cman_config_set() API the application can configure
ethdev Rx queue's congestion
mechanism. Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
congestion configuration applied to the given ethdev Rx queue.

This feature helps to skip the congestion management processing based
on per flow or
the packet color identified by the rte_flow meter object.
For example, If one Rx queue configured as RED congestion and
application wants to
bypass the RED congestion  processing for all GREEN color packet can
be expressed
though RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action.


code:

/**
 * Skip congestion management configuration
 *
 * Skip the congestion management configuration applied using
rte_eth_cman_config_set()
 * API on the given ethdev Rx queue.
 */
RTE_FLOW_ACTION_TYPE_SKIP_CMAN

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v2 1/3] lib: skip congestion management configuration
  2022-12-22  1:39 [PATCH 1/3] lib: dpdk spec to skip red for ingress policer Rakesh Kudurumalla
                   ` (2 preceding siblings ...)
  2022-12-22  3:01 ` [PATCH 1/3] lib: dpdk spec to skip red " Stephen Hemminger
@ 2023-01-25  7:32 ` Rakesh Kudurumalla
  2023-01-25  7:32   ` [PATCH v2 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                     ` (3 more replies)
  3 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-01-25  7:32 UTC (permalink / raw)
  To: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Skip the congestion management configuration applied using
rte_eth_cman_config_set() API on the given ethdev Rx queue.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
V2: Rename action name to skip congestion management
 lib/ethdev/rte_flow.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..e62b57acfd 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,15 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Skip the congestion management configuration applied using
+	 * rte_eth_cman_config_set() API on the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v2 2/3] app/testpmd: add skip cman support for testpmd
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
@ 2023-01-25  7:32   ` Rakesh Kudurumalla
  2023-01-25  7:32   ` [PATCH v2 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-01-25  7:32 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v2 3/3] net/cnxk: skip red drop for ingress policer
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
  2023-01-25  7:32   ` [PATCH v2 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-01-25  7:32   ` Rakesh Kudurumalla
  2023-01-25  9:26   ` [PATCH v2 1/3] lib: skip congestion management configuration Jerin Jacob
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-01-25  7:32 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index ea8c70b8b7..7c53122b9f 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -238,6 +238,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v2 1/3] lib: skip congestion management configuration
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
  2023-01-25  7:32   ` [PATCH v2 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-01-25  7:32   ` [PATCH v2 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-01-25  9:26   ` Jerin Jacob
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-01-25  9:26 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, jerinj,
	ndabilpuram, dev

On Wed, Jan 25, 2023 at 1:03 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Skip the congestion management configuration applied using
> rte_eth_cman_config_set() API on the given ethdev Rx queue.

1) Add more comments. Also starts with ethdev: example,

ethdev: introduce flow action to skip congestion management configuration

Using rte_eth_cman_config_set() API the application can configure
ethdev Rx queue's congestion mechanism.
Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
congestion configuration applied to the given ethdev Rx queue.

This feature helps to skip the congestion management processing based
on per flow or the packet color identified by the rte_flow meter object.
For example, If one Rx queue configured as RED congestion and
application wants tobypass the RED congestion  processing for all GREEN color
packet can be expressed though RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

2) Update doc/guides/prog_guide/rte_flow.rst for new action and 3/3
patch for doc/guides/nics/features/ pmd specific doc

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-01-18  8:09         ` Rakesh Kudurumalla
  2023-01-23 13:13           ` Jerin Jacob
@ 2023-01-26 15:13           ` Ori Kam
  2023-01-27  6:23             ` Jerin Jacob
  1 sibling, 1 reply; 70+ messages in thread
From: Ori Kam @ 2023-01-26 15:13 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Jerin Jacob, Stephen Hemminger
  Cc: NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)



> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Wednesday, 18 January 2023 10:10
> 
> 
> > -----Original Message-----
> > From: Rakesh Kudurumalla
> > Sent: Tuesday, January 10, 2023 12:12 PM
> > To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> > Stephen Hemminger <stephen@networkplumber.org>
> > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> >
> >
> >
> > > -----Original Message-----
> > > From: Ori Kam <orika@nvidia.com>
> > > Sent: Monday, December 26, 2022 10:30 PM
> > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > <stephen@networkplumber.org>
> > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> > Thomas
> > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> Adrien
> > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > policer
> > >
> > > External Email
> > >
> > > ----------------------------------------------------------------------
> > > Hi All,
> > >
> > > > -----Original Message-----
> > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > Sent: Thursday, 22 December 2022 7:27
> > > >
> > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > <stephen@networkplumber.org> wrote:
> > > > >
> > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > <rkudurumalla@marvell.com> wrote:
> > > > >
> > > > > > Dropping of packets based on RED can be skipped with meter
> > > > > > action, when RED is configured using
> > > > > > rte_eth_cman_config_set()
> > > > > >
> > > > > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > >
> > > > > Should this be more general and apply to all congestion management
> > > > > options. Assuming the hardware can do something better than RED.
> > > >
> > > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > > future- proof.
> > >
> > > I'm missing the idea of this new action, I understand that is related
> > > to Jerin congestion patches.
> > > But I fail to see why we need it? Is it to mark some metadata that
> > > will have some effect on the congestion result? (I assume the system
> > > is implemented in the HW)
> >
> > Yes. It is implemented in HW. Congestion management is applied on
> ethdev
> > Rx queue using rte_eth_cman_config() API. Once it is configured, it applies
> to
> > all the packets that steer towards that particular ethdev Rx queue. This
> > feature help to skip the congestion management processing based on the
> > packet color identified by the rte_flow meter object. For example, If one
> Rx
> > queue configured as RED congestion  and application wants to bypass the
> > RED congestion  processing for all GREEN color packet can be expressed
> > though this API proposal.
> 
> Hi Ori Kam,
> 
> Let me know if above information  would give clear idea on skip RED action

I think so, to put it in my own words,  when setting this the selected packet is treated as 
green packet?

If so, can we use the meter_color field? If you want the packet to be green just set the
field to green?

Best,
Ori


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-01-26 15:13           ` Ori Kam
@ 2023-01-27  6:23             ` Jerin Jacob
  2023-02-01 17:49               ` Ori Kam
  0 siblings, 1 reply; 70+ messages in thread
From: Jerin Jacob @ 2023-01-27  6:23 UTC (permalink / raw)
  To: Ori Kam
  Cc: Rakesh Kudurumalla, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)

On Thu, Jan 26, 2023 at 8:43 PM Ori Kam <orika@nvidia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > Sent: Wednesday, 18 January 2023 10:10
> >
> >
> > > -----Original Message-----
> > > From: Rakesh Kudurumalla
> > > Sent: Tuesday, January 10, 2023 12:12 PM
> > > To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> > > Stephen Hemminger <stephen@networkplumber.org>
> > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> > > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-Adrien
> > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Ori Kam <orika@nvidia.com>
> > > > Sent: Monday, December 26, 2022 10:30 PM
> > > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > > <stephen@networkplumber.org>
> > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> > > Thomas
> > > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > Adrien
> > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > > policer
> > > >
> > > > External Email
> > > >
> > > > ----------------------------------------------------------------------
> > > > Hi All,
> > > >
> > > > > -----Original Message-----
> > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > Sent: Thursday, 22 December 2022 7:27
> > > > >
> > > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > > <stephen@networkplumber.org> wrote:
> > > > > >
> > > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > > <rkudurumalla@marvell.com> wrote:
> > > > > >
> > > > > > > Dropping of packets based on RED can be skipped with meter
> > > > > > > action, when RED is configured using
> > > > > > > rte_eth_cman_config_set()
> > > > > > >
> > > > > > > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > > >
> > > > > > Should this be more general and apply to all congestion management
> > > > > > options. Assuming the hardware can do something better than RED.
> > > > >
> > > > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > > > future- proof.
> > > >
> > > > I'm missing the idea of this new action, I understand that is related
> > > > to Jerin congestion patches.
> > > > But I fail to see why we need it? Is it to mark some metadata that
> > > > will have some effect on the congestion result? (I assume the system
> > > > is implemented in the HW)
> > >
> > > Yes. It is implemented in HW. Congestion management is applied on
> > ethdev
> > > Rx queue using rte_eth_cman_config() API. Once it is configured, it applies
> > to
> > > all the packets that steer towards that particular ethdev Rx queue. This
> > > feature help to skip the congestion management processing based on the
> > > packet color identified by the rte_flow meter object. For example, If one
> > Rx
> > > queue configured as RED congestion  and application wants to bypass the
> > > RED congestion  processing for all GREEN color packet can be expressed
> > > though this API proposal.
> >
> > Hi Ori Kam,
> >
> > Let me know if above information  would give clear idea on skip RED action
>
> I think so, to put it in my own words,  when setting this the selected packet is treated as
> green packet?
>
> If so, can we use the meter_color field? If you want the packet to be green just set the
> field to green?

It is already there in one form. See following in existing header file.

/**
 * Meter policy
 */
struct rte_mtr_meter_policy_params {
        /**
         * Policy action list per color.
         * actions[i] potentially represents a chain of rte_flow actions
         * terminated by the END action, exactly as specified by the rte_flow
         * API for the flow definition, and not just a single action.
         */
        const struct rte_flow_action *actions[RTE_COLORS];
};


>
> Best,
> Ori
>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-01-27  6:23             ` Jerin Jacob
@ 2023-02-01 17:49               ` Ori Kam
  2023-02-01 18:37                 ` Jerin Jacob
  0 siblings, 1 reply; 70+ messages in thread
From: Ori Kam @ 2023-02-01 17:49 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Rakesh Kudurumalla, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Friday, 27 January 2023 8:23
> To: Ori Kam <orika@nvidia.com>
> Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; Stephen Hemminger
> <stephen@networkplumber.org>; NBU-Contact-Thomas Monjalon
> (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org;
> NBU-Contact-Adrien Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> Subject: Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> 
> On Thu, Jan 26, 2023 at 8:43 PM Ori Kam <orika@nvidia.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > Sent: Wednesday, 18 January 2023 10:10
> > >
> > >
> > > > -----Original Message-----
> > > > From: Rakesh Kudurumalla
> > > > Sent: Tuesday, January 10, 2023 12:12 PM
> > > > To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> > > > Stephen Hemminger <stephen@networkplumber.org>
> > > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL)
> <thomas@monjalon.net>;
> > > > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> Adrien
> > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Ori Kam <orika@nvidia.com>
> > > > > Sent: Monday, December 26, 2022 10:30 PM
> > > > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > > > <stephen@networkplumber.org>
> > > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> > > > Thomas
> > > > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > > Adrien
> > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > > > policer
> > > > >
> > > > > External Email
> > > > >
> > > > > ----------------------------------------------------------------------
> > > > > Hi All,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > Sent: Thursday, 22 December 2022 7:27
> > > > > >
> > > > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > > > <stephen@networkplumber.org> wrote:
> > > > > > >
> > > > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > > > <rkudurumalla@marvell.com> wrote:
> > > > > > >
> > > > > > > > Dropping of packets based on RED can be skipped with meter
> > > > > > > > action, when RED is configured using
> > > > > > > > rte_eth_cman_config_set()
> > > > > > > >
> > > > > > > > Signed-off-by: Rakesh Kudurumalla
> <rkudurumalla@marvell.com>
> > > > > > >
> > > > > > > Should this be more general and apply to all congestion
> management
> > > > > > > options. Assuming the hardware can do something better than
> RED.
> > > > > >
> > > > > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > > > > future- proof.
> > > > >
> > > > > I'm missing the idea of this new action, I understand that is related
> > > > > to Jerin congestion patches.
> > > > > But I fail to see why we need it? Is it to mark some metadata that
> > > > > will have some effect on the congestion result? (I assume the system
> > > > > is implemented in the HW)
> > > >
> > > > Yes. It is implemented in HW. Congestion management is applied on
> > > ethdev
> > > > Rx queue using rte_eth_cman_config() API. Once it is configured, it
> applies
> > > to
> > > > all the packets that steer towards that particular ethdev Rx queue. This
> > > > feature help to skip the congestion management processing based on
> the
> > > > packet color identified by the rte_flow meter object. For example, If
> one
> > > Rx
> > > > queue configured as RED congestion  and application wants to bypass
> the
> > > > RED congestion  processing for all GREEN color packet can be expressed
> > > > though this API proposal.
> > >
> > > Hi Ori Kam,
> > >
> > > Let me know if above information  would give clear idea on skip RED
> action
> >
> > I think so, to put it in my own words,  when setting this the selected packet
> is treated as
> > green packet?
> >
> > If so, can we use the meter_color field? If you want the packet to be green
> just set the
> > field to green?
> 
> It is already there in one form. See following in existing header file.
> 
> /**
>  * Meter policy
>  */
> struct rte_mtr_meter_policy_params {
>         /**
>          * Policy action list per color.
>          * actions[i] potentially represents a chain of rte_flow actions
>          * terminated by the END action, exactly as specified by the rte_flow
>          * API for the flow definition, and not just a single action.
>          */
>         const struct rte_flow_action *actions[RTE_COLORS];
> };
> 
> 
Sorry I'm not sure I understand,
I know we can have colors in the meter, but this feature is about
somehow telling the rxq to skip the red packet and treat it as green right?

> >
> > Best,
> > Ori
> >

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-02-01 17:49               ` Ori Kam
@ 2023-02-01 18:37                 ` Jerin Jacob
  2023-02-02  7:31                   ` Ori Kam
  0 siblings, 1 reply; 70+ messages in thread
From: Jerin Jacob @ 2023-02-01 18:37 UTC (permalink / raw)
  To: Ori Kam
  Cc: Rakesh Kudurumalla, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)

On Wed, Feb 1, 2023 at 11:19 PM Ori Kam <orika@nvidia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Friday, 27 January 2023 8:23
> > To: Ori Kam <orika@nvidia.com>
> > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; Stephen Hemminger
> > <stephen@networkplumber.org>; NBU-Contact-Thomas Monjalon
> > (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>;
> > Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org;
> > NBU-Contact-Adrien Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > Subject: Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> >
> > On Thu, Jan 26, 2023 at 8:43 PM Ori Kam <orika@nvidia.com> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > Sent: Wednesday, 18 January 2023 10:10
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Rakesh Kudurumalla
> > > > > Sent: Tuesday, January 10, 2023 12:12 PM
> > > > > To: Ori Kam <orika@nvidia.com>; Jerin Jacob <jerinjacobk@gmail.com>;
> > > > > Stephen Hemminger <stephen@networkplumber.org>
> > > > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL)
> > <thomas@monjalon.net>;
> > > > > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > Adrien
> > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Ori Kam <orika@nvidia.com>
> > > > > > Sent: Monday, December 26, 2022 10:30 PM
> > > > > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > > > > <stephen@networkplumber.org>
> > > > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-Contact-
> > > > > Thomas
> > > > > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > > > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > > > Adrien
> > > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > > > > policer
> > > > > >
> > > > > > External Email
> > > > > >
> > > > > > ----------------------------------------------------------------------
> > > > > > Hi All,
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > Sent: Thursday, 22 December 2022 7:27
> > > > > > >
> > > > > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > > > > <stephen@networkplumber.org> wrote:
> > > > > > > >
> > > > > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > > > > <rkudurumalla@marvell.com> wrote:
> > > > > > > >
> > > > > > > > > Dropping of packets based on RED can be skipped with meter
> > > > > > > > > action, when RED is configured using
> > > > > > > > > rte_eth_cman_config_set()
> > > > > > > > >
> > > > > > > > > Signed-off-by: Rakesh Kudurumalla
> > <rkudurumalla@marvell.com>
> > > > > > > >
> > > > > > > > Should this be more general and apply to all congestion
> > management
> > > > > > > > options. Assuming the hardware can do something better than
> > RED.
> > > > > > >
> > > > > > > Yes. We can use "enum rte_cman_mode mode" in the descriptor to
> > > > > > > future- proof.
> > > > > >
> > > > > > I'm missing the idea of this new action, I understand that is related
> > > > > > to Jerin congestion patches.
> > > > > > But I fail to see why we need it? Is it to mark some metadata that
> > > > > > will have some effect on the congestion result? (I assume the system
> > > > > > is implemented in the HW)
> > > > >
> > > > > Yes. It is implemented in HW. Congestion management is applied on
> > > > ethdev
> > > > > Rx queue using rte_eth_cman_config() API. Once it is configured, it
> > applies
> > > > to
> > > > > all the packets that steer towards that particular ethdev Rx queue. This
> > > > > feature help to skip the congestion management processing based on
> > the
> > > > > packet color identified by the rte_flow meter object. For example, If
> > one
> > > > Rx
> > > > > queue configured as RED congestion  and application wants to bypass
> > the
> > > > > RED congestion  processing for all GREEN color packet can be expressed
> > > > > though this API proposal.
> > > >
> > > > Hi Ori Kam,
> > > >
> > > > Let me know if above information  would give clear idea on skip RED
> > action
> > >
> > > I think so, to put it in my own words,  when setting this the selected packet
> > is treated as
> > > green packet?
> > >
> > > If so, can we use the meter_color field? If you want the packet to be green
> > just set the
> > > field to green?
> >
> > It is already there in one form. See following in existing header file.
> >
> > /**
> >  * Meter policy
> >  */
> > struct rte_mtr_meter_policy_params {
> >         /**
> >          * Policy action list per color.
> >          * actions[i] potentially represents a chain of rte_flow actions
> >          * terminated by the END action, exactly as specified by the rte_flow
> >          * API for the flow definition, and not just a single action.
> >          */
> >         const struct rte_flow_action *actions[RTE_COLORS];
> > };
> >
> >
> Sorry I'm not sure I understand,
> I know we can have colors in the meter, but this feature is about
> somehow telling the rxq to skip the red packet and treat it as green right?

Yes. When rte_mtr_meter_policy_params::actions[RTE_COLOR_GREEN] set as
RTE_FLOW_ACTION_TYPE_SKIP_CMAN for the given meter object,
it is indicating to SKIP the CMAN configuration applied to the rxq on
the downstream path if meter assigns a GREEN color.
(RQ section is as usual as existing path, either via ethdev RSS or
rte_flow RSS action or rte_fow Queue action).

>
> > >
> > > Best,
> > > Ori
> > >

^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-02-01 18:37                 ` Jerin Jacob
@ 2023-02-02  7:31                   ` Ori Kam
  2023-02-06  3:31                     ` Jerin Jacob
  0 siblings, 1 reply; 70+ messages in thread
From: Ori Kam @ 2023-02-02  7:31 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Rakesh Kudurumalla, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Wednesday, 1 February 2023 20:37
> 
> On Wed, Feb 1, 2023 at 11:19 PM Ori Kam <orika@nvidia.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > Sent: Friday, 27 January 2023 8:23
> > > To: Ori Kam <orika@nvidia.com>
> > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; Stephen
> Hemminger
> > > <stephen@networkplumber.org>; NBU-Contact-Thomas Monjalon
> > > (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@amd.com>;
> > > Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org;
> > > NBU-Contact-Adrien Mazarguil (EXTERNAL)
> <adrien.mazarguil@6wind.com>
> > > Subject: Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > >
> > > On Thu, Jan 26, 2023 at 8:43 PM Ori Kam <orika@nvidia.com> wrote:
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > > Sent: Wednesday, 18 January 2023 10:10
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Rakesh Kudurumalla
> > > > > > Sent: Tuesday, January 10, 2023 12:12 PM
> > > > > > To: Ori Kam <orika@nvidia.com>; Jerin Jacob
> <jerinjacobk@gmail.com>;
> > > > > > Stephen Hemminger <stephen@networkplumber.org>
> > > > > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL)
> > > <thomas@monjalon.net>;
> > > > > > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > > Adrien
> > > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > > > > >
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Ori Kam <orika@nvidia.com>
> > > > > > > Sent: Monday, December 26, 2022 10:30 PM
> > > > > > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > > > > > <stephen@networkplumber.org>
> > > > > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-
> Contact-
> > > > > > Thomas
> > > > > > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > > > > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-
> Contact-
> > > > > Adrien
> > > > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > > > > > policer
> > > > > > >
> > > > > > > External Email
> > > > > > >
> > > > > > > ----------------------------------------------------------------------
> > > > > > > Hi All,
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > Sent: Thursday, 22 December 2022 7:27
> > > > > > > >
> > > > > > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > > > > > <stephen@networkplumber.org> wrote:
> > > > > > > > >
> > > > > > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > > > > > <rkudurumalla@marvell.com> wrote:
> > > > > > > > >
> > > > > > > > > > Dropping of packets based on RED can be skipped with
> meter
> > > > > > > > > > action, when RED is configured using
> > > > > > > > > > rte_eth_cman_config_set()
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Rakesh Kudurumalla
> > > <rkudurumalla@marvell.com>
> > > > > > > > >
> > > > > > > > > Should this be more general and apply to all congestion
> > > management
> > > > > > > > > options. Assuming the hardware can do something better than
> > > RED.
> > > > > > > >
> > > > > > > > Yes. We can use "enum rte_cman_mode mode" in the
> descriptor to
> > > > > > > > future- proof.
> > > > > > >
> > > > > > > I'm missing the idea of this new action, I understand that is related
> > > > > > > to Jerin congestion patches.
> > > > > > > But I fail to see why we need it? Is it to mark some metadata that
> > > > > > > will have some effect on the congestion result? (I assume the
> system
> > > > > > > is implemented in the HW)
> > > > > >
> > > > > > Yes. It is implemented in HW. Congestion management is applied on
> > > > > ethdev
> > > > > > Rx queue using rte_eth_cman_config() API. Once it is configured, it
> > > applies
> > > > > to
> > > > > > all the packets that steer towards that particular ethdev Rx queue.
> This
> > > > > > feature help to skip the congestion management processing based
> on
> > > the
> > > > > > packet color identified by the rte_flow meter object. For example,
> If
> > > one
> > > > > Rx
> > > > > > queue configured as RED congestion  and application wants to
> bypass
> > > the
> > > > > > RED congestion  processing for all GREEN color packet can be
> expressed
> > > > > > though this API proposal.
> > > > >
> > > > > Hi Ori Kam,
> > > > >
> > > > > Let me know if above information  would give clear idea on skip RED
> > > action
> > > >
> > > > I think so, to put it in my own words,  when setting this the selected
> packet
> > > is treated as
> > > > green packet?
> > > >
> > > > If so, can we use the meter_color field? If you want the packet to be
> green
> > > just set the
> > > > field to green?
> > >
> > > It is already there in one form. See following in existing header file.
> > >
> > > /**
> > >  * Meter policy
> > >  */
> > > struct rte_mtr_meter_policy_params {
> > >         /**
> > >          * Policy action list per color.
> > >          * actions[i] potentially represents a chain of rte_flow actions
> > >          * terminated by the END action, exactly as specified by the rte_flow
> > >          * API for the flow definition, and not just a single action.
> > >          */
> > >         const struct rte_flow_action *actions[RTE_COLORS];
> > > };
> > >
> > >
> > Sorry I'm not sure I understand,
> > I know we can have colors in the meter, but this feature is about
> > somehow telling the rxq to skip the red packet and treat it as green right?
> 
> Yes. When rte_mtr_meter_policy_params::actions[RTE_COLOR_GREEN] set
> as
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN for the given meter object,
> it is indicating to SKIP the CMAN configuration applied to the rxq on
> the downstream path if meter assigns a GREEN color.
> (RQ section is as usual as existing path, either via ethdev RSS or
> rte_flow RSS action or rte_fow Queue action).
> 

Sorry for all my questions just trying to find the best solution,
Some follow up questions,
1. except the skip_cman what other actions is going to be in the action list? Queue? Jump?
2. why can't we use the meter color as input if the cman should be skipped or not?

Thanks,
Ori

> >
> > > >
> > > > Best,
> > > > Ori
> > > >

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
  2023-02-02  7:31                   ` Ori Kam
@ 2023-02-06  3:31                     ` Jerin Jacob
  0 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-06  3:31 UTC (permalink / raw)
  To: Ori Kam
  Cc: Rakesh Kudurumalla, Stephen Hemminger,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko, dev,
	NBU-Contact-Adrien Mazarguil (EXTERNAL)

On Thu, Feb 2, 2023 at 1:01 PM Ori Kam <orika@nvidia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Wednesday, 1 February 2023 20:37
> >
> > On Wed, Feb 1, 2023 at 11:19 PM Ori Kam <orika@nvidia.com> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > Sent: Friday, 27 January 2023 8:23
> > > > To: Ori Kam <orika@nvidia.com>
> > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; Stephen
> > Hemminger
> > > > <stephen@networkplumber.org>; NBU-Contact-Thomas Monjalon
> > > > (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > <ferruh.yigit@amd.com>;
> > > > Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org;
> > > > NBU-Contact-Adrien Mazarguil (EXTERNAL)
> > <adrien.mazarguil@6wind.com>
> > > > Subject: Re: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > > >
> > > > On Thu, Jan 26, 2023 at 8:43 PM Ori Kam <orika@nvidia.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > > > > > Sent: Wednesday, 18 January 2023 10:10
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Rakesh Kudurumalla
> > > > > > > Sent: Tuesday, January 10, 2023 12:12 PM
> > > > > > > To: Ori Kam <orika@nvidia.com>; Jerin Jacob
> > <jerinjacobk@gmail.com>;
> > > > > > > Stephen Hemminger <stephen@networkplumber.org>
> > > > > > > Cc: NBU-Contact-Thomas Monjalon (EXTERNAL)
> > > > <thomas@monjalon.net>;
> > > > > > > Ferruh Yigit <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-Contact-
> > > > Adrien
> > > > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > > > Subject: RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress policer
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Ori Kam <orika@nvidia.com>
> > > > > > > > Sent: Monday, December 26, 2022 10:30 PM
> > > > > > > > To: Jerin Jacob <jerinjacobk@gmail.com>; Stephen Hemminger
> > > > > > > > <stephen@networkplumber.org>
> > > > > > > > Cc: Rakesh Kudurumalla <rkudurumalla@marvell.com>; NBU-
> > Contact-
> > > > > > > Thomas
> > > > > > > > Monjalon (EXTERNAL) <thomas@monjalon.net>; Ferruh Yigit
> > > > > > > > <ferruh.yigit@amd.com>; Andrew Rybchenko
> > > > > > > > <andrew.rybchenko@oktetlabs.ru>; dev@dpdk.org; NBU-
> > Contact-
> > > > > > Adrien
> > > > > > > > Mazarguil (EXTERNAL) <adrien.mazarguil@6wind.com>
> > > > > > > > Subject: [EXT] RE: [PATCH 1/3] lib: dpdk spec to skip red for ingress
> > > > > > > > policer
> > > > > > > >
> > > > > > > > External Email
> > > > > > > >
> > > > > > > > ----------------------------------------------------------------------
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Jerin Jacob <jerinjacobk@gmail.com>
> > > > > > > > > Sent: Thursday, 22 December 2022 7:27
> > > > > > > > >
> > > > > > > > > On Thu, Dec 22, 2022 at 8:32 AM Stephen Hemminger
> > > > > > > > > <stephen@networkplumber.org> wrote:
> > > > > > > > > >
> > > > > > > > > > On Thu, 22 Dec 2022 07:09:02 +0530 Rakesh Kudurumalla
> > > > > > > > > > <rkudurumalla@marvell.com> wrote:
> > > > > > > > > >
> > > > > > > > > > > Dropping of packets based on RED can be skipped with
> > meter
> > > > > > > > > > > action, when RED is configured using
> > > > > > > > > > > rte_eth_cman_config_set()
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Rakesh Kudurumalla
> > > > <rkudurumalla@marvell.com>
> > > > > > > > > >
> > > > > > > > > > Should this be more general and apply to all congestion
> > > > management
> > > > > > > > > > options. Assuming the hardware can do something better than
> > > > RED.
> > > > > > > > >
> > > > > > > > > Yes. We can use "enum rte_cman_mode mode" in the
> > descriptor to
> > > > > > > > > future- proof.
> > > > > > > >
> > > > > > > > I'm missing the idea of this new action, I understand that is related
> > > > > > > > to Jerin congestion patches.
> > > > > > > > But I fail to see why we need it? Is it to mark some metadata that
> > > > > > > > will have some effect on the congestion result? (I assume the
> > system
> > > > > > > > is implemented in the HW)
> > > > > > >
> > > > > > > Yes. It is implemented in HW. Congestion management is applied on
> > > > > > ethdev
> > > > > > > Rx queue using rte_eth_cman_config() API. Once it is configured, it
> > > > applies
> > > > > > to
> > > > > > > all the packets that steer towards that particular ethdev Rx queue.
> > This
> > > > > > > feature help to skip the congestion management processing based
> > on
> > > > the
> > > > > > > packet color identified by the rte_flow meter object. For example,
> > If
> > > > one
> > > > > > Rx
> > > > > > > queue configured as RED congestion  and application wants to
> > bypass
> > > > the
> > > > > > > RED congestion  processing for all GREEN color packet can be
> > expressed
> > > > > > > though this API proposal.
> > > > > >
> > > > > > Hi Ori Kam,
> > > > > >
> > > > > > Let me know if above information  would give clear idea on skip RED
> > > > action
> > > > >
> > > > > I think so, to put it in my own words,  when setting this the selected
> > packet
> > > > is treated as
> > > > > green packet?
> > > > >
> > > > > If so, can we use the meter_color field? If you want the packet to be
> > green
> > > > just set the
> > > > > field to green?
> > > >
> > > > It is already there in one form. See following in existing header file.
> > > >
> > > > /**
> > > >  * Meter policy
> > > >  */
> > > > struct rte_mtr_meter_policy_params {
> > > >         /**
> > > >          * Policy action list per color.
> > > >          * actions[i] potentially represents a chain of rte_flow actions
> > > >          * terminated by the END action, exactly as specified by the rte_flow
> > > >          * API for the flow definition, and not just a single action.
> > > >          */
> > > >         const struct rte_flow_action *actions[RTE_COLORS];
> > > > };
> > > >
> > > >
> > > Sorry I'm not sure I understand,
> > > I know we can have colors in the meter, but this feature is about
> > > somehow telling the rxq to skip the red packet and treat it as green right?
> >
> > Yes. When rte_mtr_meter_policy_params::actions[RTE_COLOR_GREEN] set
> > as
> > RTE_FLOW_ACTION_TYPE_SKIP_CMAN for the given meter object,
> > it is indicating to SKIP the CMAN configuration applied to the rxq on
> > the downstream path if meter assigns a GREEN color.
> > (RQ section is as usual as existing path, either via ethdev RSS or
> > rte_flow RSS action or rte_fow Queue action).
> >
>
> Sorry for all my questions just trying to find the best solution,
> Some follow up questions,
> 1. except the skip_cman what other actions is going to be in the action list? Queue? Jump?

No specific restriction from speciation POV. Queue, Jump, RSS most
useful candidates.

> 2. why can't we use the meter color as input if the cman should be skipped or not?

Because, cman skip is happening in ethdev Rx and in our case meter
object action is the one trigger for this.

>
> Thanks,
> Ori
>
> > >
> > > > >
> > > > > Best,
> > > > > Ori
> > > > >

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v3 1/3] lib: skip congestion management configuration
  2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
                     ` (2 preceding siblings ...)
  2023-01-25  9:26   ` [PATCH v2 1/3] lib: skip congestion management configuration Jerin Jacob
@ 2023-02-09  7:24   ` Rakesh Kudurumalla
  2023-02-09  7:24     ` [PATCH v3 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                       ` (3 more replies)
  3 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  7:24 UTC (permalink / raw)
  To: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Skip the congestion management configuration applied using
rte_eth_cman_config_set() API on the given ethdev Rx queue.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
v3: Updated comments and programmers guide regrading
new action
 doc/guides/prog_guide/rte_flow.rst | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h              | 20 ++++++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..0737b877da 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..5ae00e2245 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,26 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * ethdev: introduce flow action to skip congestion
+	 * management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 * This feature helps to skip the congestion management processing
+	 * based on per flow or the packet color identified by
+	 * rte_flow meter object. For example, If one Rx queue configured as
+	 * RED congestion and application wants tobypass the RED congestion
+	 * processing for all GREEN color packet can be expressed though
+	 * RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v3 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
@ 2023-02-09  7:24     ` Rakesh Kudurumalla
  2023-02-09  7:24     ` [PATCH v3 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  7:24 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v3 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
  2023-02-09  7:24     ` [PATCH v3 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-09  7:24     ` Rakesh Kudurumalla
  2023-02-09  7:31     ` [PATCH v3 1/3] lib: skip congestion management configuration Jerin Jacob
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  7:24 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini  |  1 +
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..753da67c5a 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -80,6 +80,7 @@ vxlan_gpe            = Y
 
 [rte_flow actions]
 count                = Y
+skip_cman	     = Y
 drop                 = Y
 flag                 = Y
 mark                 = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v3 1/3] lib: skip congestion management configuration
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
  2023-02-09  7:24     ` [PATCH v3 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-09  7:24     ` [PATCH v3 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-09  7:31     ` Jerin Jacob
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-09  7:31 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, jerinj,
	ndabilpuram, dev

On Thu, Feb 9, 2023 at 12:54 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Skip the congestion management configuration applied using
> rte_eth_cman_config_set() API on the given ethdev Rx queue.
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
> v3: Updated comments and programmers guide regrading
> new action
>  doc/guides/prog_guide/rte_flow.rst | 22 ++++++++++++++++++++++
>  lib/ethdev/rte_flow.h              | 20 ++++++++++++++++++++
>  2 files changed, 42 insertions(+)
>
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 3e6242803d..0737b877da 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1840,6 +1840,28 @@ Drop packets.
>     | no properties |
>     +---------------+
>
> +
> +Action: ``SKIP_CMAN``
> +^^^^^^^^^^^^^^^^^^^
> +
> +Skip congestion management on received packets
> +
> +- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
> +  queue's congestion mechanism.Once applied packets congestion configuration
> +  is bypassed on that particular ethdev Rx queue for all packets directed
> +  to that receive queue
> +
> +.. _table_rte_flow_action_skip_cman:
> +
> +.. table:: SKIP_CMAN
> +
> +   +---------------+
> +   | Field         |
> +   +===============+
> +   | no properties |
> +   +---------------+
> +
> +
>  Action: ``COUNT``
>  ^^^^^^^^^^^^^^^^^
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..5ae00e2245 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -2203,6 +2203,26 @@ enum rte_flow_action_type {
>          */
>         RTE_FLOW_ACTION_TYPE_DROP,
>
> +       /**
> +        * Skip congestion management configuration
> +        *
> +        * ethdev: introduce flow action to skip congestion
> +        * management configuration

This supposes to be git commit heading.

> +        *
> +        * Using rte_eth_cman_config_set() API the application
> +        * can configure ethdev Rx queue's congestion mechanism.
> +        * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> +        * congestion configuration applied to the given ethdev Rx queue.

This paragraph is OK here.

> +        *
> +        * This feature helps to skip the congestion management processing
> +        * based on per flow or the packet color identified by
> +        * rte_flow meter object. For example, If one Rx queue configured as
> +        * RED congestion and application wants tobypass the RED congestion
> +        * processing for all GREEN color packet can be expressed though
> +        * RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Move this to git commit log

> +        */
> +       RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
> +
>         /**
>          * Enables counters for this flow rule.
>          *
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v4 1/3] ethdev: skip congestion management configuration
  2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
                       ` (2 preceding siblings ...)
  2023-02-09  7:31     ` [PATCH v3 1/3] lib: skip congestion management configuration Jerin Jacob
@ 2023-02-09  8:35     ` Rakesh Kudurumalla
  2023-02-09  8:35       ` [PATCH v4 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                         ` (3 more replies)
  3 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  8:35 UTC (permalink / raw)
  To: Ori Kam, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
v4: updated commit message

 doc/guides/prog_guide/rte_flow.rst | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h              | 11 +++++++++++
 2 files changed, 33 insertions(+)

diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..0737b877da 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..f4eb4232d4 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v4 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
@ 2023-02-09  8:35       ` Rakesh Kudurumalla
  2023-02-09  8:35       ` [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  8:35 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
  2023-02-09  8:35       ` [PATCH v4 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-09  8:35       ` Rakesh Kudurumalla
  2023-02-09 17:14         ` Jerin Jacob
  2023-02-09 14:51       ` [PATCH v4 1/3] ethdev: skip congestion management configuration Ori Kam
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
  3 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-09  8:35 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini  |  1 +
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..753da67c5a 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -80,6 +80,7 @@ vxlan_gpe            = Y
 
 [rte_flow actions]
 count                = Y
+skip_cman	     = Y
 drop                 = Y
 flag                 = Y
 mark                 = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH v4 1/3] ethdev: skip congestion management configuration
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
  2023-02-09  8:35       ` [PATCH v4 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-09  8:35       ` [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-09 14:51       ` Ori Kam
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Ori Kam @ 2023-02-09 14:51 UTC (permalink / raw)
  To: Rakesh Kudurumalla, NBU-Contact-Thomas Monjalon (EXTERNAL),
	Ferruh Yigit, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev

Hi Rakesh,

> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Thursday, 9 February 2023 10:36
> Subject: [PATCH v4 1/3] ethdev: skip congestion management configuration
> 
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-09  8:35       ` [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-09 17:14         ` Jerin Jacob
  0 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-09 17:14 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	jerinj, dev

On Thu, Feb 9, 2023 at 2:06 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Dropping of packets is based on action configured
> to meter.If both skip_red and drop actions are configured
> then tail dropping in invoked else if only drop action is
> configured then RED drop is invoked.This action is supported
> only when RED is configured using rte_eth_cman_config_set()
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>


Fix CI reported issue at
http://mails.dpdk.org/archives/test-report/2023-February/350229.html
https://patches.dpdk.org/project/dpdk/patch/20230209083558.958566-3-rkudurumalla@marvell.com/

> ---
>  doc/guides/nics/features/cnxk.ini  |  1 +
>  drivers/net/cnxk/cnxk_ethdev.h     |  1 +
>  drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
>  3 files changed, 52 insertions(+)
>
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index f81628da77..753da67c5a 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -80,6 +80,7 @@ vxlan_gpe            = Y
>
>  [rte_flow actions]
>  count                = Y
> +skip_cman           = Y
>  drop                 = Y
>  flag                 = Y
>  mark                 = Y
> diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
> index f0eab4244c..ba35873124 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.h
> +++ b/drivers/net/cnxk/cnxk_ethdev.h
> @@ -168,6 +168,7 @@ struct policy_actions {
>                 uint16_t queue;
>                 uint32_t mtr_id;
>                 struct action_rss *rss_desc;
> +               bool skip_red;
>         };
>  };
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> index dcfa4223d5..27a6e4ef3d 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> @@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
>                                 if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
>                                         supported[i] = true;
>
> +                               if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +                                       supported[i] = true;
> +
>                                 if (!supported[i])
>                                         return update_mtr_err(i, error, true);
>                         }
> @@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
>                                         fmp->actions[i].action_fate =
>                                                 action->type;
>                                 }
> +
> +                               if (action->type ==
> +                                       RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +                                       fmp->actions[i].skip_red = true;
>                         }
>                 }
>         }
> @@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
>                 cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
>  }
>
> +static void
> +nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
> +                  struct roc_nix_bpf_cfg *cfg)
> +{
> +       struct cnxk_mtr_policy_node *policy = mtr->policy;
> +
> +       if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
> +          (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)   ||
> +          (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
> +               if (policy->actions[RTE_COLOR_GREEN].action_fate ==
> +                       RTE_FLOW_ACTION_TYPE_DROP) {
> +                       if (policy->actions[RTE_COLOR_GREEN].skip_red)
> +                               cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +                                               ROC_NIX_BPF_ACTION_DROP;
> +                       else
> +                               cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +                                               ROC_NIX_BPF_ACTION_RED;
> +               }
> +               if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
> +                       RTE_FLOW_ACTION_TYPE_DROP) {
> +                       if (policy->actions[RTE_COLOR_YELLOW].skip_red)
> +                               cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +                                               ROC_NIX_BPF_ACTION_DROP;
> +                       else
> +                               cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +                                               ROC_NIX_BPF_ACTION_RED;
> +               }
> +               if (policy->actions[RTE_COLOR_RED].action_fate ==
> +                       RTE_FLOW_ACTION_TYPE_DROP) {
> +                       if (policy->actions[RTE_COLOR_RED].skip_red)
> +                               cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +                                               ROC_NIX_BPF_ACTION_DROP;
> +                       else
> +                               cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +                                               ROC_NIX_BPF_ACTION_RED;
> +               }
> +       }
> +}
> +
>  static void
>  nix_precolor_table_map(struct cnxk_meter_node *mtr,
>                        struct roc_nix_bpf_precolor *tbl,
> @@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
>                         if (!mtr[i]->is_used) {
>                                 memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
>                                 nix_mtr_config_map(mtr[i], &cfg);
> +                               for (j = 0; j < mtr[i]->rq_num; j++) {
> +                                       rq = &dev->rqs[mtr[i]->rq_id[j]];
> +                                       nix_mtr_config_red(mtr[i], rq, &cfg);
> +                               }
>                                 rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
>                                                         lvl_map[mtr[i]->level],
>                                                         &cfg);
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v5 1/3] ethdev: skip congestion management configuration
  2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
                         ` (2 preceding siblings ...)
  2023-02-09 14:51       ` [PATCH v4 1/3] ethdev: skip congestion management configuration Ori Kam
@ 2023-02-10  8:14       ` Rakesh Kudurumalla
  2023-02-10  8:14         ` [PATCH v5 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                           ` (3 more replies)
  3 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:14 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
v5: Updated doc
 doc/guides/nics/features/cnxk.ini    |  1 +
 doc/guides/nics/features/cnxk_vf.ini |  1 +
 doc/guides/nics/features/default.ini |  1 +
 doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h                | 11 +++++++++++
 5 files changed, 36 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 510cc6679d..b93f053a2b 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -198,6 +198,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..4efadcc87b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..f4eb4232d4 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v5 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
@ 2023-02-10  8:14         ` Rakesh Kudurumalla
  2023-02-10  8:14         ` [PATCH v5 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:14 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v5 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
  2023-02-10  8:14         ` [PATCH v5 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-10  8:14         ` Rakesh Kudurumalla
  2023-02-10  8:16         ` [PATCH v5 1/3] ethdev: skip congestion management configuration Jerin Jacob
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:14 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini  |  1 +
 drivers/net/cnxk/cnxk_ethdev.h     |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 50 ++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index 7947c044bb..afbb6dc8c9 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -80,6 +80,7 @@ vxlan_gpe            = Y
 
 [rte_flow actions]
 count                = Y
+skip_cman	     = Y
 drop                 = Y
 flag                 = Y
 mark                 = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v5 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
  2023-02-10  8:14         ` [PATCH v5 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-10  8:14         ` [PATCH v5 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-10  8:16         ` Jerin Jacob
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-10  8:16 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko, jerinj,
	dev

On Fri, Feb 10, 2023 at 1:44 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> ---
> v5: Updated doc
>  doc/guides/nics/features/cnxk.ini    |  1 +
>  doc/guides/nics/features/cnxk_vf.ini |  1 +
>  doc/guides/nics/features/default.ini |  1 +
>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
>  lib/ethdev/rte_flow.h                | 11 +++++++++++
>  5 files changed, 36 insertions(+)
>
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index f81628da77..7947c044bb 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -94,4 +94,5 @@ queue                = Y
>  represented_port     = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y
> diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
> index c4ee32a9ad..873e1dcc0a 100644
> --- a/doc/guides/nics/features/cnxk_vf.ini
> +++ b/doc/guides/nics/features/cnxk_vf.ini
> @@ -83,4 +83,5 @@ pf                   = Y
>  queue                = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y

cnxk specific . Move to 3/3 patch.

> diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
> index 510cc6679d..b93f053a2b 100644
> --- a/doc/guides/nics/features/default.ini
> +++ b/doc/guides/nics/features/default.ini
> @@ -198,6 +198,7 @@ set_tag              =
>  set_tp_dst           =
>  set_tp_src           =
>  set_ttl              =
> +skip_cman            =
>  vf                   =
>  vxlan_decap          =
>  vxlan_encap          =
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 3e6242803d..4efadcc87b 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1840,6 +1840,28 @@ Drop packets.
>     | no properties |
>     +---------------+
>
> +
> +Action: ``SKIP_CMAN``
> +^^^^^^^^^^^^^^^^^^^^^
> +
> +Skip congestion management on received packets
> +
> +- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
> +  queue's congestion mechanism.Once applied packets congestion configuration
> +  is bypassed on that particular ethdev Rx queue for all packets directed
> +  to that receive queue
> +
> +.. _table_rte_flow_action_skip_cman:
> +
> +.. table:: SKIP_CMAN
> +
> +   +---------------+
> +   | Field         |
> +   +===============+
> +   | no properties |
> +   +---------------+
> +
> +
>  Action: ``COUNT``
>  ^^^^^^^^^^^^^^^^^
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..f4eb4232d4 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
>          */
>         RTE_FLOW_ACTION_TYPE_DROP,
>
> +       /**
> +        * Skip congestion management configuration
> +        *
> +        * Using rte_eth_cman_config_set() API the application
> +        * can configure ethdev Rx queue's congestion mechanism.
> +        * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> +        * congestion configuration applied to the given ethdev Rx queue.
> +        *
> +        */
> +       RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
> +
>         /**
>          * Enables counters for this flow rule.
>          *
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
                           ` (2 preceding siblings ...)
  2023-02-10  8:16         ` [PATCH v5 1/3] ethdev: skip congestion management configuration Jerin Jacob
@ 2023-02-10  8:26         ` Rakesh Kudurumalla
  2023-02-10  8:26           ` [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                             ` (5 more replies)
  3 siblings, 6 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:26 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
 doc/guides/nics/features/default.ini |  1 +
 doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h                | 11 +++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 510cc6679d..b93f053a2b 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -198,6 +198,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..4efadcc87b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..f4eb4232d4 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
 	 */
 	RTE_FLOW_ACTION_TYPE_DROP,
 
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
+
 	/**
 	 * Enables counters for this flow rule.
 	 *
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
@ 2023-02-10  8:26           ` Rakesh Kudurumalla
  2023-02-10 23:08             ` Ferruh Yigit
  2023-02-10  8:26           ` [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                             ` (4 subsequent siblings)
  5 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:26 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
  2023-02-10  8:26           ` [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-10  8:26           ` Rakesh Kudurumalla
  2023-02-10 23:18             ` Ferruh Yigit
  2023-02-10  9:27           ` [PATCH v6 1/3] ethdev: skip congestion management configuration Jerin Jacob
                             ` (3 subsequent siblings)
  5 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-10  8:26 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini    |  2 ++
 doc/guides/nics/features/cnxk_vf.ini |  1 +
 drivers/net/cnxk/cnxk_ethdev.h       |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c   | 50 ++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..afbb6dc8c9 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -80,6 +80,7 @@ vxlan_gpe            = Y
 
 [rte_flow actions]
 count                = Y
+skip_cman	     = Y
 drop                 = Y
 flag                 = Y
 mark                 = Y
@@ -94,4 +95,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
  2023-02-10  8:26           ` [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-10  8:26           ` [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-10  9:27           ` Jerin Jacob
  2023-02-10 23:10           ` Ferruh Yigit
                             ` (2 subsequent siblings)
  5 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-10  9:27 UTC (permalink / raw)
  To: Rakesh Kudurumalla
  Cc: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko, jerinj,
	ndabilpuram, dev

On Fri, Feb 10, 2023 at 1:56 PM Rakesh Kudurumalla
<rkudurumalla@marvell.com> wrote:
>
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
>
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>


> ---
> v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
>  doc/guides/nics/features/default.ini |  1 +
>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
>  lib/ethdev/rte_flow.h                | 11 +++++++++++
>  3 files changed, 34 insertions(+)
>
> diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
> index 510cc6679d..b93f053a2b 100644
> --- a/doc/guides/nics/features/default.ini
> +++ b/doc/guides/nics/features/default.ini
> @@ -198,6 +198,7 @@ set_tag              =
>  set_tp_dst           =
>  set_tp_src           =
>  set_ttl              =
> +skip_cman            =
>  vf                   =
>  vxlan_decap          =
>  vxlan_encap          =
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 3e6242803d..4efadcc87b 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1840,6 +1840,28 @@ Drop packets.
>     | no properties |
>     +---------------+
>
> +
> +Action: ``SKIP_CMAN``
> +^^^^^^^^^^^^^^^^^^^^^
> +
> +Skip congestion management on received packets
> +
> +- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
> +  queue's congestion mechanism.Once applied packets congestion configuration
> +  is bypassed on that particular ethdev Rx queue for all packets directed
> +  to that receive queue
> +
> +.. _table_rte_flow_action_skip_cman:
> +
> +.. table:: SKIP_CMAN
> +
> +   +---------------+
> +   | Field         |
> +   +===============+
> +   | no properties |
> +   +---------------+
> +
> +
>  Action: ``COUNT``
>  ^^^^^^^^^^^^^^^^^
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..f4eb4232d4 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
>          */
>         RTE_FLOW_ACTION_TYPE_DROP,
>
> +       /**
> +        * Skip congestion management configuration
> +        *
> +        * Using rte_eth_cman_config_set() API the application
> +        * can configure ethdev Rx queue's congestion mechanism.
> +        * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> +        * congestion configuration applied to the given ethdev Rx queue.
> +        *
> +        */
> +       RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
> +
>         /**
>          * Enables counters for this flow rule.
>          *
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-10  8:26           ` [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-10 23:08             ` Ferruh Yigit
  2023-02-14 13:12               ` Ferruh Yigit
  0 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-10 23:08 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev

On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> added support for testpmd application to accept
> skip_cman action while configuring policy action
> 

Can you please give some sample testpmd commands with new action in
commit log, it helps.

> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
>  app/test-pmd/cmdline_flow.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 88108498e0..fc003e0096 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -472,6 +472,7 @@ enum index {
>  	ACTION_END,
>  	ACTION_VOID,
>  	ACTION_PASSTHRU,
> +	ACTION_SKIP_CMAN,
>  	ACTION_JUMP,
>  	ACTION_JUMP_GROUP,
>  	ACTION_MARK,
> @@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
>  	ACTION_END,
>  	ACTION_VOID,
>  	ACTION_PASSTHRU,
> +	ACTION_SKIP_CMAN,
>  	ACTION_JUMP,
>  	ACTION_MARK,
>  	ACTION_FLAG,
> @@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
>  		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
>  		.call = parse_vc,
>  	},
> +	[ACTION_SKIP_CMAN] = {
> +		.name = "skip_cman",
> +		.help = "bypass cman on received packets",
> +		.priv = PRIV_ACTION(SKIP_CMAN, 0),
> +		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
> +		.call = parse_vc,
> +	},
>  	[ACTION_JUMP] = {
>  		.name = "jump",
>  		.help = "redirect traffic to a given group",


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
                             ` (2 preceding siblings ...)
  2023-02-10  9:27           ` [PATCH v6 1/3] ethdev: skip congestion management configuration Jerin Jacob
@ 2023-02-10 23:10           ` Ferruh Yigit
  2023-02-13 12:34             ` Ori Kam
  2023-02-11  0:35           ` Ferruh Yigit
  2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
  5 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-10 23:10 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev

On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> ---
> v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
>  doc/guides/nics/features/default.ini |  1 +
>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
>  lib/ethdev/rte_flow.h                | 11 +++++++++++

Should the release notes needs to be updated for this?

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-10  8:26           ` [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-10 23:18             ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-10 23:18 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev

On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index f81628da77..afbb6dc8c9 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -80,6 +80,7 @@ vxlan_gpe            = Y
>  
>  [rte_flow actions]
>  count                = Y
> +skip_cman	     = Y
>  drop                 = Y
>  flag                 = Y
>  mark                 = Y
> @@ -94,4 +95,5 @@ queue                = Y
>  represented_port     = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y

'skip_cman' added twice.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
                             ` (3 preceding siblings ...)
  2023-02-10 23:10           ` Ferruh Yigit
@ 2023-02-11  0:35           ` Ferruh Yigit
  2023-02-11  5:16             ` Jerin Jacob
  2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
  5 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-11  0:35 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, David Marchand

On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..f4eb4232d4 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
>  	 */
>  	RTE_FLOW_ACTION_TYPE_DROP,
>  
> +	/**
> +	 * Skip congestion management configuration
> +	 *
> +	 * Using rte_eth_cman_config_set() API the application
> +	 * can configure ethdev Rx queue's congestion mechanism.
> +	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> +	 * congestion configuration applied to the given ethdev Rx queue.
> +	 *
> +	 */
> +	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
> +

Inserting new enum item in to the middle of the enum upsets the ABI
checks [1], can it go to the end?




[1]
1 function with some indirect sub-type change:

  [C] 'function size_t rte_flow_copy(rte_flow_desc*, size_t, const
rte_flow_attr*, const rte_flow_item*, const rte_flow_action*)' at
rte_flow.c:1092:1 has some indirect sub-type changes:
    parameter 1 of type 'rte_flow_desc*' has sub-type changes:
      in pointed to type 'struct rte_flow_desc' at rte_flow.h:4326:1:
        type size hasn't changed
        1 data member changes (1 filtered):
          type of 'rte_flow_action* actions' changed:
            in pointed to type 'struct rte_flow_action' at
rte_flow.h:3775:1:
              type size hasn't changed
              1 data member change:
                type of 'rte_flow_action_type type' changed:
                  type size hasn't changed
                  1 enumerator insertion:

'rte_flow_action_type::RTE_FLOW_ACTION_TYPE_SKIP_CMAN' value '8'
                  50 enumerator changes:
                    'rte_flow_action_type::RTE_FLOW_ACTION_TYPE_COUNT'
from value '8' to '9' at rte_flow.h:2216:1
                    ...

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-11  0:35           ` Ferruh Yigit
@ 2023-02-11  5:16             ` Jerin Jacob
  0 siblings, 0 replies; 70+ messages in thread
From: Jerin Jacob @ 2023-02-11  5:16 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko,
	jerinj, ndabilpuram, dev, David Marchand

On Sat, Feb 11, 2023 at 6:05 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> > index b60987db4b..f4eb4232d4 100644
> > --- a/lib/ethdev/rte_flow.h
> > +++ b/lib/ethdev/rte_flow.h
> > @@ -2203,6 +2203,17 @@ enum rte_flow_action_type {
> >        */
> >       RTE_FLOW_ACTION_TYPE_DROP,
> >
> > +     /**
> > +      * Skip congestion management configuration
> > +      *
> > +      * Using rte_eth_cman_config_set() API the application
> > +      * can configure ethdev Rx queue's congestion mechanism.
> > +      * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> > +      * congestion configuration applied to the given ethdev Rx queue.
> > +      *
> > +      */
> > +     RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
> > +
>
> Inserting new enum item in to the middle of the enum upsets the ABI
> checks [1], can it go to the end?

Yes.

>
>
>
>
> [1]
> 1 function with some indirect sub-type change:
>
>   [C] 'function size_t rte_flow_copy(rte_flow_desc*, size_t, const
> rte_flow_attr*, const rte_flow_item*, const rte_flow_action*)' at
> rte_flow.c:1092:1 has some indirect sub-type changes:
>     parameter 1 of type 'rte_flow_desc*' has sub-type changes:
>       in pointed to type 'struct rte_flow_desc' at rte_flow.h:4326:1:
>         type size hasn't changed
>         1 data member changes (1 filtered):
>           type of 'rte_flow_action* actions' changed:
>             in pointed to type 'struct rte_flow_action' at
> rte_flow.h:3775:1:
>               type size hasn't changed
>               1 data member change:
>                 type of 'rte_flow_action_type type' changed:
>                   type size hasn't changed
>                   1 enumerator insertion:
>
> 'rte_flow_action_type::RTE_FLOW_ACTION_TYPE_SKIP_CMAN' value '8'
>                   50 enumerator changes:
>                     'rte_flow_action_type::RTE_FLOW_ACTION_TYPE_COUNT'
> from value '8' to '9' at rte_flow.h:2216:1
>                     ...

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v7 1/3] ethdev: skip congestion management configuration
  2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
                             ` (4 preceding siblings ...)
  2023-02-11  0:35           ` Ferruh Yigit
@ 2023-02-12  9:00           ` Rakesh Kudurumalla
  2023-02-12  9:00             ` [PATCH v7 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                               ` (2 more replies)
  5 siblings, 3 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-12  9:00 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
v7: Moved skip_cman macro to the end
 doc/guides/nics/features/default.ini |  1 +
 doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h                | 11 +++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 510cc6679d..b93f053a2b 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -198,6 +198,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..4efadcc87b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..6ab632df9d 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2736,6 +2736,17 @@ enum rte_flow_action_type {
 	 * No associated configuration structure.
 	 */
 	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
+
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v7 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
@ 2023-02-12  9:00             ` Rakesh Kudurumalla
  2023-02-12  9:00             ` [PATCH v7 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-12  9:00 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v7 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
  2023-02-12  9:00             ` [PATCH v7 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-12  9:00             ` Rakesh Kudurumalla
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-12  9:00 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini    |  1 +
 doc/guides/nics/features/cnxk_vf.ini |  1 +
 drivers/net/cnxk/cnxk_ethdev.h       |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c   | 50 ++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-10 23:10           ` Ferruh Yigit
@ 2023-02-13 12:34             ` Ori Kam
  2023-02-13 13:54               ` Ferruh Yigit
  0 siblings, 1 reply; 70+ messages in thread
From: Ori Kam @ 2023-02-13 12:34 UTC (permalink / raw)
  To: Ferruh Yigit, Rakesh Kudurumalla,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Saturday, 11 February 2023 1:10
> 
> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> > Introduce new flow action to skip congestion management configuration
> > This feature helps to skip the congestion management processing
> > based on per flow or the packet color identified by
> > rte_flow meter object. For example, If one Rx queue configured as
> > RED congestion and application wants tobypass the RED congestion
> > processing for all GREEN color packet can be expressed though
> > RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> >
> > Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> > Acked-by: Ori Kam <orika@nvidia.com>
> > ---
> > v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
> >  doc/guides/nics/features/default.ini |  1 +
> >  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
> >  lib/ethdev/rte_flow.h                | 11 +++++++++++
> 
> Should the release notes needs to be updated for this?

Yes, I think so it is a new rte_flow action

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-13 12:34             ` Ori Kam
@ 2023-02-13 13:54               ` Ferruh Yigit
  2023-02-13 15:44                 ` Jerin Jacob
  0 siblings, 1 reply; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-13 13:54 UTC (permalink / raw)
  To: Ori Kam, Rakesh Kudurumalla,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Andrew Rybchenko, jerinj
  Cc: ndabilpuram, dev

On 2/13/2023 12:34 PM, Ori Kam wrote:
> 
> 
>> -----Original Message-----
>> From: Ferruh Yigit <ferruh.yigit@amd.com>
>> Sent: Saturday, 11 February 2023 1:10
>>
>> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
>>> Introduce new flow action to skip congestion management configuration
>>> This feature helps to skip the congestion management processing
>>> based on per flow or the packet color identified by
>>> rte_flow meter object. For example, If one Rx queue configured as
>>> RED congestion and application wants tobypass the RED congestion
>>> processing for all GREEN color packet can be expressed though
>>> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
>>>
>>> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>>> Acked-by: Ori Kam <orika@nvidia.com>
>>> ---
>>> v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
>>>  doc/guides/nics/features/default.ini |  1 +
>>>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
>>>  lib/ethdev/rte_flow.h                | 11 +++++++++++
>>
>> Should the release notes needs to be updated for this?
> 
> Yes, I think so it is a new rte_flow action

Hi Jerin, what do you think about this?

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-13 13:54               ` Ferruh Yigit
@ 2023-02-13 15:44                 ` Jerin Jacob
  2023-02-13 15:53                   ` Ferruh Yigit
  0 siblings, 1 reply; 70+ messages in thread
From: Jerin Jacob @ 2023-02-13 15:44 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Ori Kam, Rakesh Kudurumalla,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Andrew Rybchenko, jerinj, ndabilpuram, dev

On Mon, Feb 13, 2023 at 7:25 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 2/13/2023 12:34 PM, Ori Kam wrote:
> >
> >
> >> -----Original Message-----
> >> From: Ferruh Yigit <ferruh.yigit@amd.com>
> >> Sent: Saturday, 11 February 2023 1:10
> >>
> >> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
> >>> Introduce new flow action to skip congestion management configuration
> >>> This feature helps to skip the congestion management processing
> >>> based on per flow or the packet color identified by
> >>> rte_flow meter object. For example, If one Rx queue configured as
> >>> RED congestion and application wants tobypass the RED congestion
> >>> processing for all GREEN color packet can be expressed though
> >>> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> >>>
> >>> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> >>> Acked-by: Ori Kam <orika@nvidia.com>
> >>> ---
> >>> v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
> >>>  doc/guides/nics/features/default.ini |  1 +
> >>>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
> >>>  lib/ethdev/rte_flow.h                | 11 +++++++++++
> >>
> >> Should the release notes needs to be updated for this?
> >
> > Yes, I think so it is a new rte_flow action
>
> Hi Jerin, what do you think about this?

Yes. Rakesh already send a new version with this change. Thanks.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 1/3] ethdev: skip congestion management configuration
  2023-02-13 15:44                 ` Jerin Jacob
@ 2023-02-13 15:53                   ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-13 15:53 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Ori Kam, Rakesh Kudurumalla,
	NBU-Contact-Thomas Monjalon (EXTERNAL),
	Andrew Rybchenko, jerinj, ndabilpuram, dev

On 2/13/2023 3:44 PM, Jerin Jacob wrote:
> On Mon, Feb 13, 2023 at 7:25 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>>
>> On 2/13/2023 12:34 PM, Ori Kam wrote:
>>>
>>>
>>>> -----Original Message-----
>>>> From: Ferruh Yigit <ferruh.yigit@amd.com>
>>>> Sent: Saturday, 11 February 2023 1:10
>>>>
>>>> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
>>>>> Introduce new flow action to skip congestion management configuration
>>>>> This feature helps to skip the congestion management processing
>>>>> based on per flow or the packet color identified by
>>>>> rte_flow meter object. For example, If one Rx queue configured as
>>>>> RED congestion and application wants tobypass the RED congestion
>>>>> processing for all GREEN color packet can be expressed though
>>>>> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
>>>>>
>>>>> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>>>>> Acked-by: Ori Kam <orika@nvidia.com>
>>>>> ---
>>>>> v6: Moved cnxk.ini and cnxk_vf.ini to cnxk specific patch
>>>>>  doc/guides/nics/features/default.ini |  1 +
>>>>>  doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
>>>>>  lib/ethdev/rte_flow.h                | 11 +++++++++++
>>>>
>>>> Should the release notes needs to be updated for this?
>>>
>>> Yes, I think so it is a new rte_flow action
>>
>> Hi Jerin, what do you think about this?
> 
> Yes. Rakesh already send a new version with this change. Thanks.


v7 doesn't have release notes update, that is why I am pinging again.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v8 1/4] ethdev: skip congestion management configuration
  2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
  2023-02-12  9:00             ` [PATCH v7 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-12  9:00             ` [PATCH v7 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-14 13:04             ` Rakesh Kudurumalla
  2023-02-14 13:04               ` [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                                 ` (4 more replies)
  2 siblings, 5 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-14 13:04 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
v8: updated release notes
 doc/guides/nics/features/default.ini |  1 +
 doc/guides/prog_guide/rte_flow.rst   | 22 ++++++++++++++++++++++
 lib/ethdev/rte_flow.h                | 11 +++++++++++
 3 files changed, 34 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 510cc6679d..b93f053a2b 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -198,6 +198,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..4efadcc87b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..6ab632df9d 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2736,6 +2736,17 @@ enum rte_flow_action_type {
 	 * No associated configuration structure.
 	 */
 	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
+
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
@ 2023-02-14 13:04               ` Rakesh Kudurumalla
  2023-02-14 13:21                 ` Ferruh Yigit
  2023-02-14 13:04               ` [PATCH v8 3/4] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                                 ` (3 subsequent siblings)
  4 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-14 13:04 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v8 3/4] net/cnxk: skip red drop for ingress policer
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2023-02-14 13:04               ` [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-14 13:04               ` Rakesh Kudurumalla
  2023-02-14 13:04               ` [PATCH v8 4/4] doc: update release notes for 23_03.rst Rakesh Kudurumalla
                                 ` (2 subsequent siblings)
  4 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-14 13:04 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini    |  1 +
 doc/guides/nics/features/cnxk_vf.ini |  1 +
 drivers/net/cnxk/cnxk_ethdev.h       |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c   | 50 ++++++++++++++++++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v8 4/4] doc: update release notes for 23_03.rst
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2023-02-14 13:04               ` [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-14 13:04               ` [PATCH v8 3/4] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-14 13:04               ` Rakesh Kudurumalla
  2023-02-14 13:19                 ` Ferruh Yigit
  2023-02-14 13:13               ` [PATCH v8 1/4] ethdev: skip congestion management configuration Ferruh Yigit
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
  4 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-14 13:04 UTC (permalink / raw)
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Updated release notes on new action to skip
congestion management configuration

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/rel_notes/release_23_03.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index 1fa101c420..a58e92071c 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -55,6 +55,12 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added support to skip congestion management configuration.**
+
+  Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
+  congestion management processing based on per flow or packet color
+  identified by rte_flow meter object
+
 * **Updated AMD axgbe driver.**
 
   * Added multi-process support.
@@ -72,6 +78,11 @@ New Features
 
   Added support for SHAKE hash algorithm in cn9k and cn10k.
 
+* **Updated Marvell cnxk ethdev PMD.**
+
+  Added support to skip RED using new action
+  ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
+
 * **Updated Intel QuickAssist Technology (QAT) crypto driver.**
 
   * Added support for SHA3 224/256/384/512 plain hash in QAT GEN 3.
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-10 23:08             ` Ferruh Yigit
@ 2023-02-14 13:12               ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-14 13:12 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Aman Singh, Yuying Zhang, jerinj
  Cc: ndabilpuram, dev

On 2/10/2023 11:08 PM, Ferruh Yigit wrote:
> On 2/10/2023 8:26 AM, Rakesh Kudurumalla wrote:
>> added support for testpmd application to accept
>> skip_cman action while configuring policy action
>>
> 
> Can you please give some sample testpmd commands with new action in
> commit log, it helps.
> 

reminder of this comment, v8 doesn't have this.

please check following as sample:
"app/testpmd: add shared indirect action support"
https://git.dpdk.org/next/dpdk-next-net/commit/?id=c13f2654cd3c67e526be0

>> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
>> ---
>>  app/test-pmd/cmdline_flow.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
>> index 88108498e0..fc003e0096 100644
>> --- a/app/test-pmd/cmdline_flow.c
>> +++ b/app/test-pmd/cmdline_flow.c
>> @@ -472,6 +472,7 @@ enum index {
>>  	ACTION_END,
>>  	ACTION_VOID,
>>  	ACTION_PASSTHRU,
>> +	ACTION_SKIP_CMAN,
>>  	ACTION_JUMP,
>>  	ACTION_JUMP_GROUP,
>>  	ACTION_MARK,
>> @@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
>>  	ACTION_END,
>>  	ACTION_VOID,
>>  	ACTION_PASSTHRU,
>> +	ACTION_SKIP_CMAN,
>>  	ACTION_JUMP,
>>  	ACTION_MARK,
>>  	ACTION_FLAG,
>> @@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
>>  		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
>>  		.call = parse_vc,
>>  	},
>> +	[ACTION_SKIP_CMAN] = {
>> +		.name = "skip_cman",
>> +		.help = "bypass cman on received packets",
>> +		.priv = PRIV_ACTION(SKIP_CMAN, 0),
>> +		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
>> +		.call = parse_vc,
>> +	},
>>  	[ACTION_JUMP] = {
>>  		.name = "jump",
>>  		.help = "redirect traffic to a given group",
> 


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v8 1/4] ethdev: skip congestion management configuration
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
                                 ` (2 preceding siblings ...)
  2023-02-14 13:04               ` [PATCH v8 4/4] doc: update release notes for 23_03.rst Rakesh Kudurumalla
@ 2023-02-14 13:13               ` Ferruh Yigit
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
  4 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-14 13:13 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev

On 2/14/2023 1:04 PM, Rakesh Kudurumalla wrote:
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>

Jerin also acked the patch, please include that too.

^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v8 4/4] doc: update release notes for 23_03.rst
  2023-02-14 13:04               ` [PATCH v8 4/4] doc: update release notes for 23_03.rst Rakesh Kudurumalla
@ 2023-02-14 13:19                 ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-14 13:19 UTC (permalink / raw)
  To: Rakesh Kudurumalla; +Cc: jerinj, ndabilpuram, dev

On 2/14/2023 1:04 PM, Rakesh Kudurumalla wrote:
> Updated release notes on new action to skip
> congestion management configuration
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

please distribute this patch to relevant patches, like flow api update
can go into first patch (ethdev one), driver update to the one that
updates driver.

No need to have a separate patch for release updates.

> ---
>  doc/guides/rel_notes/release_23_03.rst | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
> index 1fa101c420..a58e92071c 100644
> --- a/doc/guides/rel_notes/release_23_03.rst
> +++ b/doc/guides/rel_notes/release_23_03.rst
> @@ -55,6 +55,12 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =======================================================
>  
> +* **Added support to skip congestion management configuration.**
> +
> +  Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
> +  congestion management processing based on per flow or packet color
> +  identified by rte_flow meter object
> +

Can you please rebase on latest next-net, this part is different in
latest head?

Also there are a few other flow api related release notes updates, can
you please keep the note similar to existing ones?

>  * **Updated AMD axgbe driver.**
>  
>    * Added multi-process support.
> @@ -72,6 +78,11 @@ New Features
>  
>    Added support for SHAKE hash algorithm in cn9k and cn10k.
>  
> +* **Updated Marvell cnxk ethdev PMD.**
> +
> +  Added support to skip RED using new action
> +  ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
> +
>  * **Updated Intel QuickAssist Technology (QAT) crypto driver.**
>  
>    * Added support for SHA3 224/256/384/512 plain hash in QAT GEN 3.


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd
  2023-02-14 13:04               ` [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-14 13:21                 ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-14 13:21 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev

On 2/14/2023 1:04 PM, Rakesh Kudurumalla wrote:
> added support for testpmd application to accept
> skip_cman action while configuring policy action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
>  app/test-pmd/cmdline_flow.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 88108498e0..fc003e0096 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -472,6 +472,7 @@ enum index {
>  	ACTION_END,
>  	ACTION_VOID,
>  	ACTION_PASSTHRU,
> +	ACTION_SKIP_CMAN,
>  	ACTION_JUMP,
>  	ACTION_JUMP_GROUP,
>  	ACTION_MARK,
> @@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
>  	ACTION_END,
>  	ACTION_VOID,
>  	ACTION_PASSTHRU,
> +	ACTION_SKIP_CMAN,
>  	ACTION_JUMP,
>  	ACTION_MARK,
>  	ACTION_FLAG,
> @@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
>  		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
>  		.call = parse_vc,
>  	},
> +	[ACTION_SKIP_CMAN] = {
> +		.name = "skip_cman",
> +		.help = "bypass cman on received packets",
> +		.priv = PRIV_ACTION(SKIP_CMAN, 0),
> +		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
> +		.call = parse_vc,
> +	},
>  	[ACTION_JUMP] = {
>  		.name = "jump",
>  		.help = "redirect traffic to a given group",

Hi Ori,

any objection to this patch?

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v9 1/3] ethdev: skip congestion management configuration
  2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
                                 ` (3 preceding siblings ...)
  2023-02-14 13:13               ` [PATCH v8 1/4] ethdev: skip congestion management configuration Ferruh Yigit
@ 2023-02-15  6:25               ` Rakesh Kudurumalla
  2023-02-15  6:25                 ` [PATCH v9 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                                   ` (3 more replies)
  4 siblings, 4 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15  6:25 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
v9: Distributed doc updates to relevant patches

 doc/guides/nics/features/default.ini   |  1 +
 doc/guides/prog_guide/rte_flow.rst     | 22 ++++++++++++++++++++++
 doc/guides/rel_notes/release_23_03.rst |  6 ++++++
 lib/ethdev/rte_flow.h                  | 11 +++++++++++
 4 files changed, 40 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 510cc6679d..b93f053a2b 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -198,6 +198,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 3e6242803d..4efadcc87b 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1840,6 +1840,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index bf90feba68..1dd10e26db 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -60,6 +60,12 @@ New Features
   Added lock annotations attributes so that clang can statically analyze lock
   correctness.
 
+* **Added support to skip congestion management configuration.**
+
+  Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
+  congestion management processing based on per flow or packet color
+  identified by rte_flow meter object
+
 * **Updated AMD axgbe driver.**
 
   * Added multi-process support.
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index b60987db4b..6ab632df9d 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2736,6 +2736,17 @@ enum rte_flow_action_type {
 	 * No associated configuration structure.
 	 */
 	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
+
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v9 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
@ 2023-02-15  6:25                 ` Rakesh Kudurumalla
  2023-02-15  6:25                 ` [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15  6:25 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 88108498e0..fc003e0096 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -472,6 +472,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1825,6 +1826,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5159,6 +5161,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
  2023-02-15  6:25                 ` [PATCH v9 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-15  6:25                 ` Rakesh Kudurumalla
  2023-02-15  9:45                   ` Ferruh Yigit
  2023-02-15 10:00                   ` Nithin Kumar Dabilpuram
  2023-02-15  9:43                 ` [PATCH v9 1/3] ethdev: skip congestion management configuration Ferruh Yigit
  2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
  3 siblings, 2 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15  6:25 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 doc/guides/nics/features/cnxk.ini      |  1 +
 doc/guides/nics/features/cnxk_vf.ini   |  1 +
 doc/guides/rel_notes/release_23_03.rst |  4 +++
 drivers/net/cnxk/cnxk_ethdev.h         |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c     | 50 ++++++++++++++++++++++++++
 5 files changed, 57 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index 1dd10e26db..9f53ded5fb 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -98,6 +98,10 @@ New Features
     ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter
     required for eth_rx, eth_tx, crypto and timer eventdev adapters.
 
+* **Updated Marvell cnxk ethdev PMD.**
+
+  Added support to skip RED using new action
+  ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
 
 Removed Items
 -------------
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v9 1/3] ethdev: skip congestion management configuration
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
  2023-02-15  6:25                 ` [PATCH v9 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-15  6:25                 ` [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-15  9:43                 ` Ferruh Yigit
  2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
  3 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-15  9:43 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev

On 2/15/2023 6:25 AM, Rakesh Kudurumalla wrote:
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>
> ---
> v9: Distributed doc updates to relevant patches
> 
>  doc/guides/nics/features/default.ini   |  1 +
>  doc/guides/prog_guide/rte_flow.rst     | 22 ++++++++++++++++++++++
>  doc/guides/rel_notes/release_23_03.rst |  6 ++++++
>  lib/ethdev/rte_flow.h                  | 11 +++++++++++
>  4 files changed, 40 insertions(+)
> 
> diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
> index 510cc6679d..b93f053a2b 100644
> --- a/doc/guides/nics/features/default.ini
> +++ b/doc/guides/nics/features/default.ini
> @@ -198,6 +198,7 @@ set_tag              =
>  set_tp_dst           =
>  set_tp_src           =
>  set_ttl              =
> +skip_cman            =
>  vf                   =
>  vxlan_decap          =
>  vxlan_encap          =
> diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
> index 3e6242803d..4efadcc87b 100644
> --- a/doc/guides/prog_guide/rte_flow.rst
> +++ b/doc/guides/prog_guide/rte_flow.rst
> @@ -1840,6 +1840,28 @@ Drop packets.
>     | no properties |
>     +---------------+
>  
> +
> +Action: ``SKIP_CMAN``
> +^^^^^^^^^^^^^^^^^^^^^
> +
> +Skip congestion management on received packets
> +
> +- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
> +  queue's congestion mechanism.Once applied packets congestion configuration
> +  is bypassed on that particular ethdev Rx queue for all packets directed
> +  to that receive queue
> +
> +.. _table_rte_flow_action_skip_cman:
> +
> +.. table:: SKIP_CMAN
> +
> +   +---------------+
> +   | Field         |
> +   +===============+
> +   | no properties |
> +   +---------------+
> +
> +
>  Action: ``COUNT``
>  ^^^^^^^^^^^^^^^^^
>  
> diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
> index bf90feba68..1dd10e26db 100644
> --- a/doc/guides/rel_notes/release_23_03.rst
> +++ b/doc/guides/rel_notes/release_23_03.rst
> @@ -60,6 +60,12 @@ New Features
>    Added lock annotations attributes so that clang can statically analyze lock
>    correctness.
>  
> +* **Added support to skip congestion management configuration.**
> +
> +  Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
> +  congestion management processing based on per flow or packet color
> +  identified by rte_flow meter object
> +

Can you please rebase on next-net [1], there you will see other flow API
entries?


[1]
https://dpdk.org/git/next/dpdk-next-net

>  * **Updated AMD axgbe driver.**
>  
>    * Added multi-process support.
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index b60987db4b..6ab632df9d 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -2736,6 +2736,17 @@ enum rte_flow_action_type {
>  	 * No associated configuration structure.
>  	 */
>  	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
> +
> +	/**
> +	 * Skip congestion management configuration
> +	 *
> +	 * Using rte_eth_cman_config_set() API the application
> +	 * can configure ethdev Rx queue's congestion mechanism.
> +	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
> +	 * congestion configuration applied to the given ethdev Rx queue.
> +	 *
> +	 */
> +	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
>  };
>  
>  /**


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-15  6:25                 ` [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-15  9:45                   ` Ferruh Yigit
  2023-02-15 10:00                   ` Nithin Kumar Dabilpuram
  1 sibling, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-15  9:45 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev

On 2/15/2023 6:25 AM, Rakesh Kudurumalla wrote:
> Dropping of packets is based on action configured
> to meter.If both skip_red and drop actions are configured
> then tail dropping in invoked else if only drop action is
> configured then RED drop is invoked.This action is supported
> only when RED is configured using rte_eth_cman_config_set()
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

Ack from driver maintainers required to proceed.

> ---
>  doc/guides/nics/features/cnxk.ini      |  1 +
>  doc/guides/nics/features/cnxk_vf.ini   |  1 +
>  doc/guides/rel_notes/release_23_03.rst |  4 +++
>  drivers/net/cnxk/cnxk_ethdev.h         |  1 +
>  drivers/net/cnxk/cnxk_ethdev_mtr.c     | 50 ++++++++++++++++++++++++++
>  5 files changed, 57 insertions(+)
> 
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index f81628da77..7947c044bb 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -94,4 +94,5 @@ queue                = Y
>  represented_port     = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y
> diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
> index c4ee32a9ad..873e1dcc0a 100644
> --- a/doc/guides/nics/features/cnxk_vf.ini
> +++ b/doc/guides/nics/features/cnxk_vf.ini
> @@ -83,4 +83,5 @@ pf                   = Y
>  queue                = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y
> diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
> index 1dd10e26db..9f53ded5fb 100644
> --- a/doc/guides/rel_notes/release_23_03.rst
> +++ b/doc/guides/rel_notes/release_23_03.rst
> @@ -98,6 +98,10 @@ New Features
>      ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter
>      required for eth_rx, eth_tx, crypto and timer eventdev adapters.
>  
> +* **Updated Marvell cnxk ethdev PMD.**
> +
> +  Added support to skip RED using new action
> +  ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
>  

Can you please move this entry alphabetically ordered by vendor to the
block where has ethdev drivers, a little above in this section.


>  Removed Items
>  -------------
> diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
> index f0eab4244c..ba35873124 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.h
> +++ b/drivers/net/cnxk/cnxk_ethdev.h
> @@ -168,6 +168,7 @@ struct policy_actions {
>  		uint16_t queue;
>  		uint32_t mtr_id;
>  		struct action_rss *rss_desc;
> +		bool skip_red;
>  	};
>  };
>  
> diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> index dcfa4223d5..27a6e4ef3d 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> @@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
>  				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
>  					supported[i] = true;
>  
> +				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +					supported[i] = true;
> +
>  				if (!supported[i])
>  					return update_mtr_err(i, error, true);
>  			}
> @@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
>  					fmp->actions[i].action_fate =
>  						action->type;
>  				}
> +
> +				if (action->type ==
> +					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +					fmp->actions[i].skip_red = true;
>  			}
>  		}
>  	}
> @@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
>  		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
>  }
>  
> +static void
> +nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
> +		   struct roc_nix_bpf_cfg *cfg)
> +{
> +	struct cnxk_mtr_policy_node *policy = mtr->policy;
> +
> +	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
> +	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
> +	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
> +		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_GREEN].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +		if (policy->actions[RTE_COLOR_RED].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_RED].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +	}
> +}
> +
>  static void
>  nix_precolor_table_map(struct cnxk_meter_node *mtr,
>  		       struct roc_nix_bpf_precolor *tbl,
> @@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
>  			if (!mtr[i]->is_used) {
>  				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
>  				nix_mtr_config_map(mtr[i], &cfg);
> +				for (j = 0; j < mtr[i]->rq_num; j++) {
> +					rq = &dev->rqs[mtr[i]->rq_id[j]];
> +					nix_mtr_config_red(mtr[i], rq, &cfg);
> +				}
>  				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
>  							lvl_map[mtr[i]->level],
>  							&cfg);


^ permalink raw reply	[flat|nested] 70+ messages in thread

* RE: [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-15  6:25                 ` [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
  2023-02-15  9:45                   ` Ferruh Yigit
@ 2023-02-15 10:00                   ` Nithin Kumar Dabilpuram
  1 sibling, 0 replies; 70+ messages in thread
From: Nithin Kumar Dabilpuram @ 2023-02-15 10:00 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Kiran Kumar Kokkilagadda, Sunil Kumar Kori,
	Satha Koteswara Rao Kottidi
  Cc: Jerin Jacob Kollanukkaran, dev, Rakesh Kudurumalla

Acked-by:  Nithin Dabilpuram<ndabilpuram@marvell.com>

> -----Original Message-----
> From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Sent: Wednesday, February 15, 2023 11:56 AM
> To: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha Koteswara Rao
> Kottidi <skoteshwar@marvell.com>
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; dev@dpdk.org; Rakesh Kudurumalla
> <rkudurumalla@marvell.com>
> Subject: [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer
> 
> Dropping of packets is based on action configured
> to meter.If both skip_red and drop actions are configured
> then tail dropping in invoked else if only drop action is
> configured then RED drop is invoked.This action is supported
> only when RED is configured using rte_eth_cman_config_set()
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> ---
>  doc/guides/nics/features/cnxk.ini      |  1 +
>  doc/guides/nics/features/cnxk_vf.ini   |  1 +
>  doc/guides/rel_notes/release_23_03.rst |  4 +++
>  drivers/net/cnxk/cnxk_ethdev.h         |  1 +
>  drivers/net/cnxk/cnxk_ethdev_mtr.c     | 50 ++++++++++++++++++++++++++
>  5 files changed, 57 insertions(+)
> 
> diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
> index f81628da77..7947c044bb 100644
> --- a/doc/guides/nics/features/cnxk.ini
> +++ b/doc/guides/nics/features/cnxk.ini
> @@ -94,4 +94,5 @@ queue                = Y
>  represented_port     = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y
> diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
> index c4ee32a9ad..873e1dcc0a 100644
> --- a/doc/guides/nics/features/cnxk_vf.ini
> +++ b/doc/guides/nics/features/cnxk_vf.ini
> @@ -83,4 +83,5 @@ pf                   = Y
>  queue                = Y
>  rss                  = Y
>  security             = Y
> +skip_cman            = Y
>  vf                   = Y
> diff --git a/doc/guides/rel_notes/release_23_03.rst
> b/doc/guides/rel_notes/release_23_03.rst
> index 1dd10e26db..9f53ded5fb 100644
> --- a/doc/guides/rel_notes/release_23_03.rst
> +++ b/doc/guides/rel_notes/release_23_03.rst
> @@ -98,6 +98,10 @@ New Features
>      ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter
>      required for eth_rx, eth_tx, crypto and timer eventdev adapters.
> 
> +* **Updated Marvell cnxk ethdev PMD.**
> +
> +  Added support to skip RED using new action
> +  ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
> 
>  Removed Items
>  -------------
> diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
> index f0eab4244c..ba35873124 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.h
> +++ b/drivers/net/cnxk/cnxk_ethdev.h
> @@ -168,6 +168,7 @@ struct policy_actions {
>  		uint16_t queue;
>  		uint32_t mtr_id;
>  		struct action_rss *rss_desc;
> +		bool skip_red;
>  	};
>  };
> 
> diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> index dcfa4223d5..27a6e4ef3d 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
> @@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
>  				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
>  					supported[i] = true;
> 
> +				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +					supported[i] = true;
> +
>  				if (!supported[i])
>  					return update_mtr_err(i, error, true);
>  			}
> @@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
>  					fmp->actions[i].action_fate =
>  						action->type;
>  				}
> +
> +				if (action->type ==
> +					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
> +					fmp->actions[i].skip_red = true;
>  			}
>  		}
>  	}
> @@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct
> roc_nix_bpf_cfg *cfg)
>  		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
>  }
> 
> +static void
> +nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
> +		   struct roc_nix_bpf_cfg *cfg)
> +{
> +	struct cnxk_mtr_policy_node *policy = mtr->policy;
> +
> +	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
> +	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
> +	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
> +		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_GREEN].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +		if (policy->actions[RTE_COLOR_RED].action_fate ==
> +			RTE_FLOW_ACTION_TYPE_DROP) {
> +			if (policy->actions[RTE_COLOR_RED].skip_red)
> +				cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +						ROC_NIX_BPF_ACTION_DROP;
> +			else
> +				cfg->action[ROC_NIX_BPF_COLOR_RED] =
> +						ROC_NIX_BPF_ACTION_RED;
> +		}
> +	}
> +}
> +
>  static void
>  nix_precolor_table_map(struct cnxk_meter_node *mtr,
>  		       struct roc_nix_bpf_precolor *tbl,
> @@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
>  			if (!mtr[i]->is_used) {
>  				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
>  				nix_mtr_config_map(mtr[i], &cfg);
> +				for (j = 0; j < mtr[i]->rq_num; j++) {
> +					rq = &dev->rqs[mtr[i]->rq_id[j]];
> +					nix_mtr_config_red(mtr[i], rq, &cfg);
> +				}
>  				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
>  							lvl_map[mtr[i]->level],
>  							&cfg);
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v10 1/3] ethdev: skip congestion management configuration
  2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
                                   ` (2 preceding siblings ...)
  2023-02-15  9:43                 ` [PATCH v9 1/3] ethdev: skip congestion management configuration Ferruh Yigit
@ 2023-02-15 17:42                 ` Rakesh Kudurumalla
  2023-02-15 17:42                   ` [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                                     ` (2 more replies)
  3 siblings, 3 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15 17:42 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
v10: Rebased on top of dpdk-next-net

 doc/guides/nics/features/default.ini   |  1 +
 doc/guides/prog_guide/rte_flow.rst     | 22 ++++++++++++++++++++++
 doc/guides/rel_notes/release_23_03.rst |  6 ++++++
 lib/ethdev/rte_flow.h                  | 11 +++++++++++
 4 files changed, 40 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 976a020985..49e41b8002 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -200,6 +200,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 161c5dce53..76045386ba 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1832,6 +1832,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index ad23355e54..286cffab95 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -97,6 +97,12 @@ New Features
     ``rte_flow_configure``.
   * Added ``host_port_id`` to ``rte_flow_port_attr`` structure.
 
+* **Added support to skip congestion management configuration.**
+
+  * Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
+    congestion management processing based on per flow or packet color
+    identified by rte_flow meter object
+
 * **Updated AMD axgbe driver.**
 
   * Added multi-process support.
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 6a51442b8c..069b2210f1 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2820,6 +2820,17 @@ enum rte_flow_action_type {
 	 * No associated configuration structure.
 	 */
 	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
+
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
@ 2023-02-15 17:42                   ` Rakesh Kudurumalla
  2023-02-16 12:19                     ` Ferruh Yigit
  2023-02-15 17:42                   ` [PATCH v10 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
  2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2 siblings, 1 reply; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15 17:42 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 63a0b36622..e4b17aa22d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -488,6 +488,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1896,6 +1897,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5385,6 +5387,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v10 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
  2023-02-15 17:42                   ` [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-15 17:42                   ` Rakesh Kudurumalla
  2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-15 17:42 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 doc/guides/nics/features/cnxk.ini      |  1 +
 doc/guides/nics/features/cnxk_vf.ini   |  1 +
 doc/guides/rel_notes/release_23_03.rst |  5 +++
 drivers/net/cnxk/cnxk_ethdev.h         |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c     | 50 ++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index 286cffab95..51bffc13e5 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -116,6 +116,11 @@ New Features
   * Added support for meter options.
   * Added support for rte_flow meter action.
 
+* **Updated Marvell cnxk ethdev PMD.**
+
+  * Added support to skip RED using new action
+    ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
+
 * **Updated Mellanox mlx5 driver.**
 
   * Added support for matching on ICMPv6 ID and sequence fields.
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-15 17:42                   ` [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-16 12:19                     ` Ferruh Yigit
  0 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-16 12:19 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev

On 2/15/2023 5:42 PM, Rakesh Kudurumalla wrote:
> added support for testpmd application to accept
> skip_cman action while configuring policy action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>

A comment seems missed, please check v6 & v8 [1], can you please send a
new version with it?

[1]
https://inbox.dpdk.org/dev/67c958be-09e7-5c70-9a59-d471daeab4e8@amd.com/

^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v11 1/3] ethdev: skip congestion management configuration
  2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
  2023-02-15 17:42                   ` [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-15 17:42                   ` [PATCH v10 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-16 14:51                   ` Rakesh Kudurumalla
  2023-02-16 14:51                     ` [PATCH v11 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
                                       ` (2 more replies)
  2 siblings, 3 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-16 14:51 UTC (permalink / raw)
  To: Ferruh Yigit, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

Introduce new flow action to skip congestion management configuration
This feature helps to skip the congestion management processing
based on per flow or the packet color identified by
rte_flow meter object. For example, If one Rx queue configured as
RED congestion and application wants tobypass the RED congestion
processing for all GREEN color packet can be expressed though
RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
v11: Updated sample command to apply
     congestion configuration with dpdk-testpmd application
 doc/guides/nics/features/default.ini   |  1 +
 doc/guides/prog_guide/rte_flow.rst     | 22 ++++++++++++++++++++++
 doc/guides/rel_notes/release_23_03.rst |  6 ++++++
 lib/ethdev/rte_flow.h                  | 11 +++++++++++
 4 files changed, 40 insertions(+)

diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini
index 976a020985..49e41b8002 100644
--- a/doc/guides/nics/features/default.ini
+++ b/doc/guides/nics/features/default.ini
@@ -200,6 +200,7 @@ set_tag              =
 set_tp_dst           =
 set_tp_src           =
 set_ttl              =
+skip_cman            =
 vf                   =
 vxlan_decap          =
 vxlan_encap          =
diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst
index 8ad01ef05c..6b412e8585 100644
--- a/doc/guides/prog_guide/rte_flow.rst
+++ b/doc/guides/prog_guide/rte_flow.rst
@@ -1832,6 +1832,28 @@ Drop packets.
    | no properties |
    +---------------+
 
+
+Action: ``SKIP_CMAN``
+^^^^^^^^^^^^^^^^^^^^^
+
+Skip congestion management on received packets
+
+- Using ``rte_eth_cman_config_set()``, application can configure ethdev Rx
+  queue's congestion mechanism.Once applied packets congestion configuration
+  is bypassed on that particular ethdev Rx queue for all packets directed
+  to that receive queue
+
+.. _table_rte_flow_action_skip_cman:
+
+.. table:: SKIP_CMAN
+
+   +---------------+
+   | Field         |
+   +===============+
+   | no properties |
+   +---------------+
+
+
 Action: ``COUNT``
 ^^^^^^^^^^^^^^^^^
 
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index 2ca30b3b49..39085a19a1 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -98,6 +98,12 @@ New Features
   * Added ``host_port_id`` in ``rte_flow_port_attr`` structure
     to reference the port hosting the shared objects.
 
+* **Added support to skip congestion management configuration.**
+
+  * Added a new action ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN`` to skip
+    congestion management processing based on per flow or packet color
+    identified by rte_flow meter object
+
 * **Updated AMD axgbe driver.**
 
   * Added multi-process support.
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index fb984a1097..8b9c0f02c3 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -2820,6 +2820,17 @@ enum rte_flow_action_type {
 	 * No associated configuration structure.
 	 */
 	RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL,
+
+	/**
+	 * Skip congestion management configuration
+	 *
+	 * Using rte_eth_cman_config_set() API the application
+	 * can configure ethdev Rx queue's congestion mechanism.
+	 * Introducing RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action to skip the
+	 * congestion configuration applied to the given ethdev Rx queue.
+	 *
+	 */
+	RTE_FLOW_ACTION_TYPE_SKIP_CMAN,
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v11 2/3] app/testpmd: add skip cman support for testpmd
  2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
@ 2023-02-16 14:51                     ` Rakesh Kudurumalla
  2023-02-16 14:51                     ` [PATCH v11 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
  2023-02-16 16:18                     ` [PATCH v11 1/3] ethdev: skip congestion management configuration Ferruh Yigit
  2 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-16 14:51 UTC (permalink / raw)
  To: Ori Kam, Aman Singh, Yuying Zhang
  Cc: jerinj, ndabilpuram, dev, Rakesh Kudurumalla

added support for testpmd application to accept
skip_cman action while configuring policy action

Below is sample command given after configuring meter
profile for which congestion configuration is applied
for red and yellow color packets and bypassed for
green color packets in dpdk-testpmd application

add port meter policy 0 200 g_actions drop / skip_cman / end
y_actions drop / end r_actions drop / end

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 app/test-pmd/cmdline_flow.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 63a0b36622..e4b17aa22d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -488,6 +488,7 @@ enum index {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_JUMP_GROUP,
 	ACTION_MARK,
@@ -1896,6 +1897,7 @@ static const enum index next_action[] = {
 	ACTION_END,
 	ACTION_VOID,
 	ACTION_PASSTHRU,
+	ACTION_SKIP_CMAN,
 	ACTION_JUMP,
 	ACTION_MARK,
 	ACTION_FLAG,
@@ -5385,6 +5387,13 @@ static const struct token token_list[] = {
 		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
 		.call = parse_vc,
 	},
+	[ACTION_SKIP_CMAN] = {
+		.name = "skip_cman",
+		.help = "bypass cman on received packets",
+		.priv = PRIV_ACTION(SKIP_CMAN, 0),
+		.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+		.call = parse_vc,
+	},
 	[ACTION_JUMP] = {
 		.name = "jump",
 		.help = "redirect traffic to a given group",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* [PATCH v11 3/3] net/cnxk: skip red drop for ingress policer
  2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2023-02-16 14:51                     ` [PATCH v11 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
@ 2023-02-16 14:51                     ` Rakesh Kudurumalla
  2023-02-16 16:18                     ` [PATCH v11 1/3] ethdev: skip congestion management configuration Ferruh Yigit
  2 siblings, 0 replies; 70+ messages in thread
From: Rakesh Kudurumalla @ 2023-02-16 14:51 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: jerinj, dev, Rakesh Kudurumalla

Dropping of packets is based on action configured
to meter.If both skip_red and drop actions are configured
then tail dropping in invoked else if only drop action is
configured then RED drop is invoked.This action is supported
only when RED is configured using rte_eth_cman_config_set()

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 doc/guides/nics/features/cnxk.ini      |  1 +
 doc/guides/nics/features/cnxk_vf.ini   |  1 +
 doc/guides/rel_notes/release_23_03.rst |  5 +++
 drivers/net/cnxk/cnxk_ethdev.h         |  1 +
 drivers/net/cnxk/cnxk_ethdev_mtr.c     | 50 ++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)

diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index f81628da77..7947c044bb 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -94,4 +94,5 @@ queue                = Y
 represented_port     = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/nics/features/cnxk_vf.ini b/doc/guides/nics/features/cnxk_vf.ini
index c4ee32a9ad..873e1dcc0a 100644
--- a/doc/guides/nics/features/cnxk_vf.ini
+++ b/doc/guides/nics/features/cnxk_vf.ini
@@ -83,4 +83,5 @@ pf                   = Y
 queue                = Y
 rss                  = Y
 security             = Y
+skip_cman            = Y
 vf                   = Y
diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst
index 39085a19a1..53d5b1416c 100644
--- a/doc/guides/rel_notes/release_23_03.rst
+++ b/doc/guides/rel_notes/release_23_03.rst
@@ -117,6 +117,11 @@ New Features
   * Added support for meter options.
   * Added support for rte_flow meter action.
 
+* **Updated Marvell cnxk ethdev PMD.**
+
+  * Added support to skip RED using new action
+    ``RTE_FLOW_ACTION_TYPE_SKIP_CMAN``
+
 * **Updated NVIDIA mlx5 driver.**
 
   * Added support for matching on ICMPv6 ID and sequence fields.
diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h
index f0eab4244c..ba35873124 100644
--- a/drivers/net/cnxk/cnxk_ethdev.h
+++ b/drivers/net/cnxk/cnxk_ethdev.h
@@ -168,6 +168,7 @@ struct policy_actions {
 		uint16_t queue;
 		uint32_t mtr_id;
 		struct action_rss *rss_desc;
+		bool skip_red;
 	};
 };
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index dcfa4223d5..27a6e4ef3d 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -358,6 +358,9 @@ cnxk_nix_mtr_policy_validate(struct rte_eth_dev *dev,
 				if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 					supported[i] = true;
 
+				if (action->type == RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					supported[i] = true;
+
 				if (!supported[i])
 					return update_mtr_err(i, error, true);
 			}
@@ -397,6 +400,10 @@ cnxk_fill_policy_actions(struct cnxk_mtr_policy_node *fmp,
 					fmp->actions[i].action_fate =
 						action->type;
 				}
+
+				if (action->type ==
+					RTE_FLOW_ACTION_TYPE_SKIP_CMAN)
+					fmp->actions[i].skip_red = true;
 			}
 		}
 	}
@@ -1306,6 +1313,45 @@ nix_mtr_config_map(struct cnxk_meter_node *mtr, struct roc_nix_bpf_cfg *cfg)
 		cfg->action[ROC_NIX_BPF_COLOR_RED] = ROC_NIX_BPF_ACTION_DROP;
 }
 
+static void
+nix_mtr_config_red(struct cnxk_meter_node *mtr, struct roc_nix_rq *rq,
+		   struct roc_nix_bpf_cfg *cfg)
+{
+	struct cnxk_mtr_policy_node *policy = mtr->policy;
+
+	if ((rq->red_pass && rq->red_pass >= rq->red_drop) ||
+	   (rq->spb_red_pass && rq->spb_red_pass >= rq->spb_red_drop)	||
+	   (rq->xqe_red_pass && rq->xqe_red_pass >= rq->xqe_red_drop)) {
+		if (policy->actions[RTE_COLOR_GREEN].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_GREEN].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_GREEN] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_YELLOW].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_YELLOW].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_YELLOW] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+		if (policy->actions[RTE_COLOR_RED].action_fate ==
+			RTE_FLOW_ACTION_TYPE_DROP) {
+			if (policy->actions[RTE_COLOR_RED].skip_red)
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_DROP;
+			else
+				cfg->action[ROC_NIX_BPF_COLOR_RED] =
+						ROC_NIX_BPF_ACTION_RED;
+		}
+	}
+}
+
 static void
 nix_precolor_table_map(struct cnxk_meter_node *mtr,
 		       struct roc_nix_bpf_precolor *tbl,
@@ -1483,6 +1529,10 @@ nix_mtr_configure(struct rte_eth_dev *eth_dev, uint32_t id)
 			if (!mtr[i]->is_used) {
 				memset(&cfg, 0, sizeof(struct roc_nix_bpf_cfg));
 				nix_mtr_config_map(mtr[i], &cfg);
+				for (j = 0; j < mtr[i]->rq_num; j++) {
+					rq = &dev->rqs[mtr[i]->rq_id[j]];
+					nix_mtr_config_red(mtr[i], rq, &cfg);
+				}
 				rc = roc_nix_bpf_config(nix, mtr[i]->bpf_id,
 							lvl_map[mtr[i]->level],
 							&cfg);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 70+ messages in thread

* Re: [PATCH v11 1/3] ethdev: skip congestion management configuration
  2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
  2023-02-16 14:51                     ` [PATCH v11 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
  2023-02-16 14:51                     ` [PATCH v11 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
@ 2023-02-16 16:18                     ` Ferruh Yigit
  2 siblings, 0 replies; 70+ messages in thread
From: Ferruh Yigit @ 2023-02-16 16:18 UTC (permalink / raw)
  To: Rakesh Kudurumalla, Ori Kam, Thomas Monjalon, Andrew Rybchenko
  Cc: jerinj, ndabilpuram, dev

On 2/16/2023 2:51 PM, Rakesh Kudurumalla wrote:
> Introduce new flow action to skip congestion management configuration
> This feature helps to skip the congestion management processing
> based on per flow or the packet color identified by
> rte_flow meter object. For example, If one Rx queue configured as
> RED congestion and application wants tobypass the RED congestion
> processing for all GREEN color packet can be expressed though
> RTE_FLOW_ACTION_TYPE_SKIP_CMAN flow action
> 
> Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
> Acked-by: Ori Kam <orika@nvidia.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Series applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2023-02-16 16:18 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22  1:39 [PATCH 1/3] lib: dpdk spec to skip red for ingress policer Rakesh Kudurumalla
2022-12-22  1:39 ` [PATCH 2/3] app/testpmd: add skip red for testpmd Rakesh Kudurumalla
2022-12-22  1:39 ` [PATCH 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2022-12-22  3:01 ` [PATCH 1/3] lib: dpdk spec to skip red " Stephen Hemminger
2022-12-22  5:27   ` Jerin Jacob
2022-12-26 17:00     ` Ori Kam
2023-01-10  6:42       ` Rakesh Kudurumalla
2023-01-18  8:09         ` Rakesh Kudurumalla
2023-01-23 13:13           ` Jerin Jacob
2023-01-26 15:13           ` Ori Kam
2023-01-27  6:23             ` Jerin Jacob
2023-02-01 17:49               ` Ori Kam
2023-02-01 18:37                 ` Jerin Jacob
2023-02-02  7:31                   ` Ori Kam
2023-02-06  3:31                     ` Jerin Jacob
2023-01-25  7:32 ` [PATCH v2 1/3] lib: skip congestion management configuration Rakesh Kudurumalla
2023-01-25  7:32   ` [PATCH v2 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-01-25  7:32   ` [PATCH v2 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-01-25  9:26   ` [PATCH v2 1/3] lib: skip congestion management configuration Jerin Jacob
2023-02-09  7:24   ` [PATCH v3 " Rakesh Kudurumalla
2023-02-09  7:24     ` [PATCH v3 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-09  7:24     ` [PATCH v3 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-09  7:31     ` [PATCH v3 1/3] lib: skip congestion management configuration Jerin Jacob
2023-02-09  8:35     ` [PATCH v4 1/3] ethdev: " Rakesh Kudurumalla
2023-02-09  8:35       ` [PATCH v4 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-09  8:35       ` [PATCH v4 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-09 17:14         ` Jerin Jacob
2023-02-09 14:51       ` [PATCH v4 1/3] ethdev: skip congestion management configuration Ori Kam
2023-02-10  8:14       ` [PATCH v5 " Rakesh Kudurumalla
2023-02-10  8:14         ` [PATCH v5 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-10  8:14         ` [PATCH v5 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-10  8:16         ` [PATCH v5 1/3] ethdev: skip congestion management configuration Jerin Jacob
2023-02-10  8:26         ` [PATCH v6 " Rakesh Kudurumalla
2023-02-10  8:26           ` [PATCH v6 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-10 23:08             ` Ferruh Yigit
2023-02-14 13:12               ` Ferruh Yigit
2023-02-10  8:26           ` [PATCH v6 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-10 23:18             ` Ferruh Yigit
2023-02-10  9:27           ` [PATCH v6 1/3] ethdev: skip congestion management configuration Jerin Jacob
2023-02-10 23:10           ` Ferruh Yigit
2023-02-13 12:34             ` Ori Kam
2023-02-13 13:54               ` Ferruh Yigit
2023-02-13 15:44                 ` Jerin Jacob
2023-02-13 15:53                   ` Ferruh Yigit
2023-02-11  0:35           ` Ferruh Yigit
2023-02-11  5:16             ` Jerin Jacob
2023-02-12  9:00           ` [PATCH v7 " Rakesh Kudurumalla
2023-02-12  9:00             ` [PATCH v7 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-12  9:00             ` [PATCH v7 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-14 13:04             ` [PATCH v8 1/4] ethdev: skip congestion management configuration Rakesh Kudurumalla
2023-02-14 13:04               ` [PATCH v8 2/4] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-14 13:21                 ` Ferruh Yigit
2023-02-14 13:04               ` [PATCH v8 3/4] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-14 13:04               ` [PATCH v8 4/4] doc: update release notes for 23_03.rst Rakesh Kudurumalla
2023-02-14 13:19                 ` Ferruh Yigit
2023-02-14 13:13               ` [PATCH v8 1/4] ethdev: skip congestion management configuration Ferruh Yigit
2023-02-15  6:25               ` [PATCH v9 1/3] " Rakesh Kudurumalla
2023-02-15  6:25                 ` [PATCH v9 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-15  6:25                 ` [PATCH v9 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-15  9:45                   ` Ferruh Yigit
2023-02-15 10:00                   ` Nithin Kumar Dabilpuram
2023-02-15  9:43                 ` [PATCH v9 1/3] ethdev: skip congestion management configuration Ferruh Yigit
2023-02-15 17:42                 ` [PATCH v10 " Rakesh Kudurumalla
2023-02-15 17:42                   ` [PATCH v10 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-16 12:19                     ` Ferruh Yigit
2023-02-15 17:42                   ` [PATCH v10 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-16 14:51                   ` [PATCH v11 1/3] ethdev: skip congestion management configuration Rakesh Kudurumalla
2023-02-16 14:51                     ` [PATCH v11 2/3] app/testpmd: add skip cman support for testpmd Rakesh Kudurumalla
2023-02-16 14:51                     ` [PATCH v11 3/3] net/cnxk: skip red drop for ingress policer Rakesh Kudurumalla
2023-02-16 16:18                     ` [PATCH v11 1/3] ethdev: skip congestion management configuration Ferruh Yigit

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