]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: DR, No need for atomic refcount for internal SW steering resources
authorYevgeny Kliteynik <kliteyn@mellanox.com>
Mon, 23 Dec 2019 14:16:31 +0000 (16:16 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 6 Jan 2020 23:30:04 +0000 (15:30 -0800)
commitabd10409456495a65506dc17878103246a47fb66
treeb536b0fbad64f4b5f123e5d2828d81e145881e60
parent500dac69242a65f3836a4e076d54508ec106a4e4
net/mlx5: DR, No need for atomic refcount for internal SW steering resources

No need for an atomic refcounter for the STE and hashtables.
These are internal SW steering resources and they are always
under domain mutex.

This also fixes the following refcount error:
  refcount_t: addition on 0; use-after-free.
  WARNING: CPU: 9 PID: 3527 at lib/refcount.c:25 refcount_warn_saturate+0x81/0xe0
  Call Trace:
   dr_table_init_nic+0x10d/0x110 [mlx5_core]
   mlx5dr_table_create+0xb4/0x230 [mlx5_core]
   mlx5_cmd_dr_create_flow_table+0x39/0x120 [mlx5_core]
   __mlx5_create_flow_table+0x221/0x5f0 [mlx5_core]
   esw_create_offloads_fdb_tables+0x180/0x5a0 [mlx5_core]
   ...

Fixes: 50817192a518 ("net/mlx5: DR, Add Steering entry (STE) utilities")
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h