[v1] ethdev: add async flow connection tracking configuration

Message ID 20220920071036.20878-1-suanmingm@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series [v1] ethdev: add async flow connection tracking configuration |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Suanming Mou Sept. 20, 2022, 7:10 a.m. UTC
  In queue based async flow engine, in order to optimize the flow
insertion rate, PMD can use the hints from application to have
resources pre-allocate during initialization phase for actions
such as count/meter/aging.

This commit adds the connection tracking action hints.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 app/test-pmd/cmdline_flow.c            | 10 ++++++++++
 doc/guides/rel_notes/release_22_11.rst |  6 ++++++
 lib/ethdev/rte_flow.h                  | 10 ++++++++++
 3 files changed, 26 insertions(+)
  

Comments

Andrew Rybchenko Sept. 28, 2022, 8:34 a.m. UTC | #1
On 9/20/22 10:10, Suanming Mou wrote:
> In queue based async flow engine, in order to optimize the flow
> insertion rate, PMD can use the hints from application to have
> resources pre-allocate during initialization phase for actions
> such as count/meter/aging.
> 
> This commit adds the connection tracking action hints.
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 7f50028eb7..c9cbf381c4 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_CONN_TRACK_NUMBER,
 
 	/* 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_CONN_TRACK_NUMBER,
 	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_CONN_TRACK_NUMBER] = {
+		.name = "conn_tracks_number",
+		.help = "number of connection trackings",
+		.next = NEXT(next_config_attr,
+			     NEXT_ENTRY(COMMON_UNSIGNED)),
+		.args = ARGS(ARGS_ENTRY(struct buffer,
+					args.configure.port_attr.nb_conn_tracks)),
+	},
 	/* Top-level command. */
 	[PATTERN_TEMPLATE] = {
 		.name = "pattern_template",
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 8c021cf050..d5e64ff9a1 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -55,6 +55,12 @@  New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added configuration for asynchronous flow connection tracking.**
+
+  Added connection tracking action number hint to ``rte_flow_configure``
+  and ``rte_flow_info_get``.
+  PMD can prepare the connection tracking resources according to the hint.
+
 
 Removed Items
 -------------
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index a79f1e7ef0..c2747abc55 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -4902,6 +4902,11 @@  struct rte_flow_port_info {
 	 * @see RTE_FLOW_ACTION_TYPE_METER
 	 */
 	uint32_t max_nb_meters;
+	/**
+	 * Maximum number connection trackings.
+	 * @see RTE_FLOW_ACTION_TYPE_CONNTRACK
+	 */
+	uint32_t max_nb_conn_tracks;
 };
 
 /**
@@ -4971,6 +4976,11 @@  struct rte_flow_port_attr {
 	 * @see RTE_FLOW_ACTION_TYPE_METER
 	 */
 	uint32_t nb_meters;
+	/**
+	 * Number of connection trackings to configure.
+	 * @see RTE_FLOW_ACTION_TYPE_CONNTRACK
+	 */
+	uint32_t nb_conn_tracks;
 };
 
 /**