Skip to contentSkip to conversation

support VXLAN rsvd1 modification

PATCH Superseded Rongwei Liu 5 participants 67 messages May 23, 2024 – Jun 25, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

cover support VXLAN rsvd1 modification

Support to modify VXLAN the last byte reserved field.

Rongwei Liu (3):
ethdev: add VXLAN last reserved field app/testpmd: add VXLAN last reserved modification command net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  4 ++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 5 files changed, 25 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/3 ethdev: add VXLAN last reserved field

Add VXLAN last reserved byte in rte flow packet field.

---
 lib/ethdev/rte_flow.h | 1 +
 1 file changed, 1 insertion(+)
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..b807713cec 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN reserved1. */
 };
 
 /**
Signature · 1 line
2.27.0
#2 lore raw

PATCH 2/3 app/testpmd: add VXLAN last reserved modification command

In reply to Rongwei Liu

Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..9e88034709 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random", "vxlan_last_rsvd",
 	NULL
 };
 
Signature · 1 line
2.27.0
#3 lore raw

RE: [PATCH v1 2/3] app/testpmd: add VXLAN last reserved modification command

Quoted 12 lines

-----Original Message-----
From: rongwei liu <[email protected]>
Sent: Thursday, May 23, 2024 09:29
To: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Dariusz Sosnowski <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>
Subject: [PATCH v1 2/3] app/testpmd: add VXLAN last reserved modification command

Quoted 4 lines

Add 'vxlan_last_rsvd' as the modification command string.

Could you please split this commit into 2?

1. Fix commit for reorganizing flow field IDs in testpmd (so that this fix gets backported to next LTS releases).
2. Commit adding "vxlan_last_rsvd".

Best regards,
Dariusz Sosnowski

#4 lore raw

v2 cover support VXLAN rsvd1 modification

Support to modify VXLAN the last byte reserved field.

v2: patch split.

Rongwei Liu (4):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field app/testpmd: add VXLAN last reserved modification command net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  4 ++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 5 files changed, 25 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
#5 lore raw

PATCH v2 1/4 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
#6 lore raw

Re: [PATCH v2 1/4] app/testpmd: fix the testpmd field string sequence

Hi
@Dariusz Sosnowski<mailto:[email protected]> Can you comment on this patch? Thanks.

BR

Rongwei

________________________________
From: Rongwei Liu <[email protected]>
Sent: Monday, May 27, 2024 10:47
To: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Michael Baum <[email protected]>; [email protected] <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Dariusz Sosnowski <[email protected]>
Subject: [PATCH v2 1/4] app/testpmd: fix the testpmd field string sequence

External email: Use caution opening links or attachments

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
        "hash_result",
        "geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
        "tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-       "random",
        "ipv4_proto",
-       "esp_spi", "esp_seq_num", "esp_proto",
        "ipv6_flow_label", "ipv6_traffic_class",
+       "esp_spi", "esp_seq_num", "esp_proto",
+       "random",
        NULL
 };
 

--
2.27.0

Acked-by on v2 1/4
#7 lore raw

RE: [PATCH v2 1/4] app/testpmd: fix the testpmd field string sequence

In reply to Rongwei Liu
Quoted 13 lines

-----Original Message-----
From: rongwei liu <[email protected]>
Sent: Monday, May 27, 2024 04:47
To: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Michael Baum <[email protected]>; [email protected]; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Dariusz Sosnowski <[email protected]>
Subject: [PATCH v2 1/4] app/testpmd: fix the testpmd field string sequence

Quoted 8 lines

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")

Best regards,
Dariusz Sosnowski

#8 lore raw

PATCH v2 2/4 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add VXLAN last reserved byte in rte flow packet field.

---
 lib/ethdev/rte_flow.h | 1 +
 1 file changed, 1 insertion(+)
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..b807713cec 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN reserved1. */
 };
 
 /**
Signature · 1 line
2.27.0
author Acked-by Dariusz Sosnowski on v2 2/4
#9 lore raw

Re: [PATCH v2 2/4] ethdev: add VXLAN last reserved field

Hi @Ori Kam<mailto:[email protected]>@Andrew Rybchenko<mailto:[email protected]>@NBU-Contact-Thomas Monjalon (EXTERNAL)<mailto:[email protected]>@Ferruh Yigit<mailto:[email protected]> Can you help ACK this patch?
      Thanks

BR

Rongwei

________________________________
From: Rongwei Liu <[email protected]>
Sent: Monday, May 27, 2024 10:47
To: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Dariusz Sosnowski <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: [PATCH v2 2/4] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

Add VXLAN last reserved byte in rte flow packet field.

---
 lib/ethdev/rte_flow.h | 1 +
 1 file changed, 1 insertion(+)
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..b807713cec 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
        RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
        RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
        RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+       RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN reserved1. */
 };
 
 /**

--
2.27.0

#10 lore raw

Re: [PATCH v2 2/4] ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

27/05/2024 04:47, Rongwei Liu:

Quoted 1 line

Add VXLAN last reserved byte in rte flow packet field.

You should squash addition in testpmd in the same patch. Adding a field in rte_flow.h should be atomic with testpmd update.

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2431

Quoted 5 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN reserved1. */

It isn't clear what reserved1 is.
You should say it is the last byte of the VXLAN header.

#11 lore raw

Re: [PATCH v2 2/4] ethdev: add VXLAN last reserved field

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, June 4, 2024 19:59
To: rongwei liu <[email protected]>
Cc: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v2 2/4] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

27/05/2024 04:47, Rongwei Liu:

Quoted 1 line

Add VXLAN last reserved byte in rte flow packet field.

You should squash addition in testpmd in the same patch. Adding a field in rte_flow.h should be atomic with testpmd update.

Sure. Squash into one commit.

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2431

Quoted 5 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN reserved1. */

It isn't clear what reserved1 is.
You should say it is the last byte of the VXLAN header.

ACK.

#12 lore raw

v3 cover support VXLAN rsvd1 modification

In reply to Thomas Monjalon

Support to modify VXLAN the last byte reserved field.

v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  5 +++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 5 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
#13 lore raw

PATCH v3 1/3 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
#14 lore raw

PATCH v3 2/3 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add VXLAN last reserved byte in rte flow packet field. Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 2 files changed, 2 insertions(+)
app/test-pmd/cmdline_flow.c +1 -0
index 775ce20fc4..f3d6a2cfd7 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..5a1dbfc084 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };
 
 /**
Signature · 1 line
2.27.0
#15 lore raw

PATCH v3 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index b5928d40b2..2cedb3696b 100644
@@ -685,6 +685,11 @@ Limitations
     - Second tunnel fields are not supported.
 
   - Encapsulation levels greater than ``2`` are not supported.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only in HW steering (``dv_flow_en=2``).
+    - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP
+      UDP destination port.
 
 - Age action:
 
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 6f72185916..48554ab8d1 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 27e3ec550e..2feff05c24 100644
@@ -1371,6 +1371,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_RSVD1) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5515,6 +5519,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#16 lore raw

PATCH v2 3/4 app/testpmd: add VXLAN last reserved modification command

In reply to Rongwei Liu

Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline_flow.c +1 -1
index 775ce20fc4..9e88034709 100644
@@ -1005,7 +1005,7 @@ static const char *const flow_field_ids[] = {
 	"ipv4_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
-	"random",
+	"random", "vxlan_last_rsvd",
 	NULL
 };
 
Signature · 1 line
2.27.0
#17 lore raw

Re: [PATCH v2 3/4] app/testpmd: add VXLAN last reserved modification command

27/05/2024 04:47, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1008

Quoted 6 lines
app/test-pmd/cmdline_flow.c +1 -1
@@ -1005,7 +1005,7 @@ static const char *const flow_field_ids[] = {
 	"ipv4_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
-	"random",
+	"random", "vxlan_last_rsvd",

it is not related to "random", so a new line looks better

#18 lore raw

PATCH v2 4/4 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index dcc1beb812..afa35bf1e6 100644
@@ -685,6 +685,11 @@ Limitations
     - Second tunnel fields are not supported.
 
   - Encapsulation levels greater than ``2`` are not supported.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only in HW steering (``dv_flow_en=2``).
+    - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP
+      UDP destination port.
 
 - Age action:
 
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index f9c56af86c..7645369533 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 80efcf44fa..e2d41707c8 100644
@@ -1363,6 +1363,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_RSVD1) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5494,6 +5498,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#19 lore raw

Re: [PATCH v2 4/4] net/mlx5: implement VXLAN last reserved modification

27/05/2024 04:47, Rongwei Liu:

doc/guides/nics/mlx5.rst Limitations · line 692

Quoted 11 lines
doc/guides/nics/mlx5.rst +5 -0
@@ -685,6 +685,11 @@ Limitations
     - Second tunnel fields are not supported.
 
   - Encapsulation levels greater than ``2`` are not supported.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only in HW steering (``dv_flow_en=2``).
+    - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP
+      UDP destination port.

Don't add at the end of bullet lists without trying to order.
It is limitation for a specific protocol, it should go above with other protocols, between "Modification of VXLAN network" and GENEVE limitations.

"rsvd1" should be replaced with "last reserved byte".

What do you mean with "default VXLAN/VXLAN-GPE/VXLAN-GBP UDP destination port"? Is it port 4789 for VXLAN and VXLAN-GBP, and port 4790 for VXLAN-GPE? We need to be more specific probably.

#20 lore raw

Re: [PATCH v2 4/4] net/mlx5: implement VXLAN last reserved modification

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, June 4, 2024 20:19
To: rongwei liu <[email protected]>
Cc: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>
Subject: Re: [PATCH v2 4/4] net/mlx5: implement VXLAN last reserved modification

External email: Use caution opening links or attachments

27/05/2024 04:47, Rongwei Liu:

doc/guides/nics/mlx5.rst Limitations · line 692

Quoted 11 lines
doc/guides/nics/mlx5.rst +5 -0
@@ -685,6 +685,11 @@ Limitations
     - Second tunnel fields are not supported.
 
   - Encapsulation levels greater than ``2`` are not supported.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only in HW steering (``dv_flow_en=2``).
+    - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP
+      UDP destination port.

Don't add at the end of bullet lists without trying to order.
It is limitation for a specific protocol, it should go above with other protocols, between "Modification of VXLAN network" and GENEVE limitations.

"rsvd1" should be replaced with "last reserved byte". Ok.

What do you mean with "default VXLAN/VXLAN-GPE/VXLAN-GBP UDP destination port"? Is it port 4789 for VXLAN and VXLAN-GBP, and port 4790 for VXLAN-GPE? We need to be more specific probably.

Will change to the exact number.

#21 lore raw

v4 cover support VXLAN rsvd1 modification

In reply to Thomas Monjalon

Support to modify VXLAN the last byte reserved field.

v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  5 +++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 5 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
#22 lore raw

PATCH v4 1/3 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
#23 lore raw

PATCH v4 2/3 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add VXLAN last reserved byte in rte flow packet field. Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 2 files changed, 2 insertions(+)
app/test-pmd/cmdline_flow.c +1 -0
index 775ce20fc4..f3d6a2cfd7 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..5a1dbfc084 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };
 
 /**
Signature · 1 line
2.27.0
#24 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

04/06/2024 14:38, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1011

Quoted 9 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd? Just because it is the same order?

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2432

Quoted 8 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

#25 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, June 4, 2024 23:03
To: rongwei liu <[email protected]>
Cc: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

04/06/2024 14:38, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1011

Quoted 9 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
+     "vxlan_last_rsvd",
      NULL
 };

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd? Just because it is the same order?

Consider the on-the-way VxLAN extension changes, the last reserved byte was naming as "uint8_t rsvd1".

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2432

Quoted 8 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?

#26 lore raw

RE: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

Quoted 13 lines
Quoted 13 lines

04/06/2024 14:38, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1011

Quoted 9 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
+     "vxlan_last_rsvd",
      NULL
 };

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd? Just because it is the same order?

Yes, it's because of the order.
We should refactor this to use array designators.

Quoted 11 lines
Quoted 11 lines

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2432

Quoted 8 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

Quoted 1 line

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?

+1 on using RSVD1 so it matches rte_vxlan_hdr definition.

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1", we should probably rename all other instances of "last_rsvd" to match.

Best regards,
Dariusz Sosnowski

#27 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

04/06/2024 18:40, Dariusz Sosnowski:

Quoted 28 lines
Quoted 13 lines
Quoted 13 lines

04/06/2024 14:38, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1011

Quoted 9 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
+     "vxlan_last_rsvd",
      NULL
 };

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd? Just because it is the same order?

Yes, it's because of the order.
We should refactor this to use array designators.

Quoted 11 lines
Quoted 11 lines

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2432

Quoted 8 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

Quoted 6 lines
Quoted 1 line

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?

+1 on using RSVD1 so it matches rte_vxlan_hdr definition.

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1", we should probably rename all other instances of "last_rsvd" to match.

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match the 3 bytes of rsvd0 (patch to come)

#28 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, June 5, 2024 2:37
To: rongwei liu <[email protected]>; Dariusz Sosnowski <[email protected]>
Cc: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

04/06/2024 18:40, Dariusz Sosnowski:

Quoted 28 lines
Quoted 13 lines
Quoted 13 lines

04/06/2024 14:38, Rongwei Liu:

app/test-pmd/cmdline_flow.c static const char *const flow_field_ids[] = { · line 1011

Quoted 9 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
+     "vxlan_last_rsvd",
      NULL
 };

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd? Just because it is the same order?

Yes, it's because of the order.
We should refactor this to use array designators.

Quoted 11 lines
Quoted 11 lines

lib/ethdev/rte_flow.h enum rte_flow_field_id { · line 2432

Quoted 8 lines
lib/ethdev/rte_flow.h +1 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved byte. */
 };

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

Quoted 6 lines
Quoted 1 line

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?

+1 on using RSVD1 so it matches rte_vxlan_hdr definition.

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1", we should probably rename all other instances of "last_rsvd" to match.

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match the 3 bytes of rsvd0 (patch to come)

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:

1.
RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD
2.
"uint8_t rsvd1" ----> "uint8_t last_rsvd"

#29 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

05/06/2024 03:16, rongwei liu:

Quoted 56 lines

From: Thomas Monjalon <[email protected]>

Quoted 47 lines

04/06/2024 18:40, Dariusz Sosnowski:

Quoted 46 lines
Quoted 12 lines
Quoted 12 lines

04/06/2024 14:38, Rongwei Liu:

Quoted 11 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] =
 {
 
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
 
+     "vxlan_last_rsvd",
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

NULL

};

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd?
Just because it is the same order?

Yes, it's because of the order.
We should refactor this to use array designators.

Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
lib/ethdev/rte_flow.h +0 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol
      value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
 
Quoted 7 lines
Quoted 4 lines
lib/ethdev/rte_flow.h +1 -0
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved

byte. */

};

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

Quoted 4 lines

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?> > >

+1 on using RSVD1 so it matches rte_vxlan_hdr definition.

Quoted 7 lines
Quoted 3 lines

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1", we should probably rename all other instances of "last_rsvd" to match.> >

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match the 3 bytes of rsvd0 (patch to come)

Quoted 6 lines

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:

1.
RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD
2.
"uint8_t rsvd1" ----> "uint8_t last_rsvd"

We don't change rte_vxlan_hdr, because we avoid breaking compatibility.

#30 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, June 5, 2024 15:13
To: Dariusz Sosnowski <[email protected]>; rongwei liu <[email protected]>
Cc: [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

05/06/2024 03:16, rongwei liu:

Quoted 56 lines

From: Thomas Monjalon <[email protected]>

Quoted 47 lines

04/06/2024 18:40, Dariusz Sosnowski:

Quoted 46 lines
Quoted 12 lines
Quoted 12 lines

04/06/2024 14:38, Rongwei Liu:

Quoted 11 lines
app/test-pmd/cmdline_flow.c +1 -0
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] =
 {
 
      "ipv6_flow_label", "ipv6_traffic_class",
      "esp_spi", "esp_seq_num", "esp_proto",
      "random",
 
+     "vxlan_last_rsvd",
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

NULL

};

How vxlan_last_rsvd is linked to RTE_FLOW_FIELD_VXLAN_RSVD1 in testpmd?
Just because it is the same order?

Yes, it's because of the order.
We should refactor this to use array designators.

Quoted 17 lines
Quoted 9 lines
Quoted 9 lines
lib/ethdev/rte_flow.h +0 -0
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 
      RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
      RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol
      value. */
      RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
 
Quoted 7 lines
Quoted 4 lines
lib/ethdev/rte_flow.h +1 -0
+     RTE_FLOW_FIELD_VXLAN_RSVD1,     /**< VXLAN last reserved

byte. */

};

I think we should use the same naming as in testpmd. What about RTE_FLOW_FIELD_VXLAN_LAST_RSVD?

Quoted 4 lines

To be honest, no strong objection per my personal thought. Considering the API "vxlan_hdr" names this field as "uint8_t rsvd1", maybe RTE_FLOW_FIELD_VXLAN_RSVD1 will be clearer for user as 1 vs 1 mapping?> > >

+1 on using RSVD1 so it matches rte_vxlan_hdr definition.

Quoted 7 lines
Quoted 3 lines

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1", we should probably rename all other instances of "last_rsvd" to match.> >

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match the 3 bytes of rsvd0 (patch to come)

Quoted 6 lines

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:

1.
RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD
2.
"uint8_t rsvd1" ----> "uint8_t last_rsvd"

We don't change rte_vxlan_hdr, because we avoid breaking compatibility.

How about to add a new union:

union {
    uint8_t rsvd1;
    uint8_t last_rsvd;
}

RTE_FLOW_FIELD_VXLAN_LAST_RSVD will perfectly match the rte_vxlan_hdr definition.

#31 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

05/06/2024 10:14, rongwei liu:

Quoted 23 lines
Quoted 15 lines
Quoted 15 lines
Quoted 11 lines
Quoted 5 lines

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1",
we should probably rename all other instances of "last_rsvd" to match.> >

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match
the 3 bytes of rsvd0 (patch to come)

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:
1.

Quoted 7 lines
Quoted 5 lines

RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD

2.

"uint8_t rsvd1" ----> "uint8_t last_rsvd"

We don't change rte_vxlan_hdr, because we avoid breaking compatibility.

Quoted 7 lines

How about to add a new union:

union {
    uint8_t rsvd1;
    uint8_t last_rsvd;
}

RTE_FLOW_FIELD_VXLAN_LAST_RSVD will perfectly match the rte_vxlan_hdr definition.

It could be a solution, yes,
but I don't see it in your v5.

#32 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

BR

Rongwei

________________________________
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, June 5, 2024 17:35
To: rongwei liu <[email protected]>
Cc: Dariusz Sosnowski <[email protected]>; [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

05/06/2024 10:14, rongwei liu:

Quoted 23 lines
Quoted 15 lines
Quoted 15 lines
Quoted 11 lines
Quoted 5 lines

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1",
we should probably rename all other instances of "last_rsvd" to match.> >

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match
the 3 bytes of rsvd0 (patch to come)

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:
1.

Quoted 7 lines
Quoted 5 lines

RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD

2.

"uint8_t rsvd1" ----> "uint8_t last_rsvd"

We don't change rte_vxlan_hdr, because we avoid breaking compatibility.

Quoted 7 lines

How about to add a new union:

union {
    uint8_t rsvd1;
    uint8_t last_rsvd;
}

RTE_FLOW_FIELD_VXLAN_LAST_RSVD will perfectly match the rte_vxlan_hdr definition.

It could be a solution, yes,
but I don't see it in your v5.

Should I add this change in my serial or expect it in the upcoming new VXLAN header definitions?

#33 lore raw

Re: [PATCH v4 2/3] ethdev: add VXLAN last reserved field

05/06/2024 11:41, rongwei liu:

Quoted 34 lines

From: Thomas Monjalon <[email protected]>

Quoted 33 lines

05/06/2024 10:14, rongwei liu:

Quoted 32 lines
Quoted 16 lines
Quoted 16 lines
Quoted 7 lines
Quoted 6 lines

In this patch, "vxlan_last_rsvd" is used in testpmd, so it matches
existing "last_rsvd" field in VXLAN item. If we choose to use "rsvd1",
we should probably rename all other instances of "last_rsvd" to match.> >

Quoted 5 lines

I prefer "vxlan_last_rsvd" for 2 reasons:
- it is more meaningful
- we are adding first, second and third reserved fields to match
the 3 bytes of rsvd0 (patch to come)

Sound clear and reasonable. I would like to propose the alignment between rte_flow_field_id and rte_vxlan_hdr:
1.

Quoted 8 lines
Quoted 5 lines

RTE_FLOW_FIELD_VXLAN_RSVD1 ---> RTE_FLOW_FIELD_VXLAN_LAST_RSVD

2.

"uint8_t rsvd1" ----> "uint8_t last_rsvd"

We don't change rte_vxlan_hdr, because we avoid breaking compatibility.

How about to add a new union:

union {

    uint8_t rsvd1;
    uint8_t last_rsvd;
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

}

RTE_FLOW_FIELD_VXLAN_LAST_RSVD will perfectly match the rte_vxlan_hdr definition.> >

It could be a solution, yes,
but I don't see it in your v5.

Should I add this change in my serial or expect it in the upcoming new VXLAN header definitions?

It fits better in your series.

#34 lore raw

v6 cover support VXLAN last reserved byte modification

Support to modify VXLAN last reserved byte.

v6: add union into vxlan header.
v5: change the field enumeration naming.
v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (4):
app/testpmd: fix the testpmd field string sequence
net: add new union into VXLAN header
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  5 +++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 lib/net/rte_vxlan.h             |  5 ++++-
 6 files changed, 30 insertions(+), 3 deletions(-)
Signature · 1 line
2.27.0
#35 lore raw

PATCH v6 1/4 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
Acked-by on v6 1/4
#36 lore raw

RE: [PATCH v6 1/4] app/testpmd: fix the testpmd field string sequence

Quoted 10 lines

-----Original Message-----
From: rongwei liu <[email protected]>
Sent: Wednesday, June 5, 2024 1:22 PM
Subject: [PATCH v6 1/4] app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Quoted 7 lines
Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")

---

#37 lore raw

PATCH v6 2/4 net: add new union into VXLAN header

In reply to Rongwei Liu

Add "uint8_t last_rsvd" as union with origin rsvd1.

---
 lib/net/rte_vxlan.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/net/rte_vxlan.h +4 -1
index 997fc784fc..57300fb442 100644
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
 			uint8_t    flags;    /**< Should be 8 (I flag). */
 			uint8_t    rsvd0[3]; /**< Reserved. */
 			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
+			union {
+				uint8_t    rsvd1;        /**< Reserved. */
+				uint8_t    last_rsvd;    /**< Reserved. */
+			};
 		};
 	};
 } __rte_packed;
Signature · 1 line
2.27.0
#38 lore raw

Re: [PATCH v6 2/4] net: add new union into VXLAN header

05/06/2024 12:21, Rongwei Liu:

Quoted 1 line

Add "uint8_t last_rsvd" as union with origin rsvd1.

You should explain why: for matching what we have in testpmd. I think it should be squashed with the next patch.

Quoted 5 lines
lib/net/rte_vxlan.h +4 -1
-			uint8_t    rsvd1;    /**< Reserved. */
+			union {
+				uint8_t    rsvd1;        /**< Reserved. */
+				uint8_t    last_rsvd;    /**< Reserved. */
+			};
#39 lore raw

RE: [PATCH v6 2/4] net: add new union into VXLAN header

BR
Rongwei

Quoted 9 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, June 5, 2024 18:42
To: rongwei liu <[email protected]>
Cc: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>
Subject: Re: [PATCH v6 2/4] net: add new union into VXLAN header

Quoted 8 lines

External email: Use caution opening links or attachments

05/06/2024 12:21, Rongwei Liu:

Quoted 1 line

Add "uint8_t last_rsvd" as union with origin rsvd1.

You should explain why: for matching what we have in testpmd. I think it should be squashed with the next patch.

Sure. Let' squash them, still with "ethdev" prefix?
The explanation should in the commit log not in the header file. What do you think?

Quoted 8 lines
Quoted 6 lines
lib/net/rte_vxlan.h +4 -1
-                     uint8_t    rsvd1;    /**< Reserved. */
+                     union {
+                             uint8_t    rsvd1;        /**< Reserved. */
+                             uint8_t    last_rsvd;    /**< Reserved. */
+                     };
#40 lore raw

Re: [PATCH v6 2/4] net: add new union into VXLAN header

05/06/2024 13:28, rongwei liu:

Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 5 lines

05/06/2024 12:21, Rongwei Liu:

Quoted 1 line

Add "uint8_t last_rsvd" as union with origin rsvd1.

You should explain why: for matching what we have in testpmd. I think it should be squashed with the next patch.

Sure. Let' squash them, still with "ethdev" prefix?

Yes, the main change is adding new field item in ethdev.

Quoted 1 line

The explanation should in the commit log not in the header file. What do you think?

Yes, explanation in the commit log.

#41 lore raw

v7 cover support VXLAN last reserved byte modification

v7: squash, add more commit logs.
v6: add union into vxlan header.
v5: change the field enumeration naming.
v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  5 +++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 lib/net/rte_vxlan.h             |  5 ++++-
 6 files changed, 30 insertions(+), 3 deletions(-)
Signature · 1 line
2.27.0
#42 lore raw

PATCH v7 1/3 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
#43 lore raw

PATCH v7 2/3 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add "uint8_t last_rsvd" as union with origin rsvd1. Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet field.

The new union is used by testpmd matching item VXLAN "last_rsvd" and modify target "vxlan_last_rsvd".

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 lib/net/rte_vxlan.h         | 5 ++++-
 3 files changed, 6 insertions(+), 1 deletion(-)
app/test-pmd/cmdline_flow.c +1 -0
index 775ce20fc4..f3d6a2cfd7 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..74cf2e0f59 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_LAST_RSVD, /**< VXLAN last reserved byte. */
 };
 
 /**
lib/net/rte_vxlan.h +4 -1
index 997fc784fc..57300fb442 100644
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
 			uint8_t    flags;    /**< Should be 8 (I flag). */
 			uint8_t    rsvd0[3]; /**< Reserved. */
 			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
+			union {
+				uint8_t    rsvd1;        /**< Reserved. */
+				uint8_t    last_rsvd;    /**< Reserved. */
+			};
 		};
 	};
 } __rte_packed;
Signature · 1 line
2.27.0
Acked-by on v7 2/3
#44 lore raw

Re: [PATCH v7 2/3] ethdev: add VXLAN last reserved field

05/06/2024 15:04, Rongwei Liu:

Quoted 6 lines

Add "uint8_t last_rsvd" as union with origin rsvd1. Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet field.

The new union is used by testpmd matching item VXLAN "last_rsvd"

no it is still using the name "rsvd1" in testpmd

Quoted 1 line

and modify target "vxlan_last_rsvd".

You should give the real name: RTE_FLOW_FIELD_VXLAN_LAST_RSVD

With above changes,

Quoted 2 lines
#45 lore raw

RE: [PATCH v7 2/3] ethdev: add VXLAN last reserved field

BR
Rongwei

Quoted 15 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, June 7, 2024 21:26
To: rongwei liu <[email protected]>
Cc: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Dariusz Sosnowski <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v7 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

Quoted 8 lines

05/06/2024 15:04, Rongwei Liu:

Quoted 4 lines

Add "uint8_t last_rsvd" as union with origin rsvd1. Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet field.

The new union is used by testpmd matching item VXLAN "last_rsvd"

no it is still using the name "rsvd1" in testpmd

Map the testpmd cli "last_rsvd" to the new entry "last_rsvd"
Keep the vxlan-gpe as the original since it refers to rte_vxlan_gpe_hdr not rte_vxlan_hdr. "rsvd1" string: I though you are talking about the vxlan-gpe not vxlan.
If we plan to change this too, another commit is desired.

Quoted 3 lines
Quoted 1 line

and modify target "vxlan_last_rsvd".

You should give the real name: RTE_FLOW_FIELD_VXLAN_LAST_RSVD

ACK

Quoted 8 lines

With above changes,

Quoted 2 lines
#46 lore raw

v8 cover support VXLAN last reserved byte modification

In reply to Thomas Monjalon

v8: enhance commit log and remap testpmd "last_rsvd" to new union.
v7: squash, add more commit logs.
v6: add union into vxlan header.
v5: change the field enumeration naming.
v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  9 +++++----
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 lib/net/rte_vxlan.h             |  5 ++++-
 6 files changed, 32 insertions(+), 5 deletions(-)
Signature · 1 line
2.27.0
#47 lore raw

PATCH v8 1/3 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
Acked-by on v8 1/3
#48 lore raw

RE: [PATCH v8 1/3] app/testpmd: fix the testpmd field string sequence

Quoted 9 lines

-----Original Message-----
From: rongwei liu <[email protected]>
Sent: Friday, June 7, 2024 5:02 PM

The field string should be in the same order as the rte_flow_field_id enumration definitions

Quoted 7 lines
Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")

---

Best,
Ori

#49 lore raw

Re: [PATCH v8 1/3] app/testpmd: fix the testpmd field string sequence

In reply to Rongwei Liu
Quoted 7 lines · Rongwei Liu

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
Fixes d66aa38f431d ("ethdev: allow modifying IPsec fields")
Fixes b160da13b398 ("ethdev: allow modifying IPv4 next protocol field")

Above can be because of merge conflict, I didn't investigate in depth.

Quoted 23 lines
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
#50 lore raw

PATCH v8 2/3 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add "uint8_t last_rsvd" as union with origin rsvd1. Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet field.

The new union is used by testpmd matching item VXLAN "last_rsvd" and modify target RTE_FLOW_FIELD_VXLAN_LAST_RSVD.

---
 app/test-pmd/cmdline_flow.c | 5 +++--
 lib/ethdev/rte_flow.h       | 1 +
 lib/net/rte_vxlan.h         | 5 ++++-
 3 files changed, 8 insertions(+), 3 deletions(-)
app/test-pmd/cmdline_flow.c +3 -2
index 775ce20fc4..99e2db04df 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
@@ -4912,11 +4913,11 @@ static const struct token token_list[] = {
 	},
 	[ITEM_VXLAN_LAST_RSVD] = {
 		.name = "last_rsvd",
-		.help = "VXLAN last reserved bits",
+		.help = "VXLAN last reserved byte",
 		.next = NEXT(item_vxlan, NEXT_ENTRY(COMMON_UNSIGNED),
 			     item_param),
 		.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_vxlan,
-					     hdr.rsvd1)),
+					     hdr.last_rsvd)),
 	},
 	[ITEM_E_TAG] = {
 		.name = "e_tag",
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..74cf2e0f59 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_LAST_RSVD, /**< VXLAN last reserved byte. */
 };
 
 /**
lib/net/rte_vxlan.h +4 -1
index 997fc784fc..57300fb442 100644
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
 			uint8_t    flags;    /**< Should be 8 (I flag). */
 			uint8_t    rsvd0[3]; /**< Reserved. */
 			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
+			union {
+				uint8_t    rsvd1;        /**< Reserved. */
+				uint8_t    last_rsvd;    /**< Reserved. */
+			};
 		};
 	};
 } __rte_packed;
Signature · 1 line
2.27.0
#51 lore raw

Re: [PATCH v8 2/3] ethdev: add VXLAN last reserved field

07/06/2024 16:02, Rongwei Liu:

Quoted 10 lines

Add "uint8_t last_rsvd" as union with origin rsvd1. Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet field.

The new union is used by testpmd matching item VXLAN "last_rsvd" and modify target RTE_FLOW_FIELD_VXLAN_LAST_RSVD.

OK this version looks good, thank you.

#52 lore raw

Re: [PATCH v8 2/3] ethdev: add VXLAN last reserved field

In reply to Rongwei Liu
Quoted 5 lines · Rongwei Liu
lib/net/rte_vxlan.h +0 -0
index 997fc784fc..57300fb442 100644

lib/net/rte_vxlan.h struct rte_vxlan_hdr { · line 48

Quoted 9 lines
lib/net/rte_vxlan.h +4 -1
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
 			uint8_t    flags;    /**< Should be 8 (I flag). */
 			uint8_t    rsvd0[3]; /**< Reserved. */
 			uint8_t    vni[3];   /**< VXLAN identifier. */
-			uint8_t    rsvd1;    /**< Reserved. */
+			union {
+				uint8_t    rsvd1;        /**< Reserved. */
+				uint8_t    last_rsvd;    /**< Reserved. */
+			};
 

Is there a plan to remove 'rsvd1' in next ABI break release? We can keep both, but I guess it is not logically necessary to keep it, to prevent bloat by time, we can remove the old one.
If decided to remove, sending a 'deprecation.rst' update helps us to remember doing it.

#53 lore raw

RE: [PATCH v8 2/3] ethdev: add VXLAN last reserved field

BR
Rongwei

Quoted 28 lines

-----Original Message-----
From: Ferruh Yigit <[email protected]>
Sent: Tuesday, June 11, 2024 22:53
To: rongwei liu <[email protected]>; [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU- Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Dariusz Sosnowski <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v8 2/3] ethdev: add VXLAN last reserved field

External email: Use caution opening links or attachments

Quoted 12 lines · Rongwei Liu
lib/net/rte_vxlan.h index renamed from lib/net/rte_vxlan.h +0 -0

997fc784fc..57300fb442 100644

lib/net/rte_vxlan.h +3 -1
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
                      uint8_t    flags;    /**< Should be 8 (I flag). */
                      uint8_t    rsvd0[3]; /**< Reserved. */
                      uint8_t    vni[3];   /**< VXLAN identifier. */
-                     uint8_t    rsvd1;    /**< Reserved. */
+                     union {
+                             uint8_t    rsvd1;        /**< Reserved. */
+                             uint8_t    last_rsvd;    /**< Reserved. */
Quoted 9 lines

lib/net/rte_vxlan.h struct rte_vxlan_hdr { · line 48

Quoted 2 lines
lib/net/rte_vxlan.h +1 -0
+                     };
 

Is there a plan to remove 'rsvd1' in next ABI break release?
We can keep both, but I guess it is not logically necessary to keep it, to prevent bloat by time, we can remove the old one.
If decided to remove, sending a 'deprecation.rst' update helps us to remember doing it.

I think it should. @NBU-Contact-Thomas Monjalon (EXTERNAL) @Andrew Rybchenko@Ori Kam what do you think?

#54 lore raw

Re: [PATCH v8 2/3] ethdev: add VXLAN last reserved field

12/06/2024 03:25, rongwei liu:

Quoted 19 lines

From: Ferruh Yigit <[email protected]>

Quoted 9 lines · Rongwei Liu
Quoted 8 lines
lib/net/rte_vxlan.h +3 -1
@@ -41,7 +41,10 @@ struct rte_vxlan_hdr {
                      uint8_t    flags;    /**< Should be 8 (I flag). */
                      uint8_t    rsvd0[3]; /**< Reserved. */
                      uint8_t    vni[3];   /**< VXLAN identifier. */
-                     uint8_t    rsvd1;    /**< Reserved. */
+                     union {
+                             uint8_t    rsvd1;        /**< Reserved. */
+                             uint8_t    last_rsvd;    /**< Reserved. */
Quoted 9 lines

Review struct rte_vxlan_hdr { · line 48

Quoted 2 lines
(quoted diff) +1 -0
+                     };
 

Is there a plan to remove 'rsvd1' in next ABI break release?
We can keep both, but I guess it is not logically necessary to keep it, to prevent bloat by time, we can remove the old one.
If decided to remove, sending a 'deprecation.rst' update helps us to remember doing it.

Quoted 1 line

I think it should. @NBU-Contact-Thomas Monjalon (EXTERNAL) @Andrew Rybchenko@Ori Kam what do you think?

From user perspective, there is no benefit in removing an aliased field, except for simplicity.
The drawback is a potential API compatibility breakage.

We may mark it as deprecated in the comment and plan for removal in a long time, let's say 25.11? Is there anyone against removing "rsvd1" in VXLAN header for compatibility purpose?

#55 lore raw

PATCH v8 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index 8afb32ed35..4d0b8bf309 100644
@@ -639,6 +639,11 @@ Limitations
   - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
   - Modification of the 802.1Q tag is not supported.
   - Modification of VXLAN network or GENEVE network ID is supported only for HW steering.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only for HW steering (``dv_flow_en=2``).
+    - Support VNI and the last reserved byte modifications for traffic with default
+      UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE.
   - Modification of GENEVE network ID is not supported when configured
     ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options.
     See :ref:`mlx5_firmware_config` for more flex parser information.
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 714613b15a..789e28b0ff 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index e8562660dd..41a83768fb 100644
@@ -1313,6 +1313,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_LAST_RSVD) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5508,6 +5512,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#56 lore raw

Re: [PATCH v8 0/3] support VXLAN last reserved byte modification

In reply to Rongwei Liu
Quoted 8 lines · Rongwei Liu

v8: enhance commit log and remap testpmd "last_rsvd" to new union.
v7: squash, add more commit logs.
v6: add union into vxlan header.
v5: change the field enumeration naming.
v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Quoted 5 lines

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

Series applied to dpdk-next-net/main, thanks.

#57 lore raw

PATCH v7 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index b5928d40b2..8b3aaf5aac 100644
@@ -637,6 +637,11 @@ Limitations
   - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
   - Modification of the 802.1Q tag is not supported.
   - Modification of VXLAN network or GENEVE network ID is supported only for HW steering.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only for HW steering (``dv_flow_en=2``).
+    - Support VNI and the last reserved byte modifications for traffic with default
+      UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE.
   - Modification of GENEVE network ID is not supported when configured
     ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options.
     See :ref:`mlx5_firmware_config` for more flex parser information.
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 06f5427abf..99abb2f2fb 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 63194935a3..01362ae121 100644
@@ -1385,6 +1385,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_LAST_RSVD) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5580,6 +5584,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#58 lore raw

PATCH v6 3/4 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add VXLAN last reserved byte in rte flow packet field. Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 2 files changed, 2 insertions(+)
app/test-pmd/cmdline_flow.c +1 -0
index 775ce20fc4..f3d6a2cfd7 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..74cf2e0f59 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_LAST_RSVD, /**< VXLAN last reserved byte. */
 };
 
 /**
Signature · 1 line
2.27.0
#59 lore raw

PATCH v6 4/4 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index b5928d40b2..8b3aaf5aac 100644
@@ -637,6 +637,11 @@ Limitations
   - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
   - Modification of the 802.1Q tag is not supported.
   - Modification of VXLAN network or GENEVE network ID is supported only for HW steering.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only for HW steering (``dv_flow_en=2``).
+    - Support VNI and the last reserved byte modifications for traffic with default
+      UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE.
   - Modification of GENEVE network ID is not supported when configured
     ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options.
     See :ref:`mlx5_firmware_config` for more flex parser information.
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 06f5427abf..99abb2f2fb 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 63194935a3..01362ae121 100644
@@ -1385,6 +1385,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_LAST_RSVD) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5580,6 +5584,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#60 lore raw

v5 cover support VXLAN last reserved byte modification

In reply to Thomas Monjalon

Support to modify VXLAN last reserved byte.

v5: change the field enumeration naming.
v4: specify the limitation with exact port number.
v3: squash testpmd and rte_flow into one commit.
v2: patch split.

Rongwei Liu (3):
app/testpmd: fix the testpmd field string sequence
ethdev: add VXLAN last reserved field net/mlx5: implement VXLAN last reserved modification

 app/test-pmd/cmdline_flow.c     |  5 +++--
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 lib/ethdev/rte_flow.h           |  1 +
 5 files changed, 26 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
#61 lore raw

PATCH v5 1/3 app/testpmd: fix the testpmd field string sequence

The field string should be in the same order as the rte_flow_field_id enumration definitions

Fixes bfc007802 ("ethdev: allow modifying IPv6 FL and TC fields")
---
 app/test-pmd/cmdline_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-pmd/cmdline_flow.c +2 -2
index 60ee9337cf..775ce20fc4 100644
@@ -1002,10 +1002,10 @@ static const char *const flow_field_ids[] = {
 	"hash_result",
 	"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
 	"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
-	"random",
 	"ipv4_proto",
-	"esp_spi", "esp_seq_num", "esp_proto",
 	"ipv6_flow_label", "ipv6_traffic_class",
+	"esp_spi", "esp_seq_num", "esp_proto",
+	"random",
 	NULL
 };
 
Signature · 1 line
2.27.0
#62 lore raw

PATCH v5 2/3 ethdev: add VXLAN last reserved field

In reply to Rongwei Liu

Add VXLAN last reserved byte in rte flow packet field. Add 'vxlan_last_rsvd' as the modification command string.

---
 app/test-pmd/cmdline_flow.c | 1 +
 lib/ethdev/rte_flow.h       | 1 +
 2 files changed, 2 insertions(+)
app/test-pmd/cmdline_flow.c +1 -0
index 775ce20fc4..f3d6a2cfd7 100644
@@ -1006,6 +1006,7 @@ static const char *const flow_field_ids[] = {
 	"ipv6_flow_label", "ipv6_traffic_class",
 	"esp_spi", "esp_seq_num", "esp_proto",
 	"random",
+	"vxlan_last_rsvd",
 	NULL
 };
 
lib/ethdev/rte_flow.h +1 -0
index 6e8ab1d4c7..74cf2e0f59 100644
@@ -2428,6 +2428,7 @@ enum rte_flow_field_id {
 	RTE_FLOW_FIELD_ESP_SEQ_NUM,     /**< ESP Sequence Number. */
 	RTE_FLOW_FIELD_ESP_PROTO,       /**< ESP next protocol value. */
 	RTE_FLOW_FIELD_RANDOM,          /**< Random value. */
+	RTE_FLOW_FIELD_VXLAN_LAST_RSVD, /**< VXLAN last reserved byte. */
 };
 
 /**
Signature · 1 line
2.27.0
#63 lore raw

PATCH v5 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index b5928d40b2..8b3aaf5aac 100644
@@ -637,6 +637,11 @@ Limitations
   - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
   - Modification of the 802.1Q tag is not supported.
   - Modification of VXLAN network or GENEVE network ID is supported only for HW steering.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only for HW steering (``dv_flow_en=2``).
+    - Support VNI and the last reserved byte modifications for traffic with default
+      UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE.
   - Modification of GENEVE network ID is not supported when configured
     ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options.
     See :ref:`mlx5_firmware_config` for more flex parser information.
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 06f5427abf..99abb2f2fb 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 63194935a3..01362ae121 100644
@@ -1385,6 +1385,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_LAST_RSVD) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5580,6 +5584,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_LAST_RSVD:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#64 lore raw

PATCH v4 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index b5928d40b2..8b3aaf5aac 100644
@@ -637,6 +637,11 @@ Limitations
   - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported.
   - Modification of the 802.1Q tag is not supported.
   - Modification of VXLAN network or GENEVE network ID is supported only for HW steering.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only for HW steering (``dv_flow_en=2``).
+    - Support VNI and the last reserved byte modifications for traffic with default
+      UDP destination port. 4789 for VXLAN and VXLAN-GBP, 4790 for VXLAN-GPE.
   - Modification of GENEVE network ID is not supported when configured
     ``FLEX_PARSER_PROFILE_ENABLE`` supports Geneve TLV options.
     See :ref:`mlx5_firmware_config` for more flex parser information.
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index 6f72185916..48554ab8d1 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 27e3ec550e..2feff05c24 100644
@@ -1371,6 +1371,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_RSVD1) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5515,6 +5519,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0
#65 lore raw

Re: [PATCH v1 2/3] app/testpmd: add VXLAN last reserved modification command

In reply to Dariusz Sosnowski

Hi

BR

Rongwei

________________________________
From: Dariusz Sosnowski <[email protected]>
Sent: Friday, May 24, 2024 23:53
To: rongwei liu <[email protected]>; [email protected] <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Aman Singh <[email protected]>; Yuying Zhang <[email protected]>
Subject: RE: [PATCH v1 2/3] app/testpmd: add VXLAN last reserved modification command

Quoted 12 lines

-----Original Message-----
From: rongwei liu <[email protected]>
Sent: Thursday, May 23, 2024 09:29
To: [email protected]; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>
Cc: Dariusz Sosnowski <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>
Subject: [PATCH v1 2/3] app/testpmd: add VXLAN last reserved modification command

Quoted 4 lines

Add 'vxlan_last_rsvd' as the modification command string.

Could you please split this commit into 2?

1. Fix commit for reorganizing flow field IDs in testpmd (so that this fix gets backported to next LTS releases). split is done. 22.11 and 23.11 don't have so many fields, IMO, Backport to LTS is not needed.
2. Commit adding "vxlan_last_rsvd".
Already have.

Best regards,
Dariusz Sosnowski

#66 lore raw

PATCH 3/3 net/mlx5: implement VXLAN last reserved modification

In reply to Rongwei Liu

Implementing the VxLAN last reserved byte modification. Following the RFC, the field is only 1 byte and needs to use the field_length as 8 instead of the real dst_field->size.

---
 doc/guides/nics/mlx5.rst        |  5 +++++
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 drivers/net/mlx5/mlx5_flow_hw.c |  5 +++++
 3 files changed, 22 insertions(+)
doc/guides/nics/mlx5.rst +5 -0
index dcc1beb812..afa35bf1e6 100644
@@ -685,6 +685,11 @@ Limitations
     - Second tunnel fields are not supported.
 
   - Encapsulation levels greater than ``2`` are not supported.
+  - Modification of the VXLAN header is supported with below limitations:
+
+    - Only in HW steering (``dv_flow_en=2``).
+    - Support VNI and rsvd1 modifications for traffic with default VXLAN/VXLAN-GPE/VXLAN-GBP
+      UDP destination port.
 
 - Age action:
 
drivers/net/mlx5/mlx5_flow_dv.c +12 -0
index f9c56af86c..7645369533 100644
@@ -1439,6 +1439,8 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
 	case RTE_FLOW_FIELD_VXLAN_VNI:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 		return 24;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		return 8;
 	case RTE_FLOW_FIELD_GTP_TEID:
 	case RTE_FLOW_FIELD_MPLS:
 	case RTE_FLOW_FIELD_TAG:
@@ -2038,6 +2040,16 @@ mlx5_flow_field_id_to_modify_info
 		else
 			info[idx].offset = off_be;
 		break;
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
+		MLX5_ASSERT(data->offset + width <= 8);
+		/* Last_rsvd is on bits 7-0 of TUNNEL_HDR_DW_1. */
+		off_be = 8 - (data->offset + width);
+		info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_TUNNEL_HDR_DW_1};
+		if (mask)
+			mask[idx] = flow_modify_info_mask_8(width, off_be);
+		else
+			info[idx].offset = off_be;
+		break;
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 		MLX5_ASSERT(data->offset + width <= 8);
 		modi_id = flow_geneve_opt_modi_field_get(priv, data);
drivers/net/mlx5/mlx5_flow_hw.c +5 -0
index 80efcf44fa..e2d41707c8 100644
@@ -1363,6 +1363,10 @@ flow_hw_modify_field_compile(struct rte_eth_dev *dev,
 			value = *(const uint8_t *)item.spec;
 			value = rte_cpu_to_be_32(value << 8);
 			item.spec = &value;
+		} else if (conf->dst.field == RTE_FLOW_FIELD_VXLAN_RSVD1) {
+			value = *(const uint8_t *)item.spec << 24;
+			value = rte_cpu_to_be_32(value);
+			item.spec = &value;
 		}
 	} else {
 		type = conf->operation == RTE_FLOW_MODIFY_SET ?
@@ -5494,6 +5498,7 @@ flow_hw_validate_modify_field_level(const struct rte_flow_field_data *data,
 	case RTE_FLOW_FIELD_ESP_SPI:
 	case RTE_FLOW_FIELD_ESP_SEQ_NUM:
 	case RTE_FLOW_FIELD_VXLAN_VNI:
+	case RTE_FLOW_FIELD_VXLAN_RSVD1:
 	case RTE_FLOW_FIELD_GENEVE_VNI:
 	case RTE_FLOW_FIELD_GENEVE_OPT_TYPE:
 	case RTE_FLOW_FIELD_GENEVE_OPT_CLASS:
Signature · 1 line
2.27.0