Skip to content

Commit

Permalink
mlx5: DR, Fix handling of different actions on the same STE in STEv1
Browse files Browse the repository at this point in the history
Fix handling of various conditions in set_actions_rx/tx that check
whether different actions can be on the same STE.

Fixes: 0cc689d ("mlx5: DR, Enable VLAN pop on TX and VLAN push on RX")
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
  • Loading branch information
kliteyn authored and Yishai Hadas committed Feb 23, 2022
1 parent c590950 commit 8fccbdb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions providers/mlx5/dr_ste_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ static void dr_ste_v1_set_actions_tx(uint8_t *action_type_set,
action = DEVX_ADDR_OF(ste_mask_and_match_v1, last_ste,
action);
action_sz = DR_STE_ACTION_TRIPLE_SZ;
allow_pop_vlan = false;
ste_loc++;
}

Expand All @@ -699,6 +698,7 @@ static void dr_ste_v1_set_actions_tx(uint8_t *action_type_set,

action_sz -= DR_STE_ACTION_DOUBLE_SZ;
action += DR_STE_ACTION_DOUBLE_SZ;
allow_pop_vlan = false;
}

if (action_type_set[DR_ACTION_TYP_POP_VLAN]) {
Expand All @@ -713,7 +713,6 @@ static void dr_ste_v1_set_actions_tx(uint8_t *action_type_set,
dr_ste_v1_set_pop_vlan(last_ste, action, attr->vlans.count_pop);
action_sz -= DR_STE_ACTION_SINGLE_SZ;
action += DR_STE_ACTION_SINGLE_SZ;
allow_modify_hdr = false;
}

if (action_type_set[DR_ACTION_TYP_ASO_CT]) {
Expand Down Expand Up @@ -884,14 +883,13 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set,
dr_ste_v1_arr_init_next_match(&last_ste, added_stes, attr->gvmi);
action = DEVX_ADDR_OF(ste_mask_and_match_v1, last_ste, action);
action_sz = DR_STE_ACTION_TRIPLE_SZ;
allow_modify_hdr = false;
allow_ctr = false;
ste_loc++;
}

dr_ste_v1_set_pop_vlan(last_ste, action, attr->vlans.count_pop);
action_sz -= DR_STE_ACTION_SINGLE_SZ;
action += DR_STE_ACTION_SINGLE_SZ;
allow_ctr = false;
}

if (action_type_set[DR_ACTION_TYP_ASO_FIRST_HIT]) {
Expand Down Expand Up @@ -960,7 +958,6 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set,
action = DEVX_ADDR_OF(ste_mask_and_match_v1, last_ste,
action);
action_sz = DR_STE_ACTION_TRIPLE_SZ;
allow_modify_hdr = false;
allow_ctr = true;
ste_loc++;
}
Expand All @@ -972,6 +969,7 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set,

action_sz -= DR_STE_ACTION_DOUBLE_SZ;
action += DR_STE_ACTION_DOUBLE_SZ;
allow_modify_hdr = false;
}

if (action_type_set[DR_ACTION_TYP_ASO_CT]) {
Expand Down Expand Up @@ -1006,9 +1004,9 @@ static void dr_ste_v1_set_actions_rx(uint8_t *action_type_set,
action = DEVX_ADDR_OF(ste_mask_and_match_v1, last_ste, action);
action_sz = DR_STE_ACTION_TRIPLE_SZ;
allow_modify_hdr = true;
allow_ctr = false;
}
dr_ste_v1_set_counter_id(last_ste, attr->ctr_id);
allow_ctr = false;
}

if (action_type_set[DR_ACTION_TYP_L2_TO_TNL_L2]) {
Expand Down

0 comments on commit 8fccbdb

Please sign in to comment.