Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Aug 2014 19:58:47 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r270298 - stable/10/sys/dev/netmap
Message-ID:  <201408211958.s7LJwlwr055044@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Aug 21 19:58:46 2014
New Revision: 270298
URL: http://svnweb.freebsd.org/changeset/base/270298

Log:
  MFC r270253:
  Change netmap's global lock to sx instead of a mutex.

Modified:
  stable/10/sys/dev/netmap/netmap_kern.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/netmap/netmap_kern.h
==============================================================================
--- stable/10/sys/dev/netmap/netmap_kern.h	Thu Aug 21 19:54:02 2014	(r270297)
+++ stable/10/sys/dev/netmap/netmap_kern.h	Thu Aug 21 19:58:46 2014	(r270298)
@@ -44,13 +44,13 @@
 #define unlikely(x)	__builtin_expect((long)!!(x), 0L)
 
 #define	NM_LOCK_T	struct mtx
-#define	NMG_LOCK_T	struct mtx
-#define NMG_LOCK_INIT()	mtx_init(&netmap_global_lock, \
-				"netmap global lock", NULL, MTX_DEF)
-#define NMG_LOCK_DESTROY()	mtx_destroy(&netmap_global_lock)
-#define NMG_LOCK()	mtx_lock(&netmap_global_lock)
-#define NMG_UNLOCK()	mtx_unlock(&netmap_global_lock)
-#define NMG_LOCK_ASSERT()	mtx_assert(&netmap_global_lock, MA_OWNED)
+#define	NMG_LOCK_T	struct sx
+#define NMG_LOCK_INIT()	sx_init(&netmap_global_lock, \
+				"netmap global lock")
+#define NMG_LOCK_DESTROY()	sx_destroy(&netmap_global_lock)
+#define NMG_LOCK()	sx_xlock(&netmap_global_lock)
+#define NMG_UNLOCK()	sx_xunlock(&netmap_global_lock)
+#define NMG_LOCK_ASSERT()	sx_assert(&netmap_global_lock, SA_XLOCKED)
 
 #define	NM_SELINFO_T	struct selinfo
 #define	MBUF_LEN(m)	((m)->m_pkthdr.len)



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