]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Move sample attr allocation to tc_action sample parse op
authorRoi Dayan <roid@nvidia.com>
Thu, 12 Aug 2021 13:02:58 +0000 (16:02 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 15 Dec 2021 05:29:45 +0000 (21:29 -0800)
commitc4c3d3d87bc7ac7e210c794f9e6c253b554c6c2b
treeb0e4826a4d58c5410067038efe2b064ae82abfe9
parent9d24c0a0b25459d1a025b5307b9db17718b8728e
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>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/sample.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c