Date: Mon, 6 Jan 2014 05:51:39 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Adrian Chadd <adrian@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r260363 - head/sys/dev/ath Message-ID: <20140106035139.GC59496@kib.kiev.ua> In-Reply-To: <201401060348.s063mW8C031852@svn.freebsd.org> References: <201401060348.s063mW8C031852@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--+yS4nipRHeFlCPfe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 06, 2014 at 03:48:32AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Mon Jan 6 03:48:32 2014 > New Revision: 260363 > URL: http://svnweb.freebsd.org/changeset/base/260363 >=20 > Log: > Correctly remove entries from the relevant receive ath_buf list before > freeing them. > =20 > The current code would walk the list and call the buffer free, which > didn't remove it from any lists before pushing it back on the free list. > =20 > Tested: AR9485, STA mode > =20 > Noticed by: dillon@apollo.dragonflybsd.org This is a NOP, right ? >=20 > Modified: > head/sys/dev/ath/if_ath_rx_edma.c >=20 > Modified: head/sys/dev/ath/if_ath_rx_edma.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ath/if_ath_rx_edma.c Mon Jan 6 01:51:08 2014 (r260362) > +++ head/sys/dev/ath/if_ath_rx_edma.c Mon Jan 6 03:48:32 2014 (r260363) > @@ -450,18 +450,20 @@ ath_edma_recv_proc_queue(struct ath_soft > static void > ath_edma_flush_deferred_queue(struct ath_softc *sc) > { > - struct ath_buf *bf, *next; > + struct ath_buf *bf; > =20 > ATH_RX_LOCK_ASSERT(sc); > =20 > /* Free in one set, inside the lock */ > - TAILQ_FOREACH_SAFE(bf, > - &sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf_list, next) { > + while (! TAILQ_EMPTY(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP])) { > + bf =3D TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP]); > + TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf, bf_list); > /* Free the buffer/mbuf */ > ath_edma_rxbuf_free(sc, bf); > } > - TAILQ_FOREACH_SAFE(bf, > - &sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf_list, next) { > + while (! TAILQ_EMPTY(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP])) { > + bf =3D TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP]); > + TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf, bf_list); > /* Free the buffer/mbuf */ > ath_edma_rxbuf_free(sc, bf); > } > @@ -495,6 +497,10 @@ ath_edma_recv_proc_deferred_queue(struct > ATH_RX_UNLOCK(sc); > =20 > /* Handle the completed descriptors */ > + /* > + * XXX is this SAFE call needed? The ath_buf entries > + * aren't modified by ath_rx_pkt, right? > + */ > TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) { > /* > * Skip the RX descriptor status - start at the data offset > @@ -520,7 +526,9 @@ ath_edma_recv_proc_deferred_queue(struct > =20 > /* Free in one set, inside the lock */ > ATH_RX_LOCK(sc); > - TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) { > + while (! TAILQ_EMPTY(&rxlist)) { > + bf =3D TAILQ_FIRST(&rxlist); > + TAILQ_REMOVE(&rxlist, bf, bf_list); > /* Free the buffer/mbuf */ > ath_edma_rxbuf_free(sc, bf); > } --+yS4nipRHeFlCPfe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSyihKAAoJEJDCuSvBvK1BJ0QP/Rdm1AK1tv0I+Eh98xe11CdH ggmPPbO/371rKvlgL2A2HlBYWUWgI1PR+p4U0VUp2pQ3mzJvyhVIqgwbBKT0P+tB bk5PGzuXPV+Xg01PvFFxQEpppmXA5r0MmFkIeLFuwibEp5vJ2ILt8DKlZynyoiPM 8pdxtBCaiz/HexdJ+3tgD9DwrnHHUkLtfgR2g8Kh+lqx5/XViVzfvLVjShBopDjs mVSAFRg0IQB/lMqoE1fe4oWwaAyk5F8uZ5v7Uz/HLqC6hkH009lnrgtdQQoGxTSW JBzNzO+kBdsDOE3m2dSG7mR9BgRotQHAwlcItBKpUB2cDSlaebvyxDA9wGJ4wPkK vLhYIJemakfRym3uwf2RPWr4i3utD2aCq3j2bzpSSPS5VYlxTacI2592ZTCNNG5j O3HCL1nIIVbtohN/l/w+j/t079n3lil1o1pHjnqfG8rNmA6yOjf4AR3UplXt6nMM Unn3e+VCifhUQXt7FWrpcIuqeRIzK0w/3888rNI85Ye6gubogl15xiyKNQ+8FJYe ls0BOsinEDJhJjjnehDlLFrjMp5+j9/xoI76Nw8zwccRxToWaTnCfp45Tef4MaLR Nr1a2rYQ2b/v6IKWRElWW379JQG7l1BNZ58tiqxrFTljftnnjql0EEK8SS4YyHFh +PCQoC4Sl7v5ZXd/+6Y0 =ZDA/ -----END PGP SIGNATURE----- --+yS4nipRHeFlCPfe--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140106035139.GC59496>