Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2012 19:28:18 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244551 - head/sys/dev/cxgbe
Message-ID:  <201212211928.qBLJSIJ1022156@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Fri Dec 21 19:28:17 2012
New Revision: 244551
URL: http://svnweb.freebsd.org/changeset/base/244551

Log:
  cxgbe(4): must hold a write-lock on the table while allocating an L2
  entry for switching.
  
  MFC after:	3 days

Modified:
  head/sys/dev/cxgbe/t4_l2t.c

Modified: head/sys/dev/cxgbe/t4_l2t.c
==============================================================================
--- head/sys/dev/cxgbe/t4_l2t.c	Fri Dec 21 19:26:17 2012	(r244550)
+++ head/sys/dev/cxgbe/t4_l2t.c	Fri Dec 21 19:28:17 2012	(r244551)
@@ -149,7 +149,7 @@ t4_l2t_alloc_switching(struct l2t_data *
 {
 	struct l2t_entry *e;
 
-	rw_rlock(&d->lock);
+	rw_wlock(&d->lock);
 	e = t4_alloc_l2e(d);
 	if (e) {
 		mtx_lock(&e->lock);          /* avoid race with t4_l2t_free */
@@ -157,7 +157,7 @@ t4_l2t_alloc_switching(struct l2t_data *
 		atomic_store_rel_int(&e->refcnt, 1);
 		mtx_unlock(&e->lock);
 	}
-	rw_runlock(&d->lock);
+	rw_wunlock(&d->lock);
 	return e;
 }
 



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