svn commit: r222986 - user/adrian/if_ath_tx/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Sat Jun 11 13:15:21 UTC 2011


Author: adrian
Date: Sat Jun 11 13:15:20 2011
New Revision: 222986
URL: http://svn.freebsd.org/changeset/base/222986

Log:
  Clarify the dirty locking that I'm currently doing at the moment.
  
  This isn't crashing (primarily because the ath_node is mostly behind the
  ATH lock rather than a per-node lock.)

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Sat Jun 11 12:47:04 2011	(r222985)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c	Sat Jun 11 13:15:20 2011	(r222986)
@@ -1222,11 +1222,15 @@ bad:
  * This is done to make it easy for the software scheduler to 
  * find which nodes have data to send.
  *
- * This must be called with the TX/ATH lock held.
+ * This must be called with the ATH lock held.
  */
 static void
 ath_tx_node_sched(struct ath_softc *sc, struct ath_node *an)
 {
+	/*
+	 * XXX sched is serialised behind the ATH lock; not
+	 * XXX a per-node lock.
+	 */
 	if (an->sched)
 		return;		/* already scheduled */
 
@@ -1239,11 +1243,15 @@ ath_tx_node_sched(struct ath_softc *sc, 
  * Mark the current node as no longer needing to be polled for
  * TX packets.
  *
- * This must be called with the TX/ATH lock held.
+ * This must be called with the ATH lock held.
  */
 static void
 ath_tx_node_unsched(struct ath_softc *sc, struct ath_node *an)
 {
+	/*
+	 * XXX sched is serialised behind the ATH lock; not
+	 * XXX a per-node lock.
+	 */
 	if (an->sched == 0)
 		return;
 
@@ -1293,11 +1301,12 @@ ath_tx_swq(struct ath_softc *sc, struct 
 	ATH_TXQ_INSERT_TAIL(atid, bf, bf_list);
 	ATH_TXQ_UNLOCK(atid);
 
-	/* Bump queued packet counter */
-	atomic_add_int(&an->an_qdepth, 1);
 
 	/* Mark the given node/tid as having packets to dequeue */
 	ATH_LOCK(sc);
+	/* Bump queued packet counter */
+	/* XXX for now, an_qdepth is behind the ATH lock */
+	atomic_add_int(&an->an_qdepth, 1);
 	ath_tx_node_sched(sc, an);
 	ATH_UNLOCK(sc);
 }
@@ -1471,6 +1480,7 @@ ath_tx_hw_queue(struct ath_softc *sc, st
 
 /*
  * XXX this needs to be atomic or ath_node locked
+ * XXX This is currently serialised behind the ATH lock
  */
 static int
 ath_txq_node_qlen(struct ath_softc *sc, struct ath_node *an)


More information about the svn-src-user mailing list