diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2019-08-02 22:21:56 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-08-09 14:54:10 -0700 |
commit | 61086f391044fd587af9d70a9b8f6f800dd474ba (patch) | |
tree | 36d6585b6e191db6f64be8682b7f3a4c5ef5d6b6 /drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | |
parent | net/mlx5e: Extend encap entry with reference counter (diff) | |
download | linux-dev-61086f391044fd587af9d70a9b8f6f800dd474ba.tar.xz linux-dev-61086f391044fd587af9d70a9b8f6f800dd474ba.zip |
net/mlx5e: Protect encap hash table with mutex
To remove dependency on rtnl lock, protect encap hash table from concurrent
modifications with new "encap_tbl_lock" mutex. Use the mutex to protect
internal encap entry state from concurrent modification. This is necessary
because a flow can be attached to multiple encap entries simultaneously,
which significantly complicates using finer grained per-entry lock.
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index fd63ba4ed0da..86db0e9776da 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -181,6 +181,7 @@ struct mlx5_esw_offload { struct mlx5_eswitch_rep *vport_reps; struct list_head peer_flows; struct mutex peer_mutex; + struct mutex encap_tbl_lock; /* protects encap_tbl */ DECLARE_HASHTABLE(encap_tbl, 8); struct mod_hdr_tbl mod_hdr; DECLARE_HASHTABLE(termtbl_tbl, 8); |