From 1e3439046b837d3b596a7daedcfe2ba253add841 Mon Sep 17 00:00:00 2001 From: Hamdan Igbaria Date: Mon, 18 Dec 2023 13:29:57 +0200 Subject: [PATCH] mlx5: DR, Fix ASO CT action applying in cross domain [ Upstream commit e692a549428d5f8253955acc0597b5d3160d9d5c ] Fix ASO CT action applying in cross domain, instead of checking if the GVMI's of the domains are different, check if the domains are different, since we can have both domains on the same GVMI. This fix will allow two different domains on the same GVMI to share the same ASO CT action. Fixes: 730329f392f3 ("mlx5: DR, Support ASO CT cross domain") Signed-off-by: Hamdan Igbaria Reviewed-by: Erez Shitrit Signed-off-by: Yishai Hadas Signed-off-by: Nicolas Morey --- providers/mlx5/dr_action.c | 1 + providers/mlx5/dr_ste_v1.c | 8 ++++---- providers/mlx5/mlx5dv_dr.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/providers/mlx5/dr_action.c b/providers/mlx5/dr_action.c index 94cfad2ed..09300dc31 100644 --- a/providers/mlx5/dr_action.c +++ b/providers/mlx5/dr_action.c @@ -614,6 +614,7 @@ int dr_actions_build_ste_arr(struct mlx5dv_dr_matcher *matcher, uint8_t *last_ste; int i; + attr.dmn = dmn; attr.gvmi = dmn->info.caps.gvmi; attr.hit_gvmi = dmn->info.caps.gvmi; attr.final_icm_addr = nic_dmn->default_icm_addr; diff --git a/providers/mlx5/dr_ste_v1.c b/providers/mlx5/dr_ste_v1.c index e59d5cbba..534320f58 100644 --- a/providers/mlx5/dr_ste_v1.c +++ b/providers/mlx5/dr_ste_v1.c @@ -727,7 +727,7 @@ static void dr_ste_v1_set_actions_tx(uint8_t *action_type_set, } if (action_type_set[DR_ACTION_TYP_ASO_CT]) { - if (attr->aso->dmn->info.caps.gvmi != attr->gvmi || + if (attr->aso->dmn != attr->dmn || action_sz < DR_STE_ACTION_DOUBLE_SZ) { dr_ste_v1_arr_init_next_match(&last_ste, added_stes, attr->gvmi); @@ -736,7 +736,7 @@ static void dr_ste_v1_set_actions_tx(uint8_t *action_type_set, action_sz = DR_STE_ACTION_TRIPLE_SZ; } - if (attr->aso->dmn->info.caps.gvmi != attr->gvmi) { + if (attr->aso->dmn != attr->dmn) { attr->aso_ste_loc = ste_loc; } else { dr_ste_v1_set_aso_ct(action, @@ -991,7 +991,7 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set, } if (action_type_set[DR_ACTION_TYP_ASO_CT]) { - if (attr->aso->dmn->info.caps.gvmi != attr->gvmi || + if (attr->aso->dmn != attr->dmn || action_sz < DR_STE_ACTION_DOUBLE_SZ) { dr_ste_v1_arr_init_next_match(&last_ste, added_stes, attr->gvmi); @@ -1001,7 +1001,7 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set, allow_ctr = true; } - if (attr->aso->dmn->info.caps.gvmi != attr->gvmi) { + if (attr->aso->dmn != attr->dmn) { attr->aso_ste_loc = ste_loc; } else { dr_ste_v1_set_aso_ct(action, diff --git a/providers/mlx5/mlx5dv_dr.h b/providers/mlx5/mlx5dv_dr.h index 1269c36b9..bbef97c0a 100644 --- a/providers/mlx5/mlx5dv_dr.h +++ b/providers/mlx5/mlx5dv_dr.h @@ -387,6 +387,7 @@ struct dr_ste_actions_attr { } vlans; struct dr_action_aso *aso; uint32_t aso_ste_loc; + struct mlx5dv_dr_domain *dmn; }; struct cross_dmn_params {