From owner-svn-src-user@FreeBSD.ORG Sat Aug 20 13:07:29 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 DB7C21065670; Sat, 20 Aug 2011 13:07:29 +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 CA6378FC0C; Sat, 20 Aug 2011 13:07:29 +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 p7KD7Two053039; Sat, 20 Aug 2011 13:07:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7KD7TuV053035; Sat, 20 Aug 2011 13:07:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108201307.p7KD7TuV053035@svn.freebsd.org> From: Adrian Chadd Date: Sat, 20 Aug 2011 13:07:29 +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: r225031 - 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, 20 Aug 2011 13:07:29 -0000 Author: adrian Date: Sat Aug 20 13:07:29 2011 New Revision: 225031 URL: http://svn.freebsd.org/changeset/base/225031 Log: Add some debugging to trace whether a packet has been added to the BAW before it's actually removed from it. It turns out that a node flush during active traffic would cause some frames to be freed before the frame was added to the BAW. This is why traffic exchange would (eventually) stop. For example: ath0: ath_tx_tid_free_pkts: wasn't added: seqno 3701 I'll have to see what Linux and the reference driver do here before I fix this. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx_ht.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h 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 Aug 20 12:40:17 2011 (r225030) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 20 13:07:29 2011 (r225031) @@ -1955,6 +1955,7 @@ ath_tx_swq(struct ath_softc *sc, struct bf->bf_state.bfs_ndelim = 0; bf->bf_state.bfs_nframes = 0; bf->bf_state.bfs_al = 0; + bf->bf_state.bfs_addedbaw = 0; /* Queue frame to the tail of the software queue */ ATH_TXQ_LOCK(atid); @@ -2114,6 +2115,10 @@ ath_tx_tid_free_pkts(struct ath_softc *s ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); bf->bf_state.bfs_dobaw = 0; + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); } ATH_TXQ_REMOVE(atid, bf, bf_list); ATH_TXQ_UNLOCK(atid); @@ -2160,6 +2165,9 @@ ath_tx_tid_cleanup(struct ath_softc *sc, int tid; struct ath_tid *atid; + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: node %p: cleaning up\n", + __func__, an); + /* Flush all packets currently in the sw queues for this node */ ath_tx_node_flush(sc, an); @@ -2244,9 +2252,14 @@ ath_tx_cleanup(struct ath_softc *sc, str bf_next = TAILQ_NEXT(bf, bf_list); TAILQ_REMOVE(&atid->axq_q, bf, bf_list); atid->axq_depth--; - if (bf->bf_state.bfs_dobaw) + if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + } bf->bf_state.bfs_dobaw = 0; /* * Call the default completion handler with "fail" just @@ -2346,6 +2359,10 @@ ath_tx_aggr_retry_unaggr(struct ath_soft ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); ATH_TXQ_UNLOCK(atid); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); } bf->bf_state.bfs_dobaw = 0; @@ -2444,6 +2461,10 @@ ath_tx_retry_subframe(struct ath_softc * __func__, SEQNO(bf->bf_state.bfs_seqno)); ATH_TXQ_LOCK(atid); ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); bf->bf_state.bfs_dobaw = 0; ATH_TXQ_UNLOCK(atid); /* XXX subframe completion status? is that valid here? */ @@ -2665,6 +2686,10 @@ ath_tx_aggr_comp_aggr(struct ath_softc * SEQNO(bf->bf_state.bfs_seqno)); ATH_TXQ_UNLOCK(atid); bf->bf_state.bfs_dobaw = 0; + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); ath_tx_default_comp(sc, bf, 0); } else { drops += ath_tx_retry_subframe(sc, bf, &bf_q); @@ -2768,6 +2793,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc ATH_TXQ_LOCK(atid); ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); bf->bf_state.bfs_dobaw = 0; + if (! bf->bf_state.bfs_addedbaw) + device_printf(sc->sc_dev, + "%s: wasn't added: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); ATH_TXQ_UNLOCK(atid); } Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx_ht.c Sat Aug 20 12:40:17 2011 (r225030) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx_ht.c Sat Aug 20 13:07:29 2011 (r225031) @@ -745,6 +745,7 @@ ath_tx_form_aggr(struct ath_softc *sc, s /* The TID lock is required for the BAW update */ ath_tx_addto_baw(sc, an, tid, bf); + bf->bf_state.bfs_addedbaw = 1; ATH_TXQ_UNLOCK(tid); /* Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 20 12:40:17 2011 (r225030) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 20 13:07:29 2011 (r225031) @@ -208,6 +208,7 @@ struct ath_buf { int bfs_aggrburst:1; /* part of aggregate burst? */ int bfs_isretried:1; /* retried frame? */ int bfs_dobaw:1; /* actually check against BAW? */ + int bfs_addedbaw:1; /* has been added to the BAW */ int bfs_shpream:1; /* use short preamble */ int bfs_istxfrag:1; /* is fragmented */ int bfs_ismrr:1; /* do multi-rate TX retry */