From owner-svn-src-user@FreeBSD.ORG Sat Jun 11 13:15:21 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09897106564A; Sat, 11 Jun 2011 13:15:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D32C8FC1A; Sat, 11 Jun 2011 13:15:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5BDFKds076627; Sat, 11 Jun 2011 13:15:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5BDFKf2076625; Sat, 11 Jun 2011 13:15:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106111315.p5BDFKf2076625@svn.freebsd.org> From: Adrian Chadd Date: Sat, 11 Jun 2011 13:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222986 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jun 2011 13:15:21 -0000 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)