Re: kiobuf using kernel pages

Gerard Roudier (groudier@club-internet.fr)
Thu, 11 Nov 1999 17:24:23 +0100 (MET)


On Thu, 11 Nov 1999, Ingo Molnar wrote:

> On Thu, 11 Nov 1999, Stephen C. Tweedie wrote:
>
> > The _whole_ point about kiobufs is that they contain pages of
> > kernel-addressable memory, without _any_ information about where those
> > pages came from.
>
> i believe this is not generic enough. Eg. my box was already doing DMA to
> pages which were never-ever mapped into kernel-space. We do not need to
> _access_ page contents to do DMA to it, this is where the 'virtual
> address' assumption breaks.

Seems you suggest to consider kiobuf references to memory as opaque
handles with kernel methods to get mapping according to use. But since we
cannot require all drivers to actually implement DMA, it must be possible
for a driver to get a kernel virtual mapping on need.

Basically, something as trivial as the following:

#define virt_from_stuff(k) (k)
#define bus_from_stuff(k) virt_to_bus(k)

Should fit the abstraction as seen from drivers given current
implementation.

Gérard.

PS:
BTW, requiring kiobuf references to memory to reference whole page (as I
read in some other posting) or to be page boundary aligned is not the way
to go, in my opinion.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/