Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/39cbb2747ae5
branches:  trunk
changeset: 369592:39cbb2747ae5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Aug 22 16:18:44 2022 +0000

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

diffstat:

 sys/dev/pci/if_age.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (44 lines):

diff -r 44b41b32d0f7 -r 39cbb2747ae5 sys/dev/pci/if_age.c
--- a/sys/dev/pci/if_age.c      Mon Aug 22 16:14:31 2022 +0000
+++ b/sys/dev/pci/if_age.c      Mon Aug 22 16:18:44 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_age.c,v 1.71 2022/08/22 16:14:31 thorpej Exp $ */
+/*     $NetBSD: if_age.c,v 1.72 2022/08/22 16:18:44 thorpej Exp $ */
 /*     $OpenBSD: if_age.c,v 1.1 2009/01/16 05:00:34 kevlo Exp $        */
 
 /*-
@@ -31,7 +31,7 @@
 /* Driver for Attansic Technology Corp. L1 Gigabit Ethernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.71 2022/08/22 16:14:31 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_age.c,v 1.72 2022/08/22 16:18:44 thorpej Exp $");
 
 #include "vlan.h"
 
@@ -1067,7 +1067,7 @@
 
        enq = 0;
        for (;;) {
-               IFQ_DEQUEUE(&ifp->if_snd, m_head);
+               IFQ_POLL(&ifp->if_snd, m_head);
                if (m_head == NULL)
                        break;
 
@@ -1079,14 +1079,15 @@
                if ((error = age_encap(sc, m_head)) != 0) {
                        if (error == EFBIG) {
                                /* This is fatal for the packet. */
+                               IFQ_DEQUEUE(&ifp->if_snd, m_head);
                                m_freem(m_head);
                                if_statinc(ifp, if_oerrors);
                                continue;
                        }
-                       IF_PREPEND(&ifp->if_snd, m_head);
                        ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
+               IFQ_DEQUEUE(&ifp->if_snd, m_head);
                enq = 1;
 
                /*



Home | Main Index | Thread Index | Old Index