Page MenuHomeFreeBSD

ofed: reduce usage of struct dma_attrs *dma_attrs
ClosedPublic

Authored by bz on Feb 19 2026, 11:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 31, 12:37 AM
Unknown Object (File)
Mar 4 2026, 2:26 AM
Unknown Object (File)
Mar 2 2026, 9:41 PM
Unknown Object (File)
Mar 2 2026, 6:20 AM
Unknown Object (File)
Feb 28 2026, 2:06 AM
Unknown Object (File)
Feb 26 2026, 11:45 AM
Unknown Object (File)
Feb 26 2026, 10:06 AM
Unknown Object (File)
Feb 26 2026, 9:58 AM
Subscribers

Details

Summary

ib_verbs.h still uses struct dma_attrs *dma_attrs everywhere.
It is beyond my knowledge when that struct got deprecated upstream but
it is still supported by our LinuxKPI. The problem is that the
functions called with that argument (dma_map_single_attrs,
dma_unmap_single_attrs, dma_map_sg_attrs, dma_unmap_sg_attrs) so far
are #defines in LinuxKPI and drop the last argument (attrs) so it was
never a problem.

In preparation to pass the attrs to the actual implementation in LinuxKPI,
which has gained support for them, we now pass dma_sttrs->flags which
is the expected unsigned long bit field.

If anyone has serious interest in updating our ofed implementation they
could look into this some more and remove the usage of struct dma_attrs
entirely.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Test Plan

Who or what is actively using our in-tree ofed stack?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Feb 19 2026, 11:38 PM

The would it be the time to also change the macros itself to not pass 0 but the last arg?
(I do not have objections to either this patch or updated patch).

In D55390#1267013, @kib wrote:

The would it be the time to also change the macros itself to not pass 0 but the last arg?
(I do not have objections to either this patch or updated patch).

The macro updates are in the stack in the next review (D55391)

This revision is now accepted and ready to land.Feb 20 2026, 4:13 PM