Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Fix a potential bug that TX/RX might stall...



details:   https://anonhg.NetBSD.org/src/rev/bd4c5d18601c
branches:  trunk
changeset: 830021:bd4c5d18601c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Feb 22 10:02:08 2018 +0000

description:
Fix a potential bug that TX/RX might stall when TX rate limit reached.
This change is almost the same as the RX rate limit bug fix in ixgbe.c
rev. 1.121. I've never got any stall, but this must be a bug.

diffstat:

 sys/dev/pci/ixgbe/ix_txrx.c |  10 +++++-----
 sys/dev/pci/ixgbe/ixgbe.c   |   4 ++--
 sys/dev/pci/ixgbe/ixgbe.h   |   4 ++--
 sys/dev/pci/ixgbe/ixv.c     |   4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diffs (97 lines):

diff -r 30ab402e66f3 -r bd4c5d18601c sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Thu Feb 22 09:41:06 2018 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Thu Feb 22 10:02:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.31 2018/02/20 07:30:57 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.32 2018/02/22 10:02:08 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -993,7 +993,7 @@
  *   processing the packet then free associated resources. The
  *   tx_buffer is put back on the free queue.
  ************************************************************************/
-void
+bool
 ixgbe_txeof(struct tx_ring *txr)
 {
        struct adapter          *adapter = txr->adapter;
@@ -1032,13 +1032,13 @@
                     txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) {
                        netmap_tx_irq(ifp, txr->me);
                }
-               return;
+               return false;
        }
 #endif /* DEV_NETMAP */
 
        if (txr->tx_avail == txr->num_desc) {
                txr->busy = 0;
-               return;
+               return false;
        }
 
        /* Get work starting point */
@@ -1139,7 +1139,7 @@
        if (txr->tx_avail == txr->num_desc)
                txr->busy = 0;
 
-       return;
+       return ((limit > 0) ? false : true);
 } /* ixgbe_txeof */
 
 /************************************************************************
diff -r 30ab402e66f3 -r bd4c5d18601c sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Thu Feb 22 09:41:06 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Thu Feb 22 10:02:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.125 2018/02/20 08:49:23 knakahara Exp $ */
+/* $NetBSD: ixgbe.c,v 1.126 2018/02/22 10:02:08 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -5768,7 +5768,7 @@
        if (ifp->if_flags & IFF_RUNNING) {
                more = ixgbe_rxeof(que);
                IXGBE_TX_LOCK(txr);
-               ixgbe_txeof(txr);
+               more |= ixgbe_txeof(txr);
                if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
                        if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq))
                                ixgbe_mq_start_locked(ifp, txr);
diff -r 30ab402e66f3 -r bd4c5d18601c sys/dev/pci/ixgbe/ixgbe.h
--- a/sys/dev/pci/ixgbe/ixgbe.h Thu Feb 22 09:41:06 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.h Thu Feb 22 10:02:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.29 2017/12/06 04:08:50 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.30 2018/02/22 10:02:08 msaitoh Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -717,7 +717,7 @@
 void ixgbe_free_transmit_structures(struct adapter *);
 int  ixgbe_setup_receive_structures(struct adapter *);
 void ixgbe_free_receive_structures(struct adapter *);
-void ixgbe_txeof(struct tx_ring *);
+bool ixgbe_txeof(struct tx_ring *);
 bool ixgbe_rxeof(struct ix_queue *);
 
 const struct sysctlnode *ixgbe_sysctl_instance(struct adapter *);
diff -r 30ab402e66f3 -r bd4c5d18601c sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Thu Feb 22 09:41:06 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Thu Feb 22 10:02:08 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.80 2018/02/22 08:49:42 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.81 2018/02/22 10:02:08 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -2622,7 +2622,7 @@
        if (ifp->if_flags & IFF_RUNNING) {
                more = ixgbe_rxeof(que);
                IXGBE_TX_LOCK(txr);
-               ixgbe_txeof(txr);
+               more |= ixgbe_txeof(txr);
                if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
                        if (!ixgbe_mq_ring_empty(ifp, txr->txr_interq))
                                ixgbe_mq_start_locked(ifp, txr);



Home | Main Index | Thread Index | Old Index