Module Name:    src
Committed By:   msaitoh
Date:           Thu Sep  6 08:20:12 UTC 2018

Modified Files:
        src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Fix a bug that ixgbe_mq_start(an if_transmit function) returned wrong
vaue on error. pcq_put returns false on error, so returning it to caller
indicated no error.

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/ixgbe/ix_txrx.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/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.49 src/sys/dev/pci/ixgbe/ix_txrx.c:1.50
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.49	Tue Jul 31 09:19:34 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Sep  6 08:20:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.49 2018/07/31 09:19:34 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.50 2018/09/06 08:20:12 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -202,7 +202,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 {
 	struct adapter	*adapter = ifp->if_softc;
 	struct tx_ring	*txr;
-	int 		i, err = 0;
+	int 		i;
 #ifdef RSS
 	uint32_t bucket_id;
 #endif
@@ -238,11 +238,10 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 
 	txr = &adapter->tx_rings[i];
 
-	err = pcq_put(txr->txr_interq, m);
-	if (err == false) {
+	if (__predict_false(!pcq_put(txr->txr_interq, m))) {
 		m_freem(m);
 		txr->pcq_drops.ev_count++;
-		return (err);
+		return ENOBUFS;
 	}
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);

Reply via email to