diff options
| author | thorpej <thorpej@NetBSD.org> | 2022-08-22 15:43:49 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2022-08-22 15:43:49 +0000 |
| commit | 668c93ceb9da33ba0c8d163f0cab409a09e5d97d (patch) | |
| tree | 711062a20abf9fb8122c8cf465f594b6110e951e /sys/dev | |
| parent | 74a844c22e6d191a7ca09f836a46c32fee1725ac (diff) | |
ale_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" with
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/if_ale.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index fc78570dd98..31f0b32b802 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ale.c,v 1.41 2022/08/22 15:39:26 thorpej Exp $ */ +/* $NetBSD: if_ale.c,v 1.42 2022/08/22 15:43:49 thorpej Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> @@ -32,7 +32,7 @@ /* Driver for Atheros AR8121/AR8113/AR8114 PCIe Ethernet. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.41 2022/08/22 15:39:26 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ale.c,v 1.42 2022/08/22 15:43:49 thorpej Exp $"); #include "vlan.h" @@ -1039,7 +1039,7 @@ ale_start(struct ifnet *ifp) enq = 0; for (;;) { - IFQ_DEQUEUE(&ifp->if_snd, m_head); + IFQ_POLL(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -1051,14 +1051,15 @@ ale_start(struct ifnet *ifp) if ((error = ale_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; /* |
