Skip to content

Commit 56617e1

Browse files
Jianbo Liukuba-moo
authored andcommitted
net/mlx5e: TC, Don't offload CT commit if it's the last action
For CT action with commit argument, it's usually followed by the forward action, either to the output netdev or next chain. The default behavior for software is to drop by setting action attribute to TC_ACT_SHOT instead of TC_ACT_PIPE if it's the last action. But driver can't handle it, so block the offload for such case. Signed-off-by: Jianbo Liu <jianbol@nvidia.com> Reviewed-by: Roi Dayan <roid@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/1742392983-153050-6-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0fe2347 commit 56617e1

File tree

1 file changed

+11
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en/tc/act

1 file changed

+11
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
#include "en/tc_priv.h"
66
#include "en/tc_ct.h"
77

8+
static bool
9+
tc_act_can_offload_ct(struct mlx5e_tc_act_parse_state *parse_state,
10+
const struct flow_action_entry *act,
11+
int act_index,
12+
struct mlx5_flow_attr *attr)
13+
{
14+
return !((act->ct.action & TCA_CT_ACT_COMMIT) &&
15+
flow_action_is_last_entry(parse_state->flow_action, act));
16+
}
17+
818
static int
919
tc_act_parse_ct(struct mlx5e_tc_act_parse_state *parse_state,
1020
const struct flow_action_entry *act,
@@ -56,6 +66,7 @@ tc_act_is_missable_ct(const struct flow_action_entry *act)
5666
}
5767

5868
struct mlx5e_tc_act mlx5e_tc_act_ct = {
69+
.can_offload = tc_act_can_offload_ct,
5970
.parse_action = tc_act_parse_ct,
6071
.post_parse = tc_act_post_parse_ct,
6172
.is_multi_table_act = tc_act_is_multi_table_act_ct,

0 commit comments

Comments
 (0)