Skip to content

Commit 3cfc433

Browse files
Paul BlakeySaeed Mahameed
authored andcommitted
net/mlx5e: CT: Fix insert rules when TC_CT config isn't enabled
If CONFIG_MLX5_TC_CT isn't enabled, all offloading of eswitch tc rules fails on parsing ct match, even if there is no ct match. Return success if there is no ct match, regardless of config. Fixes: 4c3844d ("net/mlx5e: CT: Introduce connection tracking") Signed-off-by: Paul Blakey <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 35e725e commit 3cfc433

File tree

1 file changed

+9
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/en

1 file changed

+9
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <linux/mlx5/fs.h>
99
#include <net/tc_act/tc_ct.h>
1010

11+
#include "en.h"
12+
1113
struct mlx5_esw_flow_attr;
1214
struct mlx5e_tc_mod_hdr_acts;
1315
struct mlx5_rep_uplink_priv;
@@ -128,6 +130,11 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
128130
struct flow_cls_offload *f,
129131
struct netlink_ext_ack *extack)
130132
{
133+
if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
134+
return 0;
135+
136+
NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");
137+
netdev_warn(priv->netdev, "mlx5 tc ct offload isn't enabled.\n");
131138
return -EOPNOTSUPP;
132139
}
133140

@@ -137,6 +144,8 @@ mlx5_tc_ct_parse_action(struct mlx5e_priv *priv,
137144
const struct flow_action_entry *act,
138145
struct netlink_ext_ack *extack)
139146
{
147+
NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");
148+
netdev_warn(priv->netdev, "mlx5 tc ct offload isn't enabled.\n");
140149
return -EOPNOTSUPP;
141150
}
142151

0 commit comments

Comments
 (0)