DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
To: <dev@dpdk.org>
Cc: <matan@nvidia.com>, <rasland@nvidia.com>, <orika@nvidia.com>,
	<dsosnowski@nvidia.com>
Subject: [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation
Date: Tue, 6 Feb 2024 14:17:33 +0200	[thread overview]
Message-ID: <20240206121736.27391-3-viacheslavo@nvidia.com> (raw)
In-Reply-To: <20240206121736.27391-1-viacheslavo@nvidia.com>

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


  parent reply	other threads:[~2024-02-06 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 13:03   ` Ori Kam
2024-02-07 11:34     ` Dariusz Sosnowski
2024-02-06 12:17 ` Viacheslav Ovsiienko [this message]
2024-02-07 11:36   ` [PATCH 3/6] net/mlx5: add modify IPv4 protocol implementation Dariusz Sosnowski
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
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
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
2024-02-06 13:00 ` [PATCH 1/6] ethdev: add modify IPv4 next protocol field Ori Kam
2024-02-07 11:31   ` Dariusz Sosnowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206121736.27391-3-viacheslavo@nvidia.com \
    --to=viacheslavo@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).