Page MenuHomeFreeBSD

iflib: add new field: isc_dma_width
ClosedPublic

Authored by ar_semihalf.com on Feb 16 2021, 4:38 PM.
Tags
None
Referenced Files
F103461872: D28706.diff
Mon, Nov 25, 8:26 AM
F103455988: D28706.id84018.diff
Mon, Nov 25, 6:34 AM
Unknown Object (File)
Fri, Nov 22, 4:33 PM
Unknown Object (File)
Thu, Nov 21, 7:32 PM
Unknown Object (File)
Thu, Nov 21, 7:31 PM
Unknown Object (File)
Thu, Nov 21, 7:31 PM
Unknown Object (File)
Thu, Nov 21, 7:31 PM
Unknown Object (File)
Thu, Nov 21, 7:07 PM

Details

Summary

Some DMA controllers are unable to address the full host memory space
and are instead limited to a subset of address range (e.g. 48-bit).

Allow the driver to specify the maximum allowed DMA addressing width
(in bits) for the NIC hardware, by introducing a new field in
if_softc_ctx.

If said field is omitted (set to 0), the lowaddr of DMA window bounds
defaults to BUS_SPACE_MAXADDR.

Submitted by: Artur Rojek <ar@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.

Test Plan

In order to test, set scctx->isc_dma_width to a non-zero value, e.g. scctx->isc_dma_width = 48.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I'm shocked that this feature was not present before.

This revision is now accepted and ready to land.Feb 16 2021, 5:02 PM
erj added inline comments.
sys/net/iflib.h
239

You should validate this value -- what if someone puts in something ridiculous by accident?

Changes:

  • provide a sanity check for isc_dma_width,
  • introduce a DMA_WIDTH_TO_BUS_LOWADDR macro to correctly handle edge cases where isc_dma_width equals either 0 or the number of bits in BUS_SPACE_MAXADDR
This revision now requires review to proceed.Feb 21 2021, 1:32 PM
This revision is now accepted and ready to land.Feb 22 2021, 1:23 AM
This revision was automatically updated to reflect the committed changes.