Module Name:    src
Committed By:   thorpej
Date:           Sat Aug 20 18:42:03 UTC 2022

Modified Files:
        src/sys/arch/newsmips/apbus: if_sn.c

Log Message:
snstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/newsmips/apbus/if_sn.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/arch/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.49 src/sys/arch/newsmips/apbus/if_sn.c:1.50
--- src/sys/arch/newsmips/apbus/if_sn.c:1.49	Wed Feb  5 13:08:19 2020
+++ src/sys/arch/newsmips/apbus/if_sn.c	Sat Aug 20 18:42:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.49 2020/02/05 13:08:19 martin Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.50 2022/08/20 18:42:03 thorpej Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.49 2020/02/05 13:08:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.50 2022/08/20 18:42:03 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -320,7 +320,7 @@ outloop:
 		return;
 	}
 
-	IF_DEQUEUE(&ifp->if_snd, m);
+	IF_POLL(&ifp->if_snd, m);
 	if (m == 0)
 		return;
 
@@ -336,13 +336,13 @@ outloop:
 
 	/*
 	 * If there is nothing in the o/p queue, and there is room in
-	 * the Tx ring, then send the packet directly.  Otherwise append
-	 * it to the o/p queue.
+	 * the Tx ring, then send the packet directly.  Otherwise it
+	 * stays on the queue.
 	 */
 	if ((sonicput(sc, m, mtd_next)) == 0) {
-		IF_PREPEND(&ifp->if_snd, m);
 		return;
 	}
+	IF_DEQUEUE(&ifp->if_snd, m);
 
 	sc->mtd_prev = sc->mtd_free;
 	sc->mtd_free = mtd_next;

Reply via email to