Module Name:    src
Committed By:   ryo
Date:           Fri Jan 17 05:11:04 UTC 2020

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

Log Message:
set/clear IFF_OACTIVE flag only on txring 0


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_aq.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_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.1 src/sys/dev/pci/if_aq.c:1.2
--- src/sys/dev/pci/if_aq.c:1.1	Wed Jan  1 10:11:21 2020
+++ src/sys/dev/pci/if_aq.c	Fri Jan 17 05:11:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.1 2020/01/01 10:11:21 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.2 2020/01/17 05:11:04 ryo Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.1 2020/01/01 10:11:21 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.2 2020/01/17 05:11:04 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -4362,7 +4362,7 @@ aq_send_common_locked(struct ifnet *ifp,
 			/* too many mbuf chains? or not enough descriptors? */
 			m_freem(m);
 			ifp->if_oerrors++;
-			if (error == ENOBUFS)
+			if (txring->txr_index == 0 && error == ENOBUFS)
 				ifp->if_flags |= IFF_OACTIVE;
 			break;
 		}
@@ -4375,7 +4375,7 @@ aq_send_common_locked(struct ifnet *ifp,
 		bpf_mtap(ifp, m, BPF_D_OUT);
 	}
 
-	if (!is_transmit && txring->txr_nfree < AQ_TXD_MIN)
+	if (txring->txr_index == 0 && txring->txr_nfree < AQ_TXD_MIN)
 		ifp->if_flags |= IFF_OACTIVE;
 
 	if (npkt)

Reply via email to