Page MenuHomeFreeBSD

Change iflib(4) to employ the usual convention of "descriptor"
ClosedPublic

Authored by marius on Feb 2 2019, 7:44 PM.
Tags
None
Referenced Files
F80180090: D19067.id53546.diff
Thu, Mar 28, 10:18 PM
F80168617: D19067.id53587.diff
Thu, Mar 28, 7:53 PM
Unknown Object (File)
Jan 18 2024, 12:14 AM
Unknown Object (File)
Jan 11 2024, 11:00 PM
Unknown Object (File)
Dec 29 2023, 1:22 AM
Unknown Object (File)
Dec 13 2023, 9:42 AM
Unknown Object (File)
Nov 18 2023, 3:58 PM
Unknown Object (File)
Nov 15 2023, 12:31 AM
Subscribers

Details

Summary
  • As illustrated by e. g. figure 7-14 of the Intel 82599 10 GbE controller datasheet revision 3.3, in the context of Ethernet MACs the control data describing the packet buffers typically are named "descriptors". Each of these descriptors references one buffer, multiple of which a packet can be composed of. By contrast, in comments, messages and the names of structure members, iflib(4) refers to DMA resources employed for RX and TX buffers (rather than control data) as "descriptors". This odd naming convention of iflib(4) made reviewing r343085 and identifying wrong and missing bus_dmamap_sync(9) calls in particular way harder than it already is. This convention may also explain why the netmap(4) part of iflib(4) pairs the DMA tags for control data with DMA maps of buffers and vice versa in calls to bus_dma(9) functions. Therefore, change iflib(4) to refer to buf(fers) when buffers and not the usual understanding of descriptors is meant. This change does not include corrections to the DMA resources used in the netmap(4) parts. However, it revises error messages to state which kind of allocation/creation failed. Specifically, the "Unable to allocate tx_buffer (map) memory" copy & pasted inappropriately on several occasions was replaced with proper messages.
  • Enhance some other error messages to indicate which half - RX or TX - they apply to instead of using identical text in both cases and generally canonicalize them.
  • Correct the descriptions of iflib_{r,t}xsd_alloc() to reflect reality; current code doesn't use {r,t}x_buffer structures.
  • In iflib_queues_alloc():
    • Remove redundant BUS_DMA_NOWAIT of iflib_dma_alloc() calls,
    • change the M_NOWAIT from malloc(9) calls into M_NOWAIT. The return values are already checked, deferred DMA allocations not being an option at this point, BUS_DMA_NOWAIT has to be used anyway and prior malloc(9) calls in this function also specify M_NOWAIT.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fixed a typo (RX vs. TX) in one of the messages altered by the previous patch

I love everything about this. If you plan to use the summary as the commit message though you should modify "change the M_NOWAIT from malloc(9) calls into M_NOWAIT." bit to mention M_WAITOK.

This revision is now accepted and ready to land.Feb 4 2019, 8:18 PM
This revision was automatically updated to reflect the committed changes.