Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Dec 2011 20:31:50 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Marius Strobl <marius@alchemy.franken.de>
Cc:        svn-src-head@freebsd.org, Luigi Rizzo <luigi@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org
Subject:   Re: svn commit: r228281 - in head/sys/dev: e1000 re
Message-ID:  <20111205193150.GB49118@onelab2.iet.unipi.it>
In-Reply-To: <20111205183854.GC54475@alchemy.franken.de>
References:  <201112051533.pB5FXEuh043063@svn.freebsd.org> <20111205183854.GC54475@alchemy.franken.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 05, 2011 at 07:38:54PM +0100, Marius Strobl wrote:
> On Mon, Dec 05, 2011 at 03:33:14PM +0000, Luigi Rizzo wrote:
...
> > +#ifdef DEV_NETMAP
> > +		if (slot) {
> > +			int si = i + na->tx_rings[txr->me].nkr_hwofs;
> > +			void *addr;
> > +
> > +			if (si >= na->num_tx_desc)
> > +				si -= na->num_tx_desc;
> > +			addr = NMB(slot + si);
> > +			txr->tx_base[i].buffer_addr =
> > +			    htole64(vtophys(addr));
> > +			/* reload the map for netmap mode */
> > +			netmap_load_map(txr->txtag,
> > +			    txbuf->map, addr, na->buff_size);
> > +		}
> > +#endif /* DEV_NETMAP */
> 
> Can these vtophys(9) usages be fixed to use bus_dma(9) instead so netmap
> works with bounce buffers, IOMMUs etc?

maybe. Can you suggest how to change it ?

Consider that (not here but in other places) vtophys() is called
in a time-critical loop so performance matters a lot. As long as i
can compute the physical address in advance and cache it in my own
array, i suppose that should be fine (in which case the calls to
vtophys(addr) would become NMPB(slot + si) where the NMPB() macro
would hide translations and checks.

cheers
luigi
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111205193150.GB49118>