Implement macro for asserting priv lock in mlx5en.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2019-10-02 09:16:17 +00:00
parent 2e16440940
commit 2db3dd5061
2 changed files with 3 additions and 0 deletions

View File

@ -988,6 +988,7 @@ struct mlx5e_priv {
#define PRIV_LOCK(priv) sx_xlock(&(priv)->state_lock)
#define PRIV_UNLOCK(priv) sx_xunlock(&(priv)->state_lock)
#define PRIV_LOCKED(priv) sx_xlocked(&(priv)->state_lock)
#define PRIV_ASSERT_LOCKED(priv) sx_assert(&(priv)->state_lock, SA_XLOCKED)
struct sx state_lock; /* Protects Interface state */
struct mlx5_uar cq_uar;
u32 pdn;

View File

@ -772,6 +772,8 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *priv)
struct ifaddr *ifa;
struct ifmultiaddr *ifma;
PRIV_ASSERT_LOCKED(priv);
/* XXX adding this entry might not be needed */
mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc,
LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr)));