[illumos-Developer] Webrev #534: DMA KVA cache attributes incorrect

Albert Lee trisk at opensolaris.org
Tue May 10 08:21:02 PDT 2011


First obvious problem is that this always clears the documented cache
flags for ddi_dma_mem_alloc(9) and only uses the attributes in
ddi_device_acc_attr->devacc_attr_dataorder.

The cache attributes there are explicitly "advisory, not mandatory".

On Tue, May 10, 2011 at 11:05 AM, Michael Tsymbalyuk <mtzaurus at gmail.com> wrote:
>  For test purposes I added a code snipped to the vmxnet3.c
> driver (for my local testing purposes, of course) - since
> we need a real device for dealing with DMA memory allocation.
> Inside device's attach() logic it allocates 3 DMA areas with different
> attributes:
>
>   "DDI_STRICTIRDER_ACC",
>   "DDI_MERGING_OK_ACC",
>   "DDI_UNORDERED_OK_ACC"
>
>  and prints out their addresses.
>
> Next, I run mdb -k and walk through these addresses using ::vatopfn
> and ::pte commands.
>
> It shows that areas have the following attributes:
>
>    DDI_STRICTIRDER_ACC : uncached
>    DDI_MERGING_OK_ACC  : wrcombine
>    DDI_UNORDERED_OK_ACC : <no caching attributes>
>
> Sincerely,
> Michael Tsymbalyuk
>
>> On Tue, 2011-05-10 at 18:08 +0400, Michael Tsymbalyuk wrote:
>> > Thiw webrev fixes the problem of improper handling of page table
>> > attributes related to caching while allocating a DMA-compatible
>> > memory via ddi_dma_mem_alloc(). The patch adds extra attribute check
>> > to ddi_dma_mem_alloc().
>> >
>> > http://cr.illumos.org/view/asjt99s5/illumos-534-webrev/
>> >
>> > Sincerely,
>> > Michael Tsymbalyuk
>> >
>>
>> This looks good if it is that simple.  I want to do some deeper analysis
>> to review your code.  Out of curiosity, did you test this at all?  If
>> so, how?
>>
>>       - Garrett
>> >
>> > _______________________________________________
>> > Developer mailing list
>> > Developer at lists.illumos.org
>> > http://lists.illumos.org/m/listinfo/developer
>>
>>
>
>
>
> _______________________________________________
> Developer mailing list
> Developer at lists.illumos.org
> http://lists.illumos.org/m/listinfo/developer
>



More information about the Developer mailing list