Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Oct 2019 09:16:18 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352961 - head/sys/dev/mlx5/mlx5_en
Message-ID:  <201910020916.x929GIXM098667@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Oct  2 09:16:17 2019
New Revision: 352961
URL: https://svnweb.freebsd.org/changeset/base/352961

Log:
  Implement macro for asserting priv lock in mlx5en.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/en.h	Wed Oct  2 09:15:07 2019	(r352960)
+++ head/sys/dev/mlx5/mlx5_en/en.h	Wed Oct  2 09:16:17 2019	(r352961)
@@ -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;

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Wed Oct  2 09:15:07 2019	(r352960)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c	Wed Oct  2 09:16:17 2019	(r352961)
@@ -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)));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910020916.x929GIXM098667>