Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 2015 09:56:31 -0500
From:      John Baldwin <jhb@FreeBSD.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        'freebsd-arch' <freebsd-arch@freebsd.org>
Subject:   Re: Wrapper API for static bus_dma allocations
Message-ID:  <54CB9B9F.50905@FreeBSD.org>
In-Reply-To: <67604.1422568494@critter.freebsd.dk>
References:  <2800970.jY4xzTy9Hz@ralph.baldwin.cx> <67604.1422568494@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/29/15 4:54 PM, Poul-Henning Kamp wrote:
> --------
> In message <2800970.jY4xzTy9Hz@ralph.baldwin.cx>, John Baldwin writes:
> 
>> The bus_dma API to allocate a chunk of static DMA'able memory (e.g. for 
>> descriptor rings) can be a bit obtuse [...]
> 
> Isn't it time we take a good hard stare at all of the bus_dma API,
> and refactor it into something a lot more compact ?

Given the amount of oddball hardware out there I don't think there is a
lot you can cut out.  The filter function might be something we can lose
(and losing it would simplify the implementation), but all the other
weird constraints are actually used by something AFAIK.  I do think we
can provide some simpler wrappers for some of the more common cases, but
there will be some hardware for which those wrappers do not work.

One suggestion Scott has had is to at least make it easier to extend the
API by using getter/setter routines on the tag to work with tag
attributes instead of passing them all in bus_dma_tag_create().

-- 
John Baldwin



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