Skip to contentSkip to conversation

ethdev: add async flow connection tracking configuration

RFC In review Suanming Mou 3 participants 6 messages Aug 9, 2022 – Sep 28, 2022

lore
Share & tools
lore
#0 lore raw

RFC 1/1 ethdev: add async flow connection tracking configuration

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.

---
 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(+)
app/test-pmd/cmdline_flow.c +10 -0
index 7f50028eb7..c9cbf381c4 100644
@@ -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",
doc/guides/rel_notes/release_22_11.rst +6 -0
index 8c021cf050..c396bfca5f 100644
@@ -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 accroding to the hint.
+
 
 Removed Items
 -------------
lib/ethdev/rte_flow.h +10 -0
index a79f1e7ef0..c2747abc55 100644
@@ -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;
 };
 
 /**
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 105 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, 9 August 2022 16:26
Subject: [RFC] ethdev: add async flow connection tracking configuration

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.

---
 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(+)
app/test-pmd/cmdline_flow.c +10 -0
index 7f50028eb7..c9cbf381c4 100644
@@ -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. */
app/test-pmd/cmdline_flow.c +0 -0
 	[PATTERN_TEMPLATE] = {
 		.name = "pattern_template",
doc/guides/rel_notes/release_22_11.rst +6 -0
index 8c021cf050..c396bfca5f 100644
@@ -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 accroding to the hint.
+
 
 Removed Items
 -------------
lib/ethdev/rte_flow.h +10 -1
index a79f1e7ef0..c2747abc55 100644
@@ -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;
 };
 
 /**
--
Quoted 1 line

2.25.1

Best,
Ori

#2 lore raw
In reply to Suanming Mou

Ping...

Quoted 108 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, August 9, 2022 9:26 PM
To: [email protected]
Cc: Ori Kam <[email protected]>; Xiaoyun Li <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: [RFC] ethdev: add async flow connection tracking configuration

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.

---
 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(+)
app/test-pmd/cmdline_flow.c index renamed from app/test-pmd/cmdline_flow.c +0 -0

7f50028eb7..c9cbf381c4 100644

app/test-pmd/cmdline_flow.c +10 -0
@@ -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] = {
app/test-pmd/cmdline_flow.c +0 -0
 		.name = "pattern_template",
doc/guides/rel_notes/release_22_11.rst +6 -0
index 8c021cf050..c396bfca5f 100644
@@ -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 accroding to the hint.
+
 
 Removed Items
 -------------
lib/ethdev/rte_flow.h index renamed from lib/ethdev/rte_flow.h +0 -0

a79f1e7ef0..c2747abc55 100644

lib/ethdev/rte_flow.h +10 -1
@@ -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;
 };
 
 /**
--

2.25.1

Acked-by
#3 lore raw

Hi Suanming

Quoted 118 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Cc: [email protected]; Ori Kam <[email protected]>
Subject: RE: [RFC] ethdev: add async flow connection tracking configuration

Ping...

Quoted 6 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Tuesday, August 9, 2022 9:26 PM
To: [email protected]
Cc: Ori Kam <[email protected]>; Xiaoyun Li <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang

<[email protected]>;

Quoted 1 line

NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>;

Ferruh

Quoted 5 lines

Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: [RFC] ethdev: add async flow connection tracking configuration

In queue based async flow engine, in order to optimize the flow insertion

rate,

Quoted 1 line

PMD can use the hints from application to have resources pre-allocate

during

app/test-pmd/cmdline_flow.c

Quoted 12 lines

initialization phase for actions such as count/meter/aging.

This commit adds the connection tracking action hints.

---
 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(+)
app/test-pmd/cmdline_flow.c +0 -0

index

Quoted 41 lines

7f50028eb7..c9cbf381c4 100644

app/test-pmd/cmdline_flow.c +10 -0
@@ -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] = {
app/test-pmd/cmdline_flow.c +0 -0
 		.name = "pattern_template",
doc/guides/rel_notes/release_22_11.rst +0 -0
index 8c021cf050..c396bfca5f 100644

doc/guides/rel_notes/release_22_11.rst New Features · line 62

Quoted 8 lines
doc/guides/rel_notes/release_22_11.rst +5 -0
@@ -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 accroding to the

hint.

Quoted 31 lines
doc/guides/rel_notes/release_22_11.rst +1 -0
+
 
 Removed Items
 -------------
lib/ethdev/rte_flow.h index renamed from lib/ethdev/rte_flow.h +0 -0

a79f1e7ef0..c2747abc55 100644

lib/ethdev/rte_flow.h +10 -0
@@ -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;
 };
 
Quoted 3 lines
Quoted 3 lines
lib/ethdev/rte_flow.h +0 -1
 /**
--

2.25.1

Thanks,
Ori

#4 lore raw

PATCH 1/1 ethdev: add async flow connection tracking configuration

In reply to Suanming Mou

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.

---
 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(+)
app/test-pmd/cmdline_flow.c +10 -0
index 7f50028eb7..c9cbf381c4 100644
@@ -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",
doc/guides/rel_notes/release_22_11.rst +6 -0
index 8c021cf050..d5e64ff9a1 100644
@@ -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
 -------------
lib/ethdev/rte_flow.h +10 -0
index a79f1e7ef0..c2747abc55 100644
@@ -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;
 };
 
 /**
Signature · 1 line
2.25.1
#5 lore raw
Quoted 9 lines · Suanming Mou

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.

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