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

Navdeep Parhar np at FreeBSD.org
Tue Feb 7 09:39:47 UTC 2012


Author: np
Date: Tue Feb  7 09:39:46 2012
New Revision: 231120
URL: http://svn.freebsd.org/changeset/base/231120

Log:
  Acquire the adapter lock before updating fields of the filter structure.
  
  Submitted by:	gnn (different version)
  MFC after:	3 days

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

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Tue Feb  7 09:37:30 2012	(r231119)
+++ head/sys/dev/cxgbe/t4_main.c	Tue Feb  7 09:39:46 2012	(r231120)
@@ -4839,22 +4839,22 @@ filter_rpl(struct sge_iq *iq, const stru
 		unsigned int rc = G_COOKIE(rpl->cookie);
 		struct filter_entry *f = &sc->tids.ftid_tab[idx];
 
+		ADAPTER_LOCK(sc);
 		if (rc == FW_FILTER_WR_FLT_ADDED) {
 			f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff;
 			f->pending = 0;  /* asynchronous setup completed */
 			f->valid = 1;
-			return (0);
-		}
+		} else {
+			if (rc != FW_FILTER_WR_FLT_DELETED) {
+				/* Add or delete failed, display an error */
+				log(LOG_ERR,
+				    "filter %u setup failed with error %u\n",
+				    idx, rc);
+			}
 
-		if (rc != FW_FILTER_WR_FLT_DELETED) {
-			/* Add or delete failed, need to display an error */
-			device_printf(sc->dev,
-			    "filter %u setup failed with error %u\n", idx, rc);
+			clear_filter(f);
+			sc->tids.ftids_in_use--;
 		}
-
-		clear_filter(f);
-		ADAPTER_LOCK(sc);
-		sc->tids.ftids_in_use--;
 		ADAPTER_UNLOCK(sc);
 	}
 


More information about the svn-src-all mailing list