DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongwei Liu <rongweil@nvidia.com>
To: <dev@dpdk.org>, <matan@nvidia.com>, <viacheslavo@nvidia.com>,
	<orika@nvidia.com>, <suanmingm@nvidia.com>, <thomas@monjalon.net>
Cc: <stable@dpdk.org>, Erez Shitrit <erezsh@nvidia.com>
Subject: [PATCH v1 1/2] net/mlx5/hws: disable IPv6 routing extension relaxed mode
Date: Thu, 9 Nov 2023 10:40:56 +0200	[thread overview]
Message-ID: <20231109084057.452476-2-rongweil@nvidia.com> (raw)
In-Reply-To: <20231109084057.452476-1-rongweil@nvidia.com>

When relaxed mode is set, definer only programs the fields with
mask in the pattern template.

Assume a template like "ipv6_routing_ext ext_next_hdr mask 0xff ext_type
mask 0xff  / udp dst mask 0xffff" and rule like "ipv6_routing_ext
ext_next_hdr spec 17 ext_next_hdr mask 0xff ext_type spec 4 ext_type
mask 0xff / udp dst spec 100 dst mask 0xffff", there is a potential
mis-matching.

1. User sends first packet as:
   Ether()/IPv6()/IPv6ExtHdrSegmentRouting()/UDP(sport=100,dport=200)
   Miss due to unexpected UDP dport.
2. User sends 2nd packet as:
   Ether()/IPv6()/UDP(sport=100,dport=100)
   Packet hit. Hardware cached the IPv6 routing extension information
   in the 1st packet and plus the UDP dport in the 2nd packet, it
   matches the rule by mistake.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Cc: stable@dpdk.org

Reviewed-by: Erez Shitrit <erezsh@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 7dffbfb9b9..c0ccde64e1 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -2143,6 +2143,9 @@ mlx5dr_definer_conv_item_ipv6_routing_ext(struct mlx5dr_definer_conv_data *cd,
 			fc->tag_mask_set = &mlx5dr_definer_ones_set;
 			DR_CALC_SET(fc, eth_l3, protocol_next_header, inner);
 		}
+	} else {
+		rte_errno = ENOTSUP;
+		return rte_errno;
 	}
 
 	if (!m)
-- 
2.27.0


  reply	other threads:[~2023-11-09  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  8:40 [PATCH v1 0/2] fix IPv6 routing extension mismatching Rongwei Liu
2023-11-09  8:40 ` Rongwei Liu [this message]
2023-11-09  8:40 ` [PATCH v1 2/2] net/mlx5/hws: fix srv6 mismatching Rongwei Liu
2023-11-12 14:26 ` [PATCH v1 0/2] fix IPv6 routing extension mismatching Raslan Darawsheh

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=20231109084057.452476-2-rongweil@nvidia.com \
    --to=rongweil@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=erezsh@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --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).