tech-net archive

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

Re: if_bnx issues



On Thu, Feb 05, 2015 at 06:24:02PM -0500, Greg Troxel wrote:
> 
> 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.

> 
> 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: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index