diff options
author | Roi Dayan <roid@nvidia.com> | 2021-12-02 14:47:45 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2022-02-16 23:55:17 -0800 |
commit | b070e70381ee343dc10d2b1f0f3a6b1f940f0ae5 (patch) | |
tree | 02fb70dda94c3342f843bce61ce99fe2578a14c6 | |
parent | 7843bd604081b5f005b31343cde1bb680bcc1776 (diff) |
net/mlx5e: TC, Allow sample action with CT
Allow sample+CT actions but still block sample+CT NAT
as it is not supported.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c | 8 |
2 files changed, 5 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c index 1492d3e49c59..7368f95f2310 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c @@ -14,12 +14,6 @@ tc_act_can_offload_ct(struct mlx5e_tc_act_parse_state *parse_state, bool clear_action = act->ct.action & TCA_CT_ACT_CLEAR; struct netlink_ext_ack *extack = parse_state->extack; - if (flow_flag_test(parse_state->flow, SAMPLE)) { - NL_SET_ERR_MSG_MOD(extack, - "Sample action with connection tracking is not supported"); - return false; - } - if (parse_state->ct && !clear_action) { NL_SET_ERR_MSG_MOD(extack, "Multiple CT actions are not supported"); return false; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c index f39538e3d027..2c0196431302 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c @@ -13,10 +13,12 @@ tc_act_can_offload_sample(struct mlx5e_tc_act_parse_state *parse_state, struct mlx5_flow_attr *attr) { struct netlink_ext_ack *extack = parse_state->extack; + bool ct_nat; - if (flow_flag_test(parse_state->flow, CT)) { - NL_SET_ERR_MSG_MOD(extack, - "Sample action with connection tracking is not supported"); + ct_nat = attr->ct_attr.ct_action & TCA_CT_ACT_NAT; + + if (flow_flag_test(parse_state->flow, CT) && ct_nat) { + NL_SET_ERR_MSG_MOD(extack, "Sample action with CT NAT is not supported"); return false; } |