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 bug that RX may stall on heavy load ...



details:   https://anonhg.NetBSD.org/src/rev/6bb1018122f3
branches:  trunk
changeset: 829838:6bb1018122f3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Feb 14 10:38:28 2018 +0000

description:
Fix a bug that RX may stall on heavy load on ixg(4). ixgbe_rxeof() has loop
limit and the function returns true if a packet are still in the RX ring.
ixgbe_handle_que() didn't check the return value. Check the return vaule
and issue a softint.

 This bug is derived from FreeBSD and ixv(4) has no this bug.

XXX pullup-8

diffstat:

 sys/dev/pci/ixgbe/ixgbe.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 26f905d65d35 -r 6bb1018122f3 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Feb 14 10:13:25 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Feb 14 10:38:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.120 2018/01/26 09:07:46 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.121 2018/02/14 10:38:28 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -5712,11 +5712,12 @@
        struct adapter  *adapter = que->adapter;
        struct tx_ring  *txr = que->txr;
        struct ifnet    *ifp = adapter->ifp;
+       bool            more = false;
 
        adapter->handleq.ev_count++;
 
        if (ifp->if_flags & IFF_RUNNING) {
-               ixgbe_rxeof(que);
+               more = ixgbe_rxeof(que);
                IXGBE_TX_LOCK(txr);
                ixgbe_txeof(txr);
                if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX))
@@ -5730,10 +5731,12 @@
                IXGBE_TX_UNLOCK(txr);
        }
 
-       /* Re-enable this interrupt */
-       if (que->res != NULL)
+       if (more)
+               softint_schedule(que->que_si);
+       else if (que->res != NULL) {
+               /* Re-enable this interrupt */
                ixgbe_enable_queue(adapter, que->msix);
-       else
+       } else
                ixgbe_enable_intr(adapter);
 
        return;



Home | Main Index | Thread Index | Old Index