All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix matcher priority for esp item
@ 2022-07-28 14:12 Bassam ZaidAlKilani
  2022-08-17  7:21 ` Slava Ovsiienko
  2022-08-17  8:19 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Bassam ZaidAlKilani @ 2022-07-28 14:12 UTC (permalink / raw)
  To: dev; +Cc: rasland, rzidane, stable, Matan Azrad, Viacheslav Ovsiienko

ESP is one of IPSec protocols over both IPv4 and IPv6 and is considered
a tunnel layer that cannot be followed by any other layer. Taking that
into consideration, esp is considered as a 4 layer.

Not defining ESP's priority will make it match with the same priority as
its prior IP layer, which has a layer 3 priority. This will lead to
issues in matching and will match the packet with the first matching
rule even if it doesn't have an esp layer in its pattern, disregarding
any following rules that could have an esp item and can be actually
a more accurate match since it will have a longer matching criterion.

This is fixed by defining the priority for the ESP item to have a
layer 4 priority, making the match be for the rule with the more
accurate and longer matching criteria.

Fixes: 18ca4a4ec73a ("net/mlx5: support ESP SPI match and RSS hash")
Cc: rzidane@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Bassam ZaidAlKilani <bzalkilani@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index bee9363515..47135a0208 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -13756,6 +13756,7 @@ flow_dv_translate(struct rte_eth_dev *dev,
 		case RTE_FLOW_ITEM_TYPE_ESP:
 			flow_dv_translate_item_esp(match_mask, match_value,
 						   items, tunnel);
+			matcher.priority = MLX5_PRIORITY_MAP_L4;
 			last_item = MLX5_FLOW_ITEM_ESP;
 			break;
 		case RTE_FLOW_ITEM_TYPE_PORT_ID:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/mlx5: fix matcher priority for esp item
  2022-07-28 14:12 [PATCH] net/mlx5: fix matcher priority for esp item Bassam ZaidAlKilani
@ 2022-08-17  7:21 ` Slava Ovsiienko
  2022-08-17  8:19 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Slava Ovsiienko @ 2022-08-17  7:21 UTC (permalink / raw)
  To: Bassam Zaid AlKilani, dev; +Cc: Raslan Darawsheh, rzidane, stable, Matan Azrad

> -----Original Message-----
> From: Bassam Zaid AlKilani <bzalkilani@nvidia.com>
> Sent: Thursday, July 28, 2022 17:12
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; rzidane@nvidia.com;
> stable@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Subject: [PATCH] net/mlx5: fix matcher priority for esp item
> 
> ESP is one of IPSec protocols over both IPv4 and IPv6 and is considered a
> tunnel layer that cannot be followed by any other layer. Taking that into
> consideration, esp is considered as a 4 layer.
> 
> Not defining ESP's priority will make it match with the same priority as its
> prior IP layer, which has a layer 3 priority. This will lead to issues in
> matching and will match the packet with the first matching rule even if it
> doesn't have an esp layer in its pattern, disregarding any following rules
> that could have an esp item and can be actually a more accurate match since
> it will have a longer matching criterion.
> 
> This is fixed by defining the priority for the ESP item to have a layer 4
> priority, making the match be for the rule with the more accurate and longer
> matching criteria.
> 
> Fixes: 18ca4a4ec73a ("net/mlx5: support ESP SPI match and RSS hash")
> Cc: rzidane@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bassam ZaidAlKilani <bzalkilani@nvidia.com>

Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] net/mlx5: fix matcher priority for esp item
  2022-07-28 14:12 [PATCH] net/mlx5: fix matcher priority for esp item Bassam ZaidAlKilani
  2022-08-17  7:21 ` Slava Ovsiienko
@ 2022-08-17  8:19 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2022-08-17  8:19 UTC (permalink / raw)
  To: Bassam Zaid AlKilani, dev; +Cc: rzidane, stable, Matan Azrad, Slava Ovsiienko

Hi,

> -----Original Message-----
> From: Bassam Zaid AlKilani <bzalkilani@nvidia.com>
> Sent: Thursday, July 28, 2022 5:12 PM
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@nvidia.com>; rzidane@nvidia.com;
> stable@dpdk.org; Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Subject: [PATCH] net/mlx5: fix matcher priority for esp item
> 
> ESP is one of IPSec protocols over both IPv4 and IPv6 and is considered
> a tunnel layer that cannot be followed by any other layer. Taking that
> into consideration, esp is considered as a 4 layer.
> 
> Not defining ESP's priority will make it match with the same priority as
> its prior IP layer, which has a layer 3 priority. This will lead to
> issues in matching and will match the packet with the first matching
> rule even if it doesn't have an esp layer in its pattern, disregarding
> any following rules that could have an esp item and can be actually
> a more accurate match since it will have a longer matching criterion.
> 
> This is fixed by defining the priority for the ESP item to have a
> layer 4 priority, making the match be for the rule with the more
> accurate and longer matching criteria.
> 
> Fixes: 18ca4a4ec73a ("net/mlx5: support ESP SPI match and RSS hash")
> Cc: rzidane@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bassam ZaidAlKilani <bzalkilani@nvidia.com>[Raslan Darawsheh] 
Acked-by: Raslan Darawsheh <rasland@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-17  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-28 14:12 [PATCH] net/mlx5: fix matcher priority for esp item Bassam ZaidAlKilani
2022-08-17  7:21 ` Slava Ovsiienko
2022-08-17  8:19 ` Raslan Darawsheh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.