net/mlx5: fix GRE item matching
PATCH 1/1 net/mlx5: fix GRE item matching
GRE protocol type is implicitly set in the matching translation in case an application doesn't specify any type explicitly in a flow rule. It is extracted from the inner header type, but this type may be absent. In this case, GRE item matching is broken. Check if we have the inner header type before setting it to allow matching on all GRE packets.
--- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +2 -1
@@ -8823,8 +8823,9 @@ flow_dv_translate_item_gre(void *matcher, void *key, protocol_v =rte_be_to_cpu_16 (gre_v->protocol);if (!protocol_m) {/* Force next protocol to prevent matchers duplication */ - protocol_m =0xFFFF ; protocol_v =mlx5_translate_tunnel_etypes (pattern_flags); +if (protocol_v) + protocol_m =0xFFFF ; }MLX5_SET (fte_match_set_misc, misc_m, gre_protocol, protocol_m); MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
Signature · 1 line
2.18.2
Quoted 15 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Wednesday, November 24, 2021 6:33
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Gregory Etelson <[email protected]>
Subject: [PATCH] net/mlx5: fix GRE item matchingGRE protocol type is implicitly set in the matching translation in case an application doesn't specify any type explicitly in a flow rule. It is extracted from the inner header type, but this type may be absent. In this case, GRE item matching is broken. Check if we have the inner header type before setting it to allow matching on all GRE packets.
Quoted 4 lines
Fixes be26e81bfc1c ("net/mlx5: fix GRE protocol type translation")Signed-off-by Alexander Kozyrev <[email protected]>
Hi,
Quoted 15 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Wednesday, November 24, 2021 6:33 AM
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>; Gregory Etelson <[email protected]>
Subject: [PATCH] net/mlx5: fix GRE item matchingGRE protocol type is implicitly set in the matching translation in case an application doesn't specify any type explicitly in a flow rule. It is extracted from the inner header type, but this type may be absent. In this case, GRE item matching is broken. Check if we have the inner header type before setting it to allow matching on all GRE packets.
Quoted 5 lines
Fixes be26e81bfc1c ("net/mlx5: fix GRE protocol type translation")Signed-off-by Alexander Kozyrev <[email protected]>---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh