Module Name: src
Committed By: jdolecek
Date: Fri Jul 17 09:48:21 UTC 2020
Modified Files:
src/sys/dev/pci: if_bnx.c
Log Message:
re-enable MSI/MSI-X, the TX timeouts were caused by the IFF_OACTIVE handling,
which was fixed in previous revision
To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/pci/if_bnx.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_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.101 src/sys/dev/pci/if_bnx.c:1.102
--- src/sys/dev/pci/if_bnx.c:1.101 Thu Jul 16 14:57:59 2020
+++ src/sys/dev/pci/if_bnx.c Fri Jul 17 09:48:21 2020
@@ -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 @@ bnx_attach(device_t parent, device_t sel
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 @@ bnx_alloc_pkts(struct work * unused, voi
&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 @@ bnx_alloc_pkts(struct work * unused, voi
return;
-stopping:
- bus_dmamap_destroy(sc->bnx_dmatag, pkt->pkt_dmamap);
put:
pool_put(bnx_tx_pool, pkt);
return;
@@ -5190,8 +5178,10 @@ retry:
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 @@ maperr:
TAILQ_INSERT_TAIL(&sc->tx_free_pkts, pkt, pkt_entry);
mutex_exit(&sc->tx_pkt_mtx);
- return ENOMEM;
+ return error;
}
/****************************************************************************/