[dpdk-stable] patch 'net/mlx5: fix matching for ICMP fragments' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 27 10:33:30 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/29/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 2d8874356471c962a855fe674506dfe8387ea2ef Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz at mellanox.com>
Date: Mon, 17 Feb 2020 22:10:55 +0800
Subject: [PATCH] net/mlx5: fix matching for ICMP fragments

[ upstream commit 72dcb9177367e84f2566a067dc3c65ec2a800c13 ]

The hardware can recognize and mark the layer 4 protocol type for TCP,
UDP and IPSec non-fragmented packets. For all the fragmented packets,
L4 type will be considered as None. This can be used when creating a
flow with L4 matching, then hops number will be reduced and a better
performance could be gained.

But for ICMP packets, it cannot be recognized correctly because it is
not a L4 protocol in the stack, even if the packet format is similar.

All the fragmented and non-fragmented ICMP will have the None L4 type.
Fragmented packets with incomplete headers could not hit the flow,
even for the first fragment. Because then it will make it complex to
defragment for both HW and SW. For other types, the implicit rules
could be used directly and all the fragments will miss the flow.

For ICMP packets, this should be done explicitly because all packets
have None type. The first fragment will still hit the flow if there is
no explicit rule.

All ICMP fragments will still hit the rules like ETH, ETH + IP, and
ETH + IP + "ICMP protocol" only since they are wildcard rules, and
there is no next layer protocol specified field in such rules.

Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6")

Signed-off-by: Bing Zhao <bingz at mellanox.com>
Acked-by: Ori Kam <orika at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 57d3b1357d..cace0f31b5 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -6181,6 +6181,12 @@ flow_dv_translate_item_icmp6(void *matcher, void *key,
 		return;
 	if (!icmp6_m)
 		icmp6_m = &rte_flow_item_icmp6_mask;
+	/*
+	 * Force flow only to match the non-fragmented IPv6 ICMPv6 packets.
+	 * If only the protocol is specified, no need to match the frag.
+	 */
+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, 1);
+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, 0);
 	MLX5_SET(fte_match_set_misc3, misc3_m, icmpv6_type, icmp6_m->type);
 	MLX5_SET(fte_match_set_misc3, misc3_v, icmpv6_type,
 		 icmp6_v->type & icmp6_m->type);
@@ -6228,6 +6234,12 @@ flow_dv_translate_item_icmp(void *matcher, void *key,
 		return;
 	if (!icmp_m)
 		icmp_m = &rte_flow_item_icmp_mask;
+	/*
+	 * Force flow only to match the non-fragmented IPv4 ICMP packets.
+	 * If only the protocol is specified, no need to match the frag.
+	 */
+	MLX5_SET(fte_match_set_lyr_2_4, headers_m, frag, 1);
+	MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag, 0);
 	MLX5_SET(fte_match_set_misc3, misc3_m, icmp_type,
 		 icmp_m->hdr.icmp_type);
 	MLX5_SET(fte_match_set_misc3, misc3_v, icmp_type,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 09:31:56.175527120 +0000
+++ 0010-net-mlx5-fix-matching-for-ICMP-fragments.patch	2020-02-27 09:31:55.687945522 +0000
@@ -1,8 +1,10 @@
-From 72dcb9177367e84f2566a067dc3c65ec2a800c13 Mon Sep 17 00:00:00 2001
+From 2d8874356471c962a855fe674506dfe8387ea2ef Mon Sep 17 00:00:00 2001
 From: Bing Zhao <bingz at mellanox.com>
 Date: Mon, 17 Feb 2020 22:10:55 +0800
 Subject: [PATCH] net/mlx5: fix matching for ICMP fragments
 
+[ upstream commit 72dcb9177367e84f2566a067dc3c65ec2a800c13 ]
+
 The hardware can recognize and mark the layer 4 protocol type for TCP,
 UDP and IPSec non-fragmented packets. For all the fragmented packets,
 L4 type will be considered as None. This can be used when creating a
@@ -27,7 +29,6 @@
 there is no next layer protocol specified field in such rules.
 
 Fixes: d53aa89aea91 ("net/mlx5: support matching on ICMP/ICMP6")
-Cc: stable at dpdk.org
 
 Signed-off-by: Bing Zhao <bingz at mellanox.com>
 Acked-by: Ori Kam <orika at mellanox.com>
@@ -36,10 +37,10 @@
  1 file changed, 12 insertions(+)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index a8c8a585a4..341d51152a 100644
+index 57d3b1357d..cace0f31b5 100644
 --- a/drivers/net/mlx5/mlx5_flow_dv.c
 +++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -6403,6 +6403,12 @@ flow_dv_translate_item_icmp6(void *matcher, void *key,
+@@ -6181,6 +6181,12 @@ flow_dv_translate_item_icmp6(void *matcher, void *key,
  		return;
  	if (!icmp6_m)
  		icmp6_m = &rte_flow_item_icmp6_mask;
@@ -52,7 +53,7 @@
  	MLX5_SET(fte_match_set_misc3, misc3_m, icmpv6_type, icmp6_m->type);
  	MLX5_SET(fte_match_set_misc3, misc3_v, icmpv6_type,
  		 icmp6_v->type & icmp6_m->type);
-@@ -6450,6 +6456,12 @@ flow_dv_translate_item_icmp(void *matcher, void *key,
+@@ -6228,6 +6234,12 @@ flow_dv_translate_item_icmp(void *matcher, void *key,
  		return;
  	if (!icmp_m)
  		icmp_m = &rte_flow_item_icmp_mask;


More information about the stable mailing list