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
F103254075: D28706.diff
Fri, Nov 22, 4:33 PM
F103166271: D28706.id84018.diff
Thu, Nov 21, 7:32 PM
F103166238: D28706.id84632.diff
Thu, Nov 21, 7:31 PM
F103166237: D28706.id84394.diff
Thu, Nov 21, 7:31 PM
F103166236: D28706.id.diff
Thu, Nov 21, 7:31 PM
F103164729: D28706.diff
Thu, Nov 21, 7:07 PM
Unknown Object (File)
Tue, Nov 19, 11:55 PM
Unknown Object (File)
Mon, Nov 18, 11:54 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.