OSDN Git Service

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)
commit525e84bea52be145b0ae863ff8d242ce273e3bc6
tree18bb79fb523e1a7638bd0c7dcfdc72c8b32946d3
parentad86755b18d5edf1956f6d25c844f27289216877
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