DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Ori Kam <orika@nvidia.com>, Eli Britstein <elibr@nvidia.com>,
	Ilya Maximets <i.maximets@ovn.org>,
	Thomas Monjalon <thomas@monjalon.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Jerin Jacob <jerinj@marvell.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Subject: [PATCH 05/13] net/cnxk: support represented port flow action
Date: Fri, 12 Aug 2022 22:18:19 +0300	[thread overview]
Message-ID: <20220812191827.3187441-6-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20220812191827.3187441-1-ivan.malov@oktetlabs.ru>

There has been support for similar action PORT_ID for
some time already, but this action will be deprecated.
Support action REPRESENTED_PORT before the transition.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 doc/guides/nics/cnxk.rst               | 5 +++++
 doc/guides/nics/features/cnxk.ini      | 1 +
 doc/guides/rel_notes/release_22_11.rst | 4 ++++
 drivers/net/cnxk/cnxk_flow.c           | 9 +++++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/cnxk.rst b/doc/guides/nics/cnxk.rst
index e24eaa8bc4..cbf5f2de54 100644
--- a/doc/guides/nics/cnxk.rst
+++ b/doc/guides/nics/cnxk.rst
@@ -386,6 +386,11 @@ RTE flow GRE support
 - ``RTE_FLOW_ITEM_TYPE_GRE_KEY`` works only when checksum and routing
   bits in the GRE header are equal to 0.
 
+RTE flow action represented_port support
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- ``RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT`` only works between a PF and its VFs.
+
 RTE flow action port_id support
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/doc/guides/nics/features/cnxk.ini b/doc/guides/nics/features/cnxk.ini
index 1876fe86c7..5f14b3be08 100644
--- a/doc/guides/nics/features/cnxk.ini
+++ b/doc/guides/nics/features/cnxk.ini
@@ -90,6 +90,7 @@ of_set_vlan_vid      = Y
 pf                   = Y
 port_id              = Y
 queue                = Y
+represented_port     = Y
 rss                  = Y
 security             = Y
 vf                   = Y
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 6ab0cae78b..c4ce32daed 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -59,6 +59,10 @@ New Features
 
   * Added support for flow action REPRESENTED_PORT.
 
+* **Updated cnxk PMD.**
+
+  * Added support for flow action REPRESENTED_PORT.
+
 
 Removed Items
 -------------
diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c
index 06301b9ecb..6d155d924c 100644
--- a/drivers/net/cnxk/cnxk_flow.c
+++ b/drivers/net/cnxk/cnxk_flow.c
@@ -115,6 +115,7 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 		 struct roc_npc_action in_actions[], uint32_t *flowkey_cfg)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+	const struct rte_flow_action_ethdev *act_ethdev;
 	const struct rte_flow_action_port_id *port_act;
 	const struct rte_flow_action_queue *act_q;
 	struct roc_npc *roc_npc_src = &dev->npc;
@@ -157,13 +158,17 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 			in_actions[i].conf = actions->conf;
 			break;
 
+		case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT:
 		case RTE_FLOW_ACTION_TYPE_PORT_ID:
 			in_actions[i].type = ROC_NPC_ACTION_TYPE_PORT_ID;
 			in_actions[i].conf = actions->conf;
+			act_ethdev = (const struct rte_flow_action_ethdev *)
+					   actions->conf;
 			port_act = (const struct rte_flow_action_port_id *)
 					   actions->conf;
-			if (rte_eth_dev_get_name_by_port(port_act->id,
-							 if_name)) {
+			if (rte_eth_dev_get_name_by_port(
+			    actions->type != RTE_FLOW_ACTION_TYPE_PORT_ID ?
+			    act_ethdev->port_id : port_act->id, if_name)) {
 				plt_err("Name not found for output port id");
 				goto err_exit;
 			}
-- 
2.30.2


  parent reply	other threads:[~2022-08-12 19:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 19:18 [PATCH 00/13] ethdev: proceed with flow subsystem rework Ivan Malov
2022-08-12 19:18 ` [PATCH 01/13] ethdev: strip experimental tag off Rx metadata negotiate API Ivan Malov
2022-08-12 19:18 ` [PATCH 02/13] ethdev: strip experimental tag off port ID items and actions Ivan Malov
2022-08-15 12:59   ` Ori Kam
2022-08-12 19:18 ` [PATCH 03/13] ethdev: remove experimental tag from flow transfer proxy API Ivan Malov
2022-08-15 12:58   ` Ori Kam
2022-08-12 19:18 ` [PATCH 04/13] net/dpaa2: support represented port flow action Ivan Malov
2022-08-12 19:18 ` Ivan Malov [this message]
2022-08-12 19:18 ` [PATCH 06/13] app/testpmd: add port steering targets to sample " Ivan Malov
2022-08-12 19:18 ` [PATCH 07/13] doc: revisit outdated flow rule examples in testpmd tutorial Ivan Malov
2022-08-12 19:18 ` [PATCH 08/13] doc: add new port items and actions to switch representation Ivan Malov
2022-08-12 19:18 ` [PATCH 09/13] doc: rework VF-related explanations in " Ivan Malov
2022-08-12 19:18 ` [PATCH 10/13] ethdev: remove deprecated flow item PF Ivan Malov
2022-08-22  5:32   ` Ori Kam
2022-08-12 19:18 ` [PATCH 11/13] ethdev: remove deprecated flow item VF Ivan Malov
2022-08-22  5:50   ` Ori Kam
2022-08-12 19:18 ` [PATCH 12/13] ethdev: remove deprecated flow item PHY PORT Ivan Malov
2022-08-22  5:33   ` Ori Kam
2022-09-27  7:08     ` Thomas Monjalon
2022-09-27 16:18       ` Ajit Khaparde
2022-08-12 19:18 ` [PATCH 13/13] ethdev: remove deprecated flow action " Ivan Malov
2022-08-22  5:33   ` Ori Kam
2022-09-27  8:32 ` [PATCH 00/13] ethdev: proceed with flow subsystem rework Thomas Monjalon

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220812191827.3187441-6-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=elibr@nvidia.com \
    --cc=i.maximets@ovn.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=orika@nvidia.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

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

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