Discussion:
if_bnx issues
(too old to reply)
Greg Troxel
2015-02-05 23:24:02 UTC
Permalink
I am trying to integrate a number of fixes for if_bnx back to netbsd
proper. These are mostly about issues that manifest under unreasonable
load leading to mbuf exhaustion. I would like some review on these.

This fix is due to Beverly Schwartz.

The issue is failing to get new hw_cons value from the hardware due to a
missing dmamap_sync. This patch did fix the issue (on i386) and systems
with it are stable, but I'm not 100% certain the dmamap_sync is entirely
right.

Index: sys/dev/pci/if_bnx.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bnx.c,v
retrieving revision 1.57
diff -u -p -u -u -r1.57 if_bnx.c
--- if_bnx.c 9 Jul 2014 16:30:11 -0000 1.57
+++ if_bnx.c 5 Feb 2015 23:18:50 -0000
@@ -4656,6 +4656,8 @@ bnx_rx_intr(struct bnx_softc *sc)

/* Refresh hw_cons to see if there's new work */
if (sw_cons == hw_cons) {
+ bus_dmamap_sync(sc->bnx_dmatag, sc->status_map, 0,
+ BNX_STATUS_BLK_SZ, BUS_DMASYNC_POSTREAD);
hw_cons = sc->hw_rx_cons =
sblk->status_rx_quick_consumer_index0;
if ((hw_cons & USABLE_RX_BD_PER_PAGE) ==
David Laight
2015-02-06 21:44:34 UTC
Permalink
Post by Greg Troxel
I am trying to integrate a number of fixes for if_bnx back to netbsd
proper. These are mostly about issues that manifest under unreasonable
load leading to mbuf exhaustion. I would like some review on these.
This fix is due to Beverly Schwartz.
The issue is failing to get new hw_cons value from the hardware due to a
missing dmamap_sync. This patch did fix the issue (on i386) and systems
with it are stable, but I'm not 100% certain the dmamap_sync is entirely
right.
I don't know what bus_dmamap_sync() is supposed to sync, nor
what it actually does on i386/amd64, but I suspect it doesn't do
anything significant.

It might just be that a real function call forces the compiler to
not cache a value or is adding a random delay that allows time
for the hardware to perform whatever cycles are necessary.
Post by Greg Troxel
Index: sys/dev/pci/if_bnx.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_bnx.c,v
retrieving revision 1.57
diff -u -p -u -u -r1.57 if_bnx.c
--- if_bnx.c 9 Jul 2014 16:30:11 -0000 1.57
+++ if_bnx.c 5 Feb 2015 23:18:50 -0000
@@ -4656,6 +4656,8 @@ bnx_rx_intr(struct bnx_softc *sc)
/* Refresh hw_cons to see if there's new work */
if (sw_cons == hw_cons) {
+ bus_dmamap_sync(sc->bnx_dmatag, sc->status_map, 0,
+ BNX_STATUS_BLK_SZ, BUS_DMASYNC_POSTREAD);
hw_cons = sc->hw_rx_cons =
sblk->status_rx_quick_consumer_index0;
if ((hw_cons & USABLE_RX_BD_PER_PAGE) ==
David
--
David Laight: ***@l8s.co.uk

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Manuel Bouyer
2015-02-06 22:05:59 UTC
Permalink
Post by David Laight
Post by Greg Troxel
I am trying to integrate a number of fixes for if_bnx back to netbsd
proper. These are mostly about issues that manifest under unreasonable
load leading to mbuf exhaustion. I would like some review on these.
This fix is due to Beverly Schwartz.
The issue is failing to get new hw_cons value from the hardware due to a
missing dmamap_sync. This patch did fix the issue (on i386) and systems
with it are stable, but I'm not 100% certain the dmamap_sync is entirely
right.
I don't know what bus_dmamap_sync() is supposed to sync, nor
what it actually does on i386/amd64, but I suspect it doesn't do
anything significant.
If bounce buffers are used, in copies data between the bounce and
the user-supplied buffer.

It also does x86_mfence() or x86_lfence(), depending on the
operation.
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...