Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci re-enable MSI/MSI-X, the TX timeouts were caused...



details:   https://anonhg.NetBSD.org/src/rev/cd1d56a5c306
branches:  trunk
changeset: 936052:cd1d56a5c306
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Jul 17 09:48:21 2020 +0000

description:
re-enable MSI/MSI-X, the TX timeouts were caused by the IFF_OACTIVE handling,
which was fixed in previous revision

diffstat:

 sys/dev/pci/if_bnx.c |  24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diffs (74 lines):

diff -r 9f4081ab0600 -r cd1d56a5c306 sys/dev/pci/if_bnx.c
--- a/sys/dev/pci/if_bnx.c      Fri Jul 17 08:06:02 2020 +0000
+++ b/sys/dev/pci/if_bnx.c      Fri Jul 17 09:48:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bnx.c,v 1.101 2020/07/16 14:57:59 jdolecek Exp $    */
+/*     $NetBSD: if_bnx.c,v 1.102 2020/07/17 09:48:21 jdolecek Exp $    */
 /*     $OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.101 2020/07/16 14:57:59 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.102 2020/07/17 09:48:21 jdolecek Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -625,14 +625,7 @@
                return;
        }
 
-       /* XXX using MSI-X causes TX timeouts, needs to be debugged */
-       int counts[PCI_INTR_TYPE_SIZE] = {
-               [PCI_INTR_TYPE_INTX] = 1,
-               [PCI_INTR_TYPE_MSI] = 0,
-               [PCI_INTR_TYPE_MSIX] = 0,
-       };
-
-       if (pci_intr_alloc(pa, &sc->bnx_ih, counts, PCI_INTR_TYPE_INTX)) {
+       if (pci_intr_alloc(pa, &sc->bnx_ih, NULL, 0)) {
                aprint_error_dev(sc->bnx_dev, "couldn't map interrupt\n");
                goto bnx_attach_fail;
        }
@@ -4092,9 +4085,6 @@
                    &pkt->pkt_dmamap) != 0)
                        goto put;
 
-               if (!ISSET(ifp->if_flags, IFF_UP))
-                       goto stopping;
-
                mutex_enter(&sc->tx_pkt_mtx);
                TAILQ_INSERT_TAIL(&sc->tx_free_pkts, pkt, pkt_entry);
                sc->tx_pkt_count++;
@@ -4114,8 +4104,6 @@
 
        return;
 
-stopping:
-       bus_dmamap_destroy(sc->bnx_dmatag, pkt->pkt_dmamap);
 put:
        pool_put(bnx_tx_pool, pkt);
        return;
@@ -5190,8 +5178,10 @@
        bus_dmamap_sync(sc->bnx_dmatag, map, 0, map->dm_mapsize,
            BUS_DMASYNC_PREWRITE);
        /* Make sure there's room in the chain */
-       if (map->dm_nsegs > (sc->max_tx_bd - sc->used_tx_bd))
+       if (map->dm_nsegs > (sc->max_tx_bd - sc->used_tx_bd)) {
+               error = ENOMEM;
                goto nospace;
+       }
 
        /* prod points to an empty tx_bd at this point. */
        prod_bseq = sc->tx_prod_bseq;
@@ -5270,7 +5260,7 @@
        TAILQ_INSERT_TAIL(&sc->tx_free_pkts, pkt, pkt_entry);
        mutex_exit(&sc->tx_pkt_mtx);
 
-       return ENOMEM;
+       return error;
 }
 
 /****************************************************************************/



Home | Main Index | Thread Index | Old Index