* [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
@ 2024-02-06 12:17 ` Viacheslav Ovsiienko
2024-02-06 13:03 ` Ori Kam
2024-02-06 12:17 ` [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation Viacheslav Ovsiienko
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Viacheslav Ovsiienko @ 2024-02-06 12:17 UTC (permalink / raw)
To: dev; +Cc: matan, rasland, orika, dsosnowski
Add new modify field action type string: "ipv4_proto".
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4062879552..03b418a5d8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -962,6 +962,7 @@ static const char *const modify_field_ids[] = {
"geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
"random",
+ "ipv4_proto",
NULL
};
--
2.18.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line
2024-02-06 12:17 ` [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line Viacheslav Ovsiienko
@ 2024-02-06 13:03 ` Ori Kam
2024-02-07 11:34 ` Dariusz Sosnowski
0 siblings, 1 reply; 14+ messages in thread
From: Ori Kam @ 2024-02-06 13:03 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Dariusz Sosnowski
Hi Slava
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Tuesday, February 6, 2024 2:18 PM
> Subject: [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command
> line
>
> Add new modify field action type string: "ipv4_proto".
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> app/test-pmd/cmdline_flow.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> index 4062879552..03b418a5d8 100644
> --- a/app/test-pmd/cmdline_flow.c
> +++ b/app/test-pmd/cmdline_flow.c
> @@ -962,6 +962,7 @@ static const char *const modify_field_ids[] = {
> "geneve_opt_type", "geneve_opt_class", "geneve_opt_data",
> "mpls",
> "tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
> "random",
> + "ipv4_proto",
> NULL
> };
>
> --
> 2.18.1
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line
2024-02-06 13:03 ` Ori Kam
@ 2024-02-07 11:34 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:34 UTC (permalink / raw)
To: Ori Kam, Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh
> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Tuesday, February 6, 2024 14:03
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Dariusz Sosnowski <dsosnowski@nvidia.com>
> Subject: RE: [PATCH 2/6] app/testpmd: add modify IPv4 next protocol
> command line
>
> Hi Slava
>
> > -----Original Message-----
> > From: Slava Ovsiienko <viacheslavo@nvidia.com>
> > Sent: Tuesday, February 6, 2024 2:18 PM
> > Subject: [PATCH 2/6] app/testpmd: add modify IPv4 next protocol
> > command line
> >
> > Add new modify field action type string: "ipv4_proto".
> >
> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > ---
> > app/test-pmd/cmdline_flow.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
> > index 4062879552..03b418a5d8 100644
> > --- a/app/test-pmd/cmdline_flow.c
> > +++ b/app/test-pmd/cmdline_flow.c
> > @@ -962,6 +962,7 @@ static const char *const modify_field_ids[] = {
> > "geneve_opt_type", "geneve_opt_class", "geneve_opt_data", "mpls",
> > "tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
> > "random",
> > + "ipv4_proto",
> > NULL
> > };
> >
> > --
> > 2.18.1
>
> Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
2024-02-06 12:17 ` [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line Viacheslav Ovsiienko
@ 2024-02-06 12:17 ` Viacheslav Ovsiienko
2024-02-07 11:36 ` Dariusz Sosnowski
2024-02-06 12:17 ` [PATCH 4/6] ethdev: add modify action support for IPsec fields Viacheslav Ovsiienko
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Viacheslav Ovsiienko @ 2024-02-06 12:17 UTC (permalink / raw)
To: dev; +Cc: matan, rasland, orika, dsosnowski
Add modify IPv4 protocol implementation for mlx5 PMD.
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
doc/guides/rel_notes/release_24_03.rst | 1 +
drivers/common/mlx5/mlx5_prm.h | 1 +
drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 33e9303ae1..3e33ff2d86 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -91,6 +91,7 @@ New Features
* Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_TYPE`` flow action.
* Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_CLASS`` flow action.
* Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_DATA`` flow action.
+ * Added HW steering support for modify field ``RTE_FLOW_FIELD_IPV4_PROTO`` flow action.
Removed Items
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index f64f25dbb7..44413517d0 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -839,6 +839,7 @@ enum mlx5_modification_field {
MLX5_MODI_IN_MPLS_LABEL_2,
MLX5_MODI_IN_MPLS_LABEL_3,
MLX5_MODI_IN_MPLS_LABEL_4,
+ MLX5_MODI_OUT_IP_PROTOCOL = 0x4A,
MLX5_MODI_OUT_IPV6_NEXT_HDR = 0x4A,
MLX5_MODI_META_REG_C_8 = 0x8F,
MLX5_MODI_META_REG_C_9 = 0x90,
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 6998be107f..764940b700 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1384,6 +1384,7 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
case RTE_FLOW_FIELD_IPV4_DSCP:
return 6;
case RTE_FLOW_FIELD_IPV4_TTL:
+ case RTE_FLOW_FIELD_IPV4_PROTO:
return 8;
case RTE_FLOW_FIELD_IPV4_SRC:
case RTE_FLOW_FIELD_IPV4_DST:
@@ -2194,10 +2195,11 @@ mlx5_flow_field_id_to_modify_info
info[idx].offset = data->offset;
}
break;
+ case RTE_FLOW_FIELD_IPV4_PROTO: /* Fall-through. */
case RTE_FLOW_FIELD_IPV6_PROTO:
MLX5_ASSERT(data->offset + width <= 8);
off_be = 8 - (data->offset + width);
- info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_OUT_IPV6_NEXT_HDR};
+ info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_OUT_IP_PROTOCOL};
if (mask)
mask[idx] = flow_modify_info_mask_8(width, off_be);
else
--
2.18.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation
2024-02-06 12:17 ` [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation Viacheslav Ovsiienko
@ 2024-02-07 11:36 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:36 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Ori Kam
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Tuesday, February 6, 2024 13:18
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Ori Kam <orika@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>
> Subject: [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation
>
> Add modify IPv4 protocol implementation for mlx5 PMD.
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 4/6] ethdev: add modify action support for IPsec fields
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
2024-02-06 12:17 ` [PATCH 2/6] app/testpmd: add modify IPv4 next protocol command line Viacheslav Ovsiienko
2024-02-06 12:17 ` [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation Viacheslav Ovsiienko
@ 2024-02-06 12:17 ` Viacheslav Ovsiienko
2024-02-07 11:44 ` Dariusz Sosnowski
2024-02-06 12:17 ` [PATCH 5/6] app/testpmd: add modify ESP related fields command line Viacheslav Ovsiienko
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Viacheslav Ovsiienko @ 2024-02-06 12:17 UTC (permalink / raw)
To: dev; +Cc: matan, rasland, orika, dsosnowski
The following IPsec related field definitions added:
- RTE_FLOW_FIELD_ESP_SPI - SPI value in IPsec header
- RTE_FLOW_FIELD_ESP_SEQ_NUM - sequence number in header
- RTE_FLOW_FIELD_ESP_PROTO - next protocol value in trailer
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
doc/guides/rel_notes/release_24_03.rst | 4 ++++
lib/ethdev/rte_flow.h | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 3e33ff2d86..2f78009dd8 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -65,6 +65,10 @@ New Features
* Added ``RTE_FLOW_ITEM_TYPE_RANDOM`` to match random value.
* Added ``RTE_FLOW_FIELD_RANDOM`` to represent it in field ID struct.
* Added ``RTE_FLOW_FIELD_IPV4_PROTO`` to represent it in field ID struct.
+ * Added ``RTE_FLOW_FIELD_ESP_SPI`` to represent it in field ID struct.
+ * Added ``RTE_FLOW_FIELD_ESP_SEQ_NUM`` to represent it in field ID struct.
+ * Added ``RTE_FLOW_FIELD_ESP_PROTO`` to represent it in field ID struct.
+
* ** Support for getting the number of used descriptors of a Tx queue. **
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 84af730dc7..6efba67f12 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3934,7 +3934,10 @@ enum rte_flow_field_id {
RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */
RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */
RTE_FLOW_FIELD_RANDOM, /**< Random value. */
- RTE_FLOW_FIELD_IPV4_PROTO /**< IPv4 next protocol. */
+ RTE_FLOW_FIELD_IPV4_PROTO, /**< IPv4 next protocol. */
+ RTE_FLOW_FIELD_ESP_SPI, /**< ESP SPI. */
+ RTE_FLOW_FIELD_ESP_SEQ_NUM, /**< ESP Sequence Number. */
+ RTE_FLOW_FIELD_ESP_PROTO /**< ESP next protocol value. */
};
/**
--
2.18.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 4/6] ethdev: add modify action support for IPsec fields
2024-02-06 12:17 ` [PATCH 4/6] ethdev: add modify action support for IPsec fields Viacheslav Ovsiienko
@ 2024-02-07 11:44 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:44 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Ori Kam
Hi Slava,
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Tuesday, February 6, 2024 13:18
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Ori Kam <orika@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>
> Subject: [PATCH 4/6] ethdev: add modify action support for IPsec fields
>
> The following IPsec related field definitions added:
>
> - RTE_FLOW_FIELD_ESP_SPI - SPI value in IPsec header
> - RTE_FLOW_FIELD_ESP_SEQ_NUM - sequence number in header
> - RTE_FLOW_FIELD_ESP_PROTO - next protocol value in trailer
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> doc/guides/rel_notes/release_24_03.rst | 4 ++++
> lib/ethdev/rte_flow.h | 5 ++++-
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/rel_notes/release_24_03.rst
> b/doc/guides/rel_notes/release_24_03.rst
> index 3e33ff2d86..2f78009dd8 100644
> --- a/doc/guides/rel_notes/release_24_03.rst
> +++ b/doc/guides/rel_notes/release_24_03.rst
> @@ -65,6 +65,10 @@ New Features
> * Added ``RTE_FLOW_ITEM_TYPE_RANDOM`` to match random value.
> * Added ``RTE_FLOW_FIELD_RANDOM`` to represent it in field ID struct.
> * Added ``RTE_FLOW_FIELD_IPV4_PROTO`` to represent it in field ID struct.
> + * Added ``RTE_FLOW_FIELD_ESP_SPI`` to represent it in field ID struct.
> + * Added ``RTE_FLOW_FIELD_ESP_SEQ_NUM`` to represent it in field ID struct.
> + * Added ``RTE_FLOW_FIELD_ESP_PROTO`` to represent it in field ID struct.
Could you please align this line with the rest of the items in that list, so that release notes generate properly?
Other than that, looks good to me.
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/6] app/testpmd: add modify ESP related fields command line
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
` (2 preceding siblings ...)
2024-02-06 12:17 ` [PATCH 4/6] ethdev: add modify action support for IPsec fields Viacheslav Ovsiienko
@ 2024-02-06 12:17 ` Viacheslav Ovsiienko
2024-02-07 11:37 ` Dariusz Sosnowski
2024-02-06 12:17 ` [PATCH 6/6] net/mlx5: add modify field action IPsec support Viacheslav Ovsiienko
2024-02-06 13:00 ` [PATCH 1/6] ethdev: add modify IPv4 next protocol field Ori Kam
5 siblings, 1 reply; 14+ messages in thread
From: Viacheslav Ovsiienko @ 2024-02-06 12:17 UTC (permalink / raw)
To: dev; +Cc: matan, rasland, orika, dsosnowski
Add new modify field destination type strings:
- "esp_spi", to modify Security Parameter Index field
- "esp_seq_num", to modify Sequence Number field
- "esp_proto", to modify next protocol field in ESP trailer
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
app/test-pmd/cmdline_flow.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 03b418a5d8..9e1048f945 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -963,6 +963,7 @@ static const char *const modify_field_ids[] = {
"tcp_data_off", "ipv4_ihl", "ipv4_total_len", "ipv6_payload_len",
"random",
"ipv4_proto",
+ "esp_spi", "esp_seq_num", "esp_proto",
NULL
};
--
2.18.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 5/6] app/testpmd: add modify ESP related fields command line
2024-02-06 12:17 ` [PATCH 5/6] app/testpmd: add modify ESP related fields command line Viacheslav Ovsiienko
@ 2024-02-07 11:37 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:37 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Ori Kam
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Tuesday, February 6, 2024 13:18
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Ori Kam <orika@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>
> Subject: [PATCH 5/6] app/testpmd: add modify ESP related fields command
> line
>
> Add new modify field destination type strings:
>
> - "esp_spi", to modify Security Parameter Index field
> - "esp_seq_num", to modify Sequence Number field
> - "esp_proto", to modify next protocol field in ESP trailer
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 6/6] net/mlx5: add modify field action IPsec support
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
` (3 preceding siblings ...)
2024-02-06 12:17 ` [PATCH 5/6] app/testpmd: add modify ESP related fields command line Viacheslav Ovsiienko
@ 2024-02-06 12:17 ` Viacheslav Ovsiienko
2024-02-07 11:45 ` Dariusz Sosnowski
2024-02-06 13:00 ` [PATCH 1/6] ethdev: add modify IPv4 next protocol field Ori Kam
5 siblings, 1 reply; 14+ messages in thread
From: Viacheslav Ovsiienko @ 2024-02-06 12:17 UTC (permalink / raw)
To: dev; +Cc: matan, rasland, orika, dsosnowski
Add mlx5 PMD support for the IPsec fields:
- RTE_FLOW_FIELD_ESP_SPI - SPI value in IPsec header
- RTE_FLOW_FIELD_ESP_SEQ_NUM - sequence number in header
- RTE_FLOW_FIELD_ESP_PROTO - next protocol value in trailer
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
doc/guides/rel_notes/release_24_03.rst | 3 +++
drivers/common/mlx5/mlx5_prm.h | 3 +++
drivers/net/mlx5/mlx5_flow_dv.c | 31 ++++++++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 2f78009dd8..50e8476e59 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -96,6 +96,9 @@ New Features
* Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_CLASS`` flow action.
* Added HW steering support for modify field ``RTE_FLOW_FIELD_GENEVE_OPT_DATA`` flow action.
* Added HW steering support for modify field ``RTE_FLOW_FIELD_IPV4_PROTO`` flow action.
+ * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_SPI`` flow action.
+ * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_SEQ_NUM`` flow action.
+ * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_PROTO`` flow action.
Removed Items
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 44413517d0..3150412580 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -854,6 +854,9 @@ enum mlx5_modification_field {
MLX5_MODI_OUT_IPV6_PAYLOAD_LEN = 0x11E,
MLX5_MODI_OUT_IPV4_IHL = 0x11F,
MLX5_MODI_OUT_TCP_DATA_OFFSET = 0x120,
+ MLX5_MODI_OUT_ESP_SPI = 0x5E,
+ MLX5_MODI_OUT_ESP_SEQ_NUM = 0x82,
+ MLX5_MODI_OUT_IPSEC_NEXT_HDR = 0x126,
MLX5_MODI_INVALID = INT_MAX,
};
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 764940b700..90413f4a38 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1414,7 +1414,11 @@ mlx5_flow_item_field_width(struct rte_eth_dev *dev,
case RTE_FLOW_FIELD_GTP_TEID:
case RTE_FLOW_FIELD_MPLS:
case RTE_FLOW_FIELD_TAG:
+ case RTE_FLOW_FIELD_ESP_SPI:
+ case RTE_FLOW_FIELD_ESP_SEQ_NUM:
return 32;
+ case RTE_FLOW_FIELD_ESP_PROTO:
+ return 8;
case RTE_FLOW_FIELD_MARK:
return rte_popcount32(priv->sh->dv_mark_mask);
case RTE_FLOW_FIELD_META:
@@ -2205,6 +2209,33 @@ mlx5_flow_field_id_to_modify_info
else
info[idx].offset = off_be;
break;
+ case RTE_FLOW_FIELD_ESP_PROTO:
+ MLX5_ASSERT(data->offset + width <= 8);
+ off_be = 8 - (data->offset + width);
+ info[idx] = (struct field_modify_info){1, 0, MLX5_MODI_OUT_IPSEC_NEXT_HDR};
+ if (mask)
+ mask[idx] = flow_modify_info_mask_8(width, off_be);
+ else
+ info[idx].offset = off_be;
+ break;
+ case RTE_FLOW_FIELD_ESP_SPI:
+ MLX5_ASSERT(data->offset + width <= 32);
+ off_be = 32 - (data->offset + width);
+ info[idx] = (struct field_modify_info){4, 0, MLX5_MODI_OUT_ESP_SPI};
+ if (mask)
+ mask[idx] = flow_modify_info_mask_32(width, off_be);
+ else
+ info[idx].offset = off_be;
+ break;
+ case RTE_FLOW_FIELD_ESP_SEQ_NUM:
+ MLX5_ASSERT(data->offset + width <= 32);
+ off_be = 32 - (data->offset + width);
+ info[idx] = (struct field_modify_info){4, 0, MLX5_MODI_OUT_ESP_SEQ_NUM};
+ if (mask)
+ mask[idx] = flow_modify_info_mask_32(width, off_be);
+ else
+ info[idx].offset = off_be;
+ break;
case RTE_FLOW_FIELD_FLEX_ITEM:
MLX5_ASSERT(data->flex_handle != NULL && !(data->offset & 0x7));
mlx5_modify_flex_item(dev, (const struct mlx5_flex_item *)data->flex_handle,
--
2.18.1
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 6/6] net/mlx5: add modify field action IPsec support
2024-02-06 12:17 ` [PATCH 6/6] net/mlx5: add modify field action IPsec support Viacheslav Ovsiienko
@ 2024-02-07 11:45 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:45 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Ori Kam
Hi Slava,
> + * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_SPI`` flow action.
> + * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_SEQ_NUM`` flow action.
> + * Added HW steering support for modify field ``RTE_FLOW_FIELD_ESP_PROTO`` flow action.
Could you please align this line with the rest of the items in that list, so that release notes generate properly?
Other than that, looks good to me.
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 1/6] ethdev: add modify IPv4 next protocol field
2024-02-06 12:17 [PATCH 1/6] ethdev: add modify IPv4 next protocol field Viacheslav Ovsiienko
` (4 preceding siblings ...)
2024-02-06 12:17 ` [PATCH 6/6] net/mlx5: add modify field action IPsec support Viacheslav Ovsiienko
@ 2024-02-06 13:00 ` Ori Kam
2024-02-07 11:31 ` Dariusz Sosnowski
5 siblings, 1 reply; 14+ messages in thread
From: Ori Kam @ 2024-02-06 13:00 UTC (permalink / raw)
To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh, Dariusz Sosnowski
Hi Slava
> -----Original Message-----
> From: Slava Ovsiienko <viacheslavo@nvidia.com>
> Sent: Tuesday, February 6, 2024 2:18 PM
> <dsosnowski@nvidia.com>
> Subject: [PATCH 1/6] ethdev: add modify IPv4 next protocol field
>
> Add IPv4 next protocol modify field definition.
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> doc/guides/rel_notes/release_24_03.rst | 1 +
> lib/ethdev/rte_flow.h | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/rel_notes/release_24_03.rst
> b/doc/guides/rel_notes/release_24_03.rst
> index 2b91217943..33e9303ae1 100644
> --- a/doc/guides/rel_notes/release_24_03.rst
> +++ b/doc/guides/rel_notes/release_24_03.rst
> @@ -64,6 +64,7 @@ New Features
>
> * Added ``RTE_FLOW_ITEM_TYPE_RANDOM`` to match random value.
> * Added ``RTE_FLOW_FIELD_RANDOM`` to represent it in field ID struct.
> + * Added ``RTE_FLOW_FIELD_IPV4_PROTO`` to represent it in field ID
> struct.
>
> * ** Support for getting the number of used descriptors of a Tx queue. **
>
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 1267c146e5..84af730dc7 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -3933,7 +3933,8 @@ enum rte_flow_field_id {
> RTE_FLOW_FIELD_IPV4_IHL, /**< IPv4 IHL. */
> RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */
> RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */
> - RTE_FLOW_FIELD_RANDOM /**< Random value. */
> + RTE_FLOW_FIELD_RANDOM, /**< Random value. */
> + RTE_FLOW_FIELD_IPV4_PROTO /**< IPv4 next protocol. */
> };
>
> /**
> --
> 2.18.1
Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH 1/6] ethdev: add modify IPv4 next protocol field
2024-02-06 13:00 ` [PATCH 1/6] ethdev: add modify IPv4 next protocol field Ori Kam
@ 2024-02-07 11:31 ` Dariusz Sosnowski
0 siblings, 0 replies; 14+ messages in thread
From: Dariusz Sosnowski @ 2024-02-07 11:31 UTC (permalink / raw)
To: Ori Kam, Slava Ovsiienko, dev; +Cc: Matan Azrad, Raslan Darawsheh
> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Tuesday, February 6, 2024 14:01
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Dariusz Sosnowski <dsosnowski@nvidia.com>
> Subject: RE: [PATCH 1/6] ethdev: add modify IPv4 next protocol field
>
> Hi Slava
>
> > -----Original Message-----
> > From: Slava Ovsiienko <viacheslavo@nvidia.com>
> > Sent: Tuesday, February 6, 2024 2:18 PM <dsosnowski@nvidia.com>
> > Subject: [PATCH 1/6] ethdev: add modify IPv4 next protocol field
> >
> > Add IPv4 next protocol modify field definition.
> >
> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> > ---
> > doc/guides/rel_notes/release_24_03.rst | 1 +
> > lib/ethdev/rte_flow.h | 3 ++-
> > 2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/guides/rel_notes/release_24_03.rst
> > b/doc/guides/rel_notes/release_24_03.rst
> > index 2b91217943..33e9303ae1 100644
> > --- a/doc/guides/rel_notes/release_24_03.rst
> > +++ b/doc/guides/rel_notes/release_24_03.rst
> > @@ -64,6 +64,7 @@ New Features
> >
> > * Added ``RTE_FLOW_ITEM_TYPE_RANDOM`` to match random value.
> > * Added ``RTE_FLOW_FIELD_RANDOM`` to represent it in field ID struct.
> > + * Added ``RTE_FLOW_FIELD_IPV4_PROTO`` to represent it in field ID
> > struct.
> >
> > * ** Support for getting the number of used descriptors of a Tx
> > queue. **
> >
> > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index
> > 1267c146e5..84af730dc7 100644
> > --- a/lib/ethdev/rte_flow.h
> > +++ b/lib/ethdev/rte_flow.h
> > @@ -3933,7 +3933,8 @@ enum rte_flow_field_id {
> > RTE_FLOW_FIELD_IPV4_IHL, /**< IPv4 IHL. */
> > RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */
> > RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */
> > - RTE_FLOW_FIELD_RANDOM /**< Random value. */
> > + RTE_FLOW_FIELD_RANDOM, /**< Random value. */
> > + RTE_FLOW_FIELD_IPV4_PROTO /**< IPv4 next protocol. */
> > };
> >
> > /**
> > --
> > 2.18.1
>
> Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Best regards,
Dariusz Sosnowski
^ permalink raw reply [flat|nested] 14+ messages in thread