mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
net/mlx5: DR, Change push vlan action sequence
[ Upstream commit b206490940216542c68563699b279eed3c55107c ]
The DR TX state machine supports the following order:
modify header, push vlan and encapsulation.
Instead fs_dr would pass:
push vlan, modify header and encapsulation.
The above caused the rule creation to fail on invalid action
sequence provided error.
Fixes: 6a48faeeca ("net/mlx5: Add direct rule fs_cmd implementation")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a4301de4be
commit
87a43dac39
1 changed files with 21 additions and 21 deletions
|
|
@ -247,29 +247,9 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
|
|||
|
||||
/* The order of the actions are must to be keep, only the following
|
||||
* order is supported by SW steering:
|
||||
* TX: push vlan -> modify header -> encap
|
||||
* TX: modify header -> push vlan -> encap
|
||||
* RX: decap -> pop vlan -> modify header
|
||||
*/
|
||||
if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) {
|
||||
tmp_action = create_action_push_vlan(domain, &fte->action.vlan[0]);
|
||||
if (!tmp_action) {
|
||||
err = -ENOMEM;
|
||||
goto free_actions;
|
||||
}
|
||||
fs_dr_actions[fs_dr_num_actions++] = tmp_action;
|
||||
actions[num_actions++] = tmp_action;
|
||||
}
|
||||
|
||||
if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2) {
|
||||
tmp_action = create_action_push_vlan(domain, &fte->action.vlan[1]);
|
||||
if (!tmp_action) {
|
||||
err = -ENOMEM;
|
||||
goto free_actions;
|
||||
}
|
||||
fs_dr_actions[fs_dr_num_actions++] = tmp_action;
|
||||
actions[num_actions++] = tmp_action;
|
||||
}
|
||||
|
||||
if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_DECAP) {
|
||||
enum mlx5dr_action_reformat_type decap_type =
|
||||
DR_ACTION_REFORMAT_TYP_TNL_L2_TO_L2;
|
||||
|
|
@ -322,6 +302,26 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,
|
|||
actions[num_actions++] =
|
||||
fte->action.modify_hdr->action.dr_action;
|
||||
|
||||
if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH) {
|
||||
tmp_action = create_action_push_vlan(domain, &fte->action.vlan[0]);
|
||||
if (!tmp_action) {
|
||||
err = -ENOMEM;
|
||||
goto free_actions;
|
||||
}
|
||||
fs_dr_actions[fs_dr_num_actions++] = tmp_action;
|
||||
actions[num_actions++] = tmp_action;
|
||||
}
|
||||
|
||||
if (fte->action.action & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2) {
|
||||
tmp_action = create_action_push_vlan(domain, &fte->action.vlan[1]);
|
||||
if (!tmp_action) {
|
||||
err = -ENOMEM;
|
||||
goto free_actions;
|
||||
}
|
||||
fs_dr_actions[fs_dr_num_actions++] = tmp_action;
|
||||
actions[num_actions++] = tmp_action;
|
||||
}
|
||||
|
||||
if (delay_encap_set)
|
||||
actions[num_actions++] =
|
||||
fte->action.pkt_reformat->action.dr_action;
|
||||
|
|
|
|||
Loading…
Reference in a new issue