Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci iwi_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEN...



details:   https://anonhg.NetBSD.org/src/rev/df0ab0cd3327
branches:  trunk
changeset: 369597:df0ab0cd3327
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Aug 22 18:09:04 2022 +0000

description:
iwi_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" with
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".

diffstat:

 sys/dev/pci/if_iwi.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r cc8d3cea6dae -r df0ab0cd3327 sys/dev/pci/if_iwi.c
--- a/sys/dev/pci/if_iwi.c      Mon Aug 22 18:08:05 2022 +0000
+++ b/sys/dev/pci/if_iwi.c      Mon Aug 22 18:09:04 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $  */
+/*     $NetBSD: if_iwi.c,v 1.120 2022/08/22 18:09:04 thorpej Exp $  */
 /*     $OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $     */
 
 /*-
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.119 2022/08/22 17:07:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.120 2022/08/22 18:09:04 thorpej Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -1781,7 +1781,7 @@
                return;
 
        for (;;) {
-               IFQ_DEQUEUE(&ifp->if_snd, m0);
+               IFQ_POLL(&ifp->if_snd, m0);
                if (m0 == NULL)
                        break;
 
@@ -1790,6 +1790,7 @@
                eh = mtod(m0, struct ether_header *);
                ni = ieee80211_find_txnode(ic, eh->ether_dhost);
                if (ni == NULL) {
+                       IFQ_DEQUEUE(&ifp->if_snd, m0);
                        m_freem(m0);
                        if_statinc(ifp, if_oerrors);
                        continue;
@@ -1797,6 +1798,7 @@
 
                /* classify mbuf so we can find which tx ring to use */
                if (ieee80211_classify(ic, m0, ni) != 0) {
+                       IFQ_DEQUEUE(&ifp->if_snd, m0);
                        m_freem(m0);
                        ieee80211_free_node(ni);
                        if_statinc(ifp, if_oerrors);
@@ -1809,12 +1811,10 @@
 
                if (sc->txq[ac].queued > sc->txq[ac].count - 8) {
                        /* there is no place left in this ring */
-                       IFQ_LOCK(&ifp->if_snd);
-                       IF_PREPEND(&ifp->if_snd, m0);
-                       IFQ_UNLOCK(&ifp->if_snd);
                        ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
+               IFQ_DEQUEUE(&ifp->if_snd, m0);
 
                bpf_mtap(ifp, m0, BPF_D_OUT);
 



Home | Main Index | Thread Index | Old Index