Page MenuHomeFreeBSD

LinuxKPI: device (pci): add a private lkpi_dma_get_mask() call
Changes PlannedPublic

Authored by bz on Wed, Dec 3, 9:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 24, 11:36 PM
Unknown Object (File)
Mon, Dec 15, 10:30 PM
Unknown Object (File)
Fri, Dec 12, 2:03 AM
Unknown Object (File)
Wed, Dec 10, 6:23 PM
Unknown Object (File)
Wed, Dec 10, 1:09 PM
Unknown Object (File)
Tue, Dec 9, 10:12 AM
Unknown Object (File)
Tue, Dec 9, 7:51 AM
Unknown Object (File)
Tue, Dec 9, 6:43 AM
Subscribers

Details

Reviewers
None
Group Reviewers
linuxkpi
Summary

For PCI (but really should do this for a device) we store device
private dma information like the DMA masks. Given is this currently
local to the implementation we cannot easily access that information.

Add a LinuxKPI private function to query the dma mask. This will be
used in page_pools to avoid allocating pages which will then need
excessive busdma bounce support (which quickly keels over even on amd64
currently [*]) but rather allows us to use an attribute to limit pages to
GPF_DMA32. The reason we can implement this there but were not able to
do so with skbuffs is because page pools can have a cached copy of the
device pointer which skbuffs cannot.

This implementation is used as a stopgap as it is unclear how a proper
Linux interface to this looks like (likely some direct access to entirely
different code).

  • Observed with mt76 by the logging implemented in LinuxKPI and the

sysctl counter: compat.linuxkpi.lkpi_pci_nseg1_fail: 8951

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69026
Build 65909: arc lint + arc unit

Event Timeline

bz requested review of this revision.Wed, Dec 3, 9:45 PM
bz planned changes to this revision.Fri, Dec 12, 9:23 PM

It seems with Linux v6.19-rcN this might no longer be needed as mt76 itself will set GPF_DMA32 and we may no longer require to figure out whether we need to or not.