DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michael Baum <michaelba@nvidia.com>
To: <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	 Raslan Darawsheh <rasland@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Alex Vesker <valex@nvidia.com>
Subject: [PATCH] net/mlx5/hws: add fragment packet ID matching support
Date: Mon, 8 Apr 2024 09:32:10 +0300	[thread overview]
Message-ID: <20240408063210.2600860-1-michaelba@nvidia.com> (raw)

Add HWS support of IPv4 fragment packet id field matching.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 11 ++++++++++-
 drivers/net/mlx5/hws/mlx5dr_definer.h |  2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 35a2ed2048..43be512b27 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -171,6 +171,7 @@ struct mlx5dr_definer_conv_data {
 	X(SET,		ipv4_version,		STE_IPV4,		rte_ipv4_hdr) \
 	X(SET_BE16,	ipv4_frag,		v->fragment_offset,	rte_ipv4_hdr) \
 	X(SET_BE16,	ipv4_len,		v->total_length,	rte_ipv4_hdr) \
+	X(SET_BE16,	ipv4_identification,	v->packet_id,		rte_ipv4_hdr) \
 	X(SET,          ip_fragmented,          !!v->fragment_offset,   rte_ipv4_hdr) \
 	X(SET_BE16,	ipv6_payload_len,	v->hdr.payload_len,	rte_flow_item_ipv6) \
 	X(SET,		ipv6_proto,		v->hdr.proto,		rte_flow_item_ipv6) \
@@ -1026,7 +1027,7 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
 	if (!m)
 		return 0;
 
-	if (m->packet_id || m->hdr_checksum ||
+	if (m->hdr_checksum ||
 	    (l && (l->next_proto_id || l->type_of_service))) {
 		rte_errno = ENOTSUP;
 		return rte_errno;
@@ -1060,6 +1061,14 @@ mlx5dr_definer_conv_item_ipv4(struct mlx5dr_definer_conv_data *cd,
 		DR_CALC_SET(fc, eth_l3, protocol_next_header, inner);
 	}
 
+	if (m->packet_id) {
+		fc = &cd->fc[DR_CALC_FNAME(IP_ID, inner)];
+		fc->item_idx = item_idx;
+		fc->is_range = l && l->packet_id;
+		fc->tag_set = &mlx5dr_definer_ipv4_identification_set;
+		DR_CALC_SET(fc, eth_l3, identification, inner);
+	}
+
 	if (m->total_length) {
 		fc = &cd->fc[DR_CALC_FNAME(IP_LEN, inner)];
 		fc->item_idx = item_idx;
diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.h b/drivers/net/mlx5/hws/mlx5dr_definer.h
index ca530ebf30..a42ba9b81a 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.h
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.h
@@ -75,6 +75,8 @@ enum mlx5dr_definer_fname {
 	MLX5DR_DEFINER_FNAME_IP_VERSION_I,
 	MLX5DR_DEFINER_FNAME_IP_FRAG_O,
 	MLX5DR_DEFINER_FNAME_IP_FRAG_I,
+	MLX5DR_DEFINER_FNAME_IP_ID_O,
+	MLX5DR_DEFINER_FNAME_IP_ID_I,
 	MLX5DR_DEFINER_FNAME_IP_LEN_O,
 	MLX5DR_DEFINER_FNAME_IP_LEN_I,
 	MLX5DR_DEFINER_FNAME_IP_TOS_O,
-- 
2.25.1


                 reply	other threads:[~2024-04-08  6:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240408063210.2600860-1-michaelba@nvidia.com \
    --to=michaelba@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=valex@nvidia.com \
    --cc=viacheslavo@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).