Module Name:    src
Committed By:   thorpej
Date:           Mon Aug 22 15:43:50 UTC 2022

Modified Files:
        src/sys/dev/pci: if_ale.c

Log Message:
ale_start(): Replace "IFQ_DEQUEUE() -> IF_PREPEND() on failure" with
"IFQ_POLL() -> IFQ_DEQUEUE() on success (or fatal error)".


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/if_ale.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_ale.c
diff -u src/sys/dev/pci/if_ale.c:1.41 src/sys/dev/pci/if_ale.c:1.42
--- src/sys/dev/pci/if_ale.c:1.41	Mon Aug 22 15:39:26 2022
+++ src/sys/dev/pci/if_ale.c	Mon Aug 22 15:43:49 2022
@@ -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 <yong...@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;
 
 		/*

Reply via email to