aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
diff options
context:
space:
mode:
authorRoi Dayan <roid@nvidia.com>2021-08-12 16:02:58 +0300
committerSaeed Mahameed <saeedm@nvidia.com>2021-12-14 21:29:45 -0800
commit6bcba1bdeda57cd36317f616253e387fb14e70ee (patch)
treeb0e4826a4d58c5410067038efe2b064ae82abfe9 /drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
parentnet/mlx5e: TC action parsing loop (diff)
downloadlinux-dev-6bcba1bdeda57cd36317f616253e387fb14e70ee.tar.xz
linux-dev-6bcba1bdeda57cd36317f616253e387fb14e70ee.zip
net/mlx5e: Move sample attr allocation to tc_action sample parse op
There is no reason to wait with the kmalloc to after parsing all other actions. There could still be a failure later and before offloading the rule. So alloc the mem when parsing. The memory is being released on mlx5e_flow_put() which is called also on error flow. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Oz Shlomo <ozsh@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index a3f414171ca5..c6c6d20ecd09 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -3425,16 +3425,6 @@ parse_tc_fdb_actions(struct mlx5e_priv *priv,
return -EOPNOTSUPP;
}
- /* Allocate sample attribute only when there is a sample action and
- * no errors after parsing.
- */
- if (flow_flag_test(flow, SAMPLE)) {
- attr->sample_attr = kzalloc(sizeof(*attr->sample_attr), GFP_KERNEL);
- if (!attr->sample_attr)
- return -ENOMEM;
- *attr->sample_attr = parse_state->sample_attr;
- }
-
return 0;
}