]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Eswitch, change offloads num_flows type to atomic64
authorVlad Buslov <vladbu@mellanox.com>
Sun, 18 Nov 2018 11:12:59 +0000 (13:12 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 29 Jul 2019 23:40:25 +0000 (16:40 -0700)
commitcda300cc9a5de087a4c69e817d397ff0b8e04e93
tree18bb79fb523e1a7638bd0c7dcfdc72c8b32946d3
parent1e964dca71c938aa4fa76c6fe6a9845734ff2d61
net/mlx5e: Eswitch, change offloads num_flows type to atomic64

Eswitch implements its own locking by means of state_lock mutex and
multiple fine-grained lock in containing data structures, and is supposed
to not rely on rtnl lock. However, eswitch offloads num_flows type is a
regular long long integer and cannot be modified concurrently. This is an
implicit assumptions that mlx5 tc is serialized (by rtnl lock or any other
means). In order to remove implicit dependency on rtnl lock, change
num_flows type to atomic64 to allow concurrent modifications.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Jianbo Liu <jianbol@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c