Skip to content

Commit

Permalink
net/mlx5: fix GRE flow item translation for root table
Browse files Browse the repository at this point in the history
Flow items translations for the root tables reuse DV code. However,
the DV GRE item translation did not initialize the item mask for HWS
template. Initialize the mask to fix GRE item translation for root
tables when using HWS.

Fixes: cd4ab74 ("net/mlx5: split flow item matcher and value translation")
Cc: [email protected]

Signed-off-by: Gregory Etelson <[email protected]>
Acked-by: Suanming Mou <[email protected]>
  • Loading branch information
getelson-at-mellanox authored and raslandarawsheh committed Oct 31, 2024
1 parent 4dd46d3 commit 25ab2cb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions drivers/net/mlx5/mlx5_flow_dv.c
Original file line number Diff line number Diff line change
Expand Up @@ -9830,22 +9830,23 @@ flow_dv_translate_item_gre(void *key, const struct rte_flow_item *item,
} gre_crks_rsvd0_ver_m, gre_crks_rsvd0_ver_v;
uint16_t protocol_m, protocol_v;

if (key_type & MLX5_SET_MATCHER_M)
if (key_type & MLX5_SET_MATCHER_M) {
MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol, 0xff);
else
if (!gre_m)
gre_m = &rte_flow_item_gre_mask;
gre_v = gre_m;
} else {
MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_protocol,
IPPROTO_GRE);
if (!gre_v) {
gre_v = &empty_gre;
gre_m = &empty_gre;
} else {
if (!gre_m)
if (!gre_v) {
gre_v = &empty_gre;
gre_m = &empty_gre;
} else if (!gre_m) {
gre_m = &rte_flow_item_gre_mask;
}
if (key_type == MLX5_SET_MATCHER_HS_V)
gre_m = gre_v;
}
if (key_type & MLX5_SET_MATCHER_M)
gre_v = gre_m;
else if (key_type == MLX5_SET_MATCHER_HS_V)
gre_m = gre_v;
gre_crks_rsvd0_ver_m.value = rte_be_to_cpu_16(gre_m->c_rsvd0_ver);
gre_crks_rsvd0_ver_v.value = rte_be_to_cpu_16(gre_v->c_rsvd0_ver);
MLX5_SET(fte_match_set_misc, misc_v, gre_c_present,
Expand Down

0 comments on commit 25ab2cb

Please sign in to comment.