DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michael Baum <michaelba@nvidia.com>
To: <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	"Ori Kam" <orika@nvidia.com>
Subject: [PATCH 1/3] ethdev: add strict queue to pre-configuration flow hints
Date: Wed, 21 Sep 2022 17:54:07 +0300	[thread overview]
Message-ID: <20220921145409.511328-2-michaelba@nvidia.com> (raw)
In-Reply-To: <20220921145409.511328-1-michaelba@nvidia.com>

The data-path focused flow rule management can manage flow rules in more
optimized way than traditional one by using hints provided by
application in initialization phase.

In addition to the current hints we have in port attr, more hints could
be provided by application about its behaviour.

One example is how the application do with the same flow rule ?
A. create/destroy flow on same queue but query flow on different queue
   or queue-less way (i.e, counter query)
B. All flow operations will be exactly on the same queue, by which PMD
   could be in more optimized way then A because resource could be
   isolated and access based on queue, without lock, for example.

This patch add flag about above situation and could be extended to cover
more situations.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
---
 app/test-pmd/cmdline_flow.c                 | 10 ++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 ++--
 lib/ethdev/rte_flow.h                       | 14 ++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 7f50028eb7..a982083d27 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -219,6 +219,7 @@ enum index {
 	CONFIG_COUNTERS_NUMBER,
 	CONFIG_AGING_OBJECTS_NUMBER,
 	CONFIG_METERS_NUMBER,
+	CONFIG_FLAGS,
 
 	/* Indirect action arguments */
 	INDIRECT_ACTION_CREATE,
@@ -1081,6 +1082,7 @@ static const enum index next_config_attr[] = {
 	CONFIG_COUNTERS_NUMBER,
 	CONFIG_AGING_OBJECTS_NUMBER,
 	CONFIG_METERS_NUMBER,
+	CONFIG_FLAGS,
 	END,
 	ZERO,
 };
@@ -2667,6 +2669,14 @@ static const struct token token_list[] = {
 		.args = ARGS(ARGS_ENTRY(struct buffer,
 					args.configure.port_attr.nb_meters)),
 	},
+	[CONFIG_FLAGS] = {
+		.name = "flags",
+		.help = "configuration flags",
+		.next = NEXT(next_config_attr,
+			     NEXT_ENTRY(COMMON_UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY(struct buffer,
+					args.configure.port_attr.flags)),
+	},
 	/* Top-level command. */
 	[PATTERN_TEMPLATE] = {
 		.name = "pattern_template",
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 330e34427d..6c12e0286c 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -3082,7 +3082,7 @@ following sections.
        [queues_number {number}] [queues_size {size}]
        [counters_number {number}]
        [aging_counters_number {number}]
-       [meters_number {number}]
+       [meters_number {number}] [flags {number}]
 
 - Create a pattern template::
    flow pattern_template {port_id} create [pattern_template_id {id}]
@@ -3233,7 +3233,7 @@ for asynchronous flow creation/destruction operations. It is bound to
        [queues_number {number}] [queues_size {size}]
        [counters_number {number}]
        [aging_counters_number {number}]
-       [meters_number {number}]
+       [meters_number {number}] [flags {number}]
 
 If successful, it will show::
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index a79f1e7ef0..c552771472 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -4874,6 +4874,12 @@ rte_flow_flex_item_release(uint16_t port_id,
 			   const struct rte_flow_item_flex_handle *handle,
 			   struct rte_flow_error *error);
 
+/**
+ * Indicate all operations for a given flow rule will _strictly_
+ * happen on the same queue (create/destroy/query/update).
+ */
+#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE RTE_BIT32(0)
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice.
@@ -4902,6 +4908,10 @@ struct rte_flow_port_info {
 	 * @see RTE_FLOW_ACTION_TYPE_METER
 	 */
 	uint32_t max_nb_meters;
+	/**
+	 * Port supported flags (RTE_FLOW_PORT_FLAG_*).
+	 */
+	uint32_t supported_flags;
 };
 
 /**
@@ -4971,6 +4981,10 @@ struct rte_flow_port_attr {
 	 * @see RTE_FLOW_ACTION_TYPE_METER
 	 */
 	uint32_t nb_meters;
+	/**
+	 * Port flags (RTE_FLOW_PORT_FLAG_*).
+	 */
+	uint32_t flags;
 };
 
 /**
-- 
2.25.1


  reply	other threads:[~2022-09-21 14:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 14:54 [PATCH 0/3] ethdev: AGE action preparation Michael Baum
2022-09-21 14:54 ` Michael Baum [this message]
2022-09-29 12:04   ` [PATCH 1/3] ethdev: add strict queue to pre-configuration flow hints Ori Kam
2022-09-21 14:54 ` [PATCH 2/3] ethdev: add queue-based API to report aged flow rules Michael Baum
2022-09-29 12:04   ` Ori Kam
2022-09-21 14:54 ` [PATCH 3/3] ethdev: add structure for indirect AGE update Michael Baum
2022-09-29 12:39   ` Ori Kam
2022-10-03  8:03   ` Andrew Rybchenko
2022-10-03  8:30     ` Ori Kam
2022-10-03 13:17       ` Andrew Rybchenko
2022-10-03 15:13         ` Ori Kam
2022-10-04  6:36           ` Andrew Rybchenko
2022-10-19 13:09             ` Michael Baum
2022-09-29  8:40 ` [PATCH 0/3] ethdev: AGE action preparation Andrew Rybchenko
2022-10-19 13:12 ` [PATCH v2 " Michael Baum
2022-10-19 13:12   ` [PATCH v2 1/3] ethdev: add strict queue to pre-configuration flow hints Michael Baum
2022-10-19 13:12   ` [PATCH v2 2/3] ethdev: add queue-based API to report aged flow rules Michael Baum
2022-10-19 13:12   ` [PATCH v2 3/3] ethdev: add structure for indirect AGE update Michael Baum
2022-10-19 14:49   ` [PATCH v3 0/3] ethdev: AGE action preparation Michael Baum
2022-10-19 14:49     ` [PATCH v3 1/3] ethdev: add strict queue to pre-configuration flow hints Michael Baum
2022-10-26 19:10       ` Andrew Rybchenko
2022-10-19 14:49     ` [PATCH v3 2/3] ethdev: add queue-based API to report aged flow rules Michael Baum
2022-10-26 19:15       ` Andrew Rybchenko
2022-10-26 21:17         ` Michael Baum
2022-10-19 14:49     ` [PATCH v3 3/3] ethdev: add structure for indirect AGE update Michael Baum
2022-10-26 19:18       ` Andrew Rybchenko
2022-10-26 21:19         ` Michael Baum
2022-10-26 21:49     ` [PATCH v4 0/3] ethdev: AGE action preparation Michael Baum
2022-10-26 21:49       ` [PATCH v4 1/3] ethdev: add strict queue to pre-configuration flow hints Michael Baum
2022-10-26 21:49       ` [PATCH v4 2/3] ethdev: add queue-based API to report aged flow rules Michael Baum
2022-10-26 21:49       ` [PATCH v4 3/3] ethdev: add structure for indirect AGE update Michael Baum
2022-10-28 10:56       ` [PATCH v4 0/3] ethdev: AGE action preparation Andrew Rybchenko

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=20220921145409.511328-2-michaelba@nvidia.com \
    --to=michaelba@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@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).