Subject: Re: Suggested changes to bus_dma interface
To: Charles M. Hannum <mycroft@MIT.EDU>
From: Justin T. Gibbs <email@example.com>
Date: 09/26/1996 00:17:56
>> (2) You sometimes can't do partial operations, the interface may constrain
>> you to deliver the full contents of a packet in a single s/g operation.
>If a device driver is creating such a restriction, then it can simply
>ask for segments until there are no more, and use them all at once. I
>don't see a problem.
I believe he's talking about situations like my example of delivering
a 256k block to a tape device on a 1542. You don't know that the input
data can't be mapped in those 16 SG segments until you try. The old
interface had control of the interration so that it could "start again"
if its first attempt at a direct mapping failed. It looks like your
proposal forces the caller to catch this condition, communicate the
need for compaction to the bus_dma_map interface somehow, reset the
uio struct, and start the loop again.
>I don't see how an intermediate bus could assert such a restriction,
>but if it did, the old proposal wouldn't deal with it either.
The restriction is too few SG segments for a direct mapping. The old
interface left it up to the implementor of bus_dmamap_load to handle this
Justin T. Gibbs
FreeBSD: Turning PCs into workstations