svn commit: r244551 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Fri Dec 21 19:28:18 UTC 2012


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;
 }
 


More information about the svn-src-head mailing list