DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Xueming Li <xuemingl@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH v2 1/2] ethdev: introduce transfer attribute to shared action conf
Date: Mon,  2 Nov 2020 14:35:18 +0300	[thread overview]
Message-ID: <20201102113519.23412-1-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20201029114644.22169-1-ivan.malov@oktetlabs.ru>

In a flow rule, attribute "transfer" means operation level
at which both traffic is matched and actions are conducted.

Add the very same attribute to shared action configuration.
If a driver needs to prepare HW resources in two different
ways, depending on the operation level, in order to set up
an action, then this new attribute will indicate the level.
Also, when handling a flow rule insertion, the driver will
be able to turn down a shared action if its level is unfit.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
---
 ...-transfer-attribute-to-shared-action.patch | 42 ++++++++++
 ...ort-shared-flow-action-attribute-tra.patch | 82 +++++++++++++++++++
 lib/librte_ethdev/rte_flow.h                  |  8 ++
 3 files changed, 132 insertions(+)
 create mode 100644 0001-ethdev-introduce-transfer-attribute-to-shared-action.patch
 create mode 100644 0002-app-testpmd-support-shared-flow-action-attribute-tra.patch

diff --git a/0001-ethdev-introduce-transfer-attribute-to-shared-action.patch b/0001-ethdev-introduce-transfer-attribute-to-shared-action.patch
new file mode 100644
index 000000000..b0bf9063e
--- /dev/null
+++ b/0001-ethdev-introduce-transfer-attribute-to-shared-action.patch
@@ -0,0 +1,42 @@
+From 802259bb546259663f979fb7695b8a9fd15bed31 Mon Sep 17 00:00:00 2001
+From: Ivan Malov <ivan.malov@oktetlabs.ru>
+Date: Thu, 29 Oct 2020 06:54:46 +0300
+Subject: [PATCH 1/2] ethdev: introduce transfer attribute to shared action
+ conf
+
+In a flow rule, attribute "transfer" means operation level
+at which both traffic is matched and actions are conducted.
+
+Add the very same attribute to shared action configuration.
+If a driver needs to prepare HW resources in two different
+ways, depending on the operation level, in order to set up
+an action, then this new attribute will indicate the level.
+Also, when handling a flow rule insertion, the driver will
+be able to turn down a shared action if its level is unfit.
+
+Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
+---
+ lib/librte_ethdev/rte_flow.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
+index a8eac4deb..0b993d8eb 100644
+--- a/lib/librte_ethdev/rte_flow.h
++++ b/lib/librte_ethdev/rte_flow.h
+@@ -3487,6 +3487,13 @@ struct rte_flow_shared_action_conf {
+ 	/**< Action valid for rules applied to ingress traffic. */
+ 	uint32_t egress:1;
+ 	/**< Action valid for rules applied to egress traffic. */
++
++	/**
++	 * This attribute matches that of the flow rules which
++	 * are supposed to comprise the given shared action.
++	 * See struct rte_flow_attr.
++	 */
++	uint32_t transfer:1;
+ };
+ 
+ /**
+-- 
+2.20.1
+
diff --git a/0002-app-testpmd-support-shared-flow-action-attribute-tra.patch b/0002-app-testpmd-support-shared-flow-action-attribute-tra.patch
new file mode 100644
index 000000000..d503d5d45
--- /dev/null
+++ b/0002-app-testpmd-support-shared-flow-action-attribute-tra.patch
@@ -0,0 +1,82 @@
+From 9732bc93169af1040731a4a66bd6ef44a878576b Mon Sep 17 00:00:00 2001
+From: Ivan Malov <ivan.malov@oktetlabs.ru>
+Date: Thu, 29 Oct 2020 12:42:11 +0300
+Subject: [PATCH 2/2] app/testpmd: support shared flow action attribute
+ transfer
+
+This attribute helps PMDs to tell actions supposed to work
+on the so-called hardware e-switch level from regular ones.
+
+Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
+---
+ app/test-pmd/cmdline_flow.c                 | 12 ++++++++++++
+ doc/guides/testpmd_app_ug/testpmd_funcs.rst |  2 +-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
+index c68d22fda..fe18cca27 100644
+--- a/app/test-pmd/cmdline_flow.c
++++ b/app/test-pmd/cmdline_flow.c
+@@ -114,6 +114,7 @@ enum index {
+ 	SHARED_ACTION_CREATE_ID,
+ 	SHARED_ACTION_INGRESS,
+ 	SHARED_ACTION_EGRESS,
++	SHARED_ACTION_TRANSFER,
+ 	SHARED_ACTION_SPEC,
+ 
+ 	/* Shared action destroy arguments */
+@@ -782,6 +783,7 @@ static const enum index next_sa_create_attr[] = {
+ 	SHARED_ACTION_CREATE_ID,
+ 	SHARED_ACTION_INGRESS,
+ 	SHARED_ACTION_EGRESS,
++	SHARED_ACTION_TRANSFER,
+ 	SHARED_ACTION_SPEC,
+ 	ZERO,
+ };
+@@ -4286,6 +4288,12 @@ static const struct token token_list[] = {
+ 		.next = NEXT(next_sa_create_attr),
+ 		.call = parse_sa,
+ 	},
++	[SHARED_ACTION_TRANSFER] = {
++		.name = "transfer",
++		.help = "affect rule to transfer",
++		.next = NEXT(next_sa_create_attr),
++		.call = parse_sa,
++	},
+ 	[SHARED_ACTION_SPEC] = {
+ 		.name = "action",
+ 		.help = "specify action to share",
+@@ -4521,6 +4529,9 @@ parse_sa(struct context *ctx, const struct token *token,
+ 	case SHARED_ACTION_INGRESS:
+ 		out->args.vc.attr.ingress = 1;
+ 		return len;
++	case SHARED_ACTION_TRANSFER:
++		out->args.vc.attr.transfer = 1;
++		return len;
+ 	default:
+ 		return -1;
+ 	}
+@@ -7273,6 +7284,7 @@ cmd_flow_parsed(const struct buffer *in)
+ 				&((const struct rte_flow_shared_action_conf) {
+ 					.ingress = in->args.vc.attr.ingress,
+ 					.egress = in->args.vc.attr.egress,
++					.transfer = in->args.vc.attr.transfer,
+ 				}),
+ 				in->args.vc.actions);
+ 		break;
+diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+index 289df193b..ebf7e68f8 100644
+--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
++++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+@@ -4318,7 +4318,7 @@ Creating shared actions
+ shared action ID. It is bound to ``rte_flow_shared_action_create()``::
+ 
+    flow shared_action {port_id} create [action_id {shared_action_id}]
+-      [ingress] [egress] action {action} / end
++      [ingress] [egress] [transfer] action {action} / end
+ 
+ If successful, it will show::
+ 
+-- 
+2.20.1
+
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index a8eac4deb..8b970ba0b 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -3487,6 +3487,14 @@ struct rte_flow_shared_action_conf {
 	/**< Action valid for rules applied to ingress traffic. */
 	uint32_t egress:1;
 	/**< Action valid for rules applied to egress traffic. */
+
+	/**
+	 * When set to 1, indicates that the action is valid for
+	 * transfer traffic; otherwise, for non-transfer traffic.
+	 *
+	 * See struct rte_flow_attr.
+	 */
+	uint32_t transfer:1;
 };
 
 /**
-- 
2.20.1


  parent reply	other threads:[~2020-11-02 11:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 11:46 [dpdk-dev] [PATCH " Ivan Malov
2020-10-29 11:46 ` [dpdk-dev] [PATCH 2/2] app/testpmd: support shared flow action attribute transfer Ivan Malov
2020-10-29 12:37 ` [dpdk-dev] [PATCH 1/2] ethdev: introduce transfer attribute to shared action conf Ferruh Yigit
2020-10-29 12:54   ` Andrew Rybchenko
2020-10-30 15:49 ` Xueming(Steven) Li
2020-10-30 20:35   ` Ivan Malov
2020-11-01  8:11     ` Ori Kam
2020-11-01  9:35       ` Ori Kam
2020-11-02  9:37         ` Ori Kam
2020-11-02 11:35 ` Ivan Malov [this message]
2020-11-02 11:35   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: support shared flow action attribute transfer Ivan Malov
2020-11-02 11:43 ` [dpdk-dev] [PATCH v3 1/2] ethdev: introduce transfer attribute to shared action conf Ivan Malov
2020-11-02 11:43   ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: support shared flow action attribute transfer Ivan Malov
2020-11-02 14:04     ` Ori Kam
2020-11-02 13:15   ` [dpdk-dev] [PATCH v3 1/2] ethdev: introduce transfer attribute to shared action conf Andrew Rybchenko
2020-11-02 21:44     ` Ajit Khaparde
2020-11-02 18:54   ` Ferruh Yigit
2020-11-03 14:10     ` Ivan Malov
2020-11-03 15:52       ` Ferruh Yigit
2020-11-03 14:20     ` Andrey Vesnovaty
2020-11-03 16:05       ` Ferruh Yigit

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=20201102113519.23412-1-ivan.malov@oktetlabs.ru \
    --to=ivan.malov@oktetlabs.ru \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=xuemingl@nvidia.com \
    /path/to/YOUR_REPLY

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

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