Page MenuHomeFreeBSD

aq(4): remove dead code and tidy macros, diagnostics, and naming
ClosedPublic

Authored by nick_spun.io on Fri, Jul 10, 3:56 AM.
Referenced Files
F164070829: D58140.id182197.diff
Tue, Jul 28, 11:29 AM
F164069322: D58140.id.diff
Tue, Jul 28, 11:09 AM
F164030678: D58140.diff
Tue, Jul 28, 2:32 AM
Unknown Object (File)
Sat, Jul 25, 10:27 AM
Unknown Object (File)
Fri, Jul 24, 7:02 AM
Unknown Object (File)
Thu, Jul 23, 8:12 PM
Unknown Object (File)
Wed, Jul 22, 9:27 PM
Unknown Object (File)
Tue, Jul 21, 12:41 AM
Subscribers

Details

Summary

Non-functional cleanup, with two diagnostic corrections.

Dead code: delete leftover commented-out AQ_DBG_ENTER/EXIT/PRINT calls
(aq_hw.c, aq_fw2x.c, aq_irq.c, aq_main.c), a commented-out aq_nic_cfg
local, the stale old-signature parameter blocks between the ring-init
declarations and their bodies (aq_ring.c), a trailing note on a live
statement, and the unused DumpHex() vendor debug helper (no callers; its
body only compiled under AQ_CFG_DEBUG_LVL > 3).

Register-write macros: parenthesize AQ_WRITE_REG_BIT's msk/shift/value
arguments so a compound argument cannot mis-bind, give AQ_HW_FLUSH() an
explicit hw parameter instead of capturing it from caller scope, and drop
the duplicate lowercase aq_hw_write_reg[_bit] aliases (converting the 43
call sites to the uppercase spelling) so there is a single form.

Diagnostics: the aq_log* family expanded through the base log macro, which
ignored its level and printed unconditionally, while the error traces
gated on a debug level that defaulted below LOG_ERR and so were suppressed

  • backwards. Gate the base log macro the way the trace one does and

default the level to lvl_error, so the once-per-event firmware reset /
capability errors are visible by default while the verbose info/dump
output stays opt-in.

Naming: rename identifiers carried verbatim from the vendor import that do
not match style -- names mixing an ALL-CAPS macro-style prefix with a
lowercase tail, and a trailing underscore the vendor used as a
"file-local" marker in place of static.

  • dbg_level_ / dbg_categories_ -> aq_dbg_level / aq_dbg_categories: these are real globals (the log/trace macros reference them from every translation unit), so the trailing underscore was never a stand-in for static; give them the aq_ namespace so the driver stops exporting generically-named global symbols.
  • log_base_ / trace_base_ -> aq_log_base / aq_trace_base: the internal macros behind the aq_log*/trace* families.
  • bootExitCode / flbStatus -> boot_exit_code / flb_status (aq_fw.c); flb_status now matches the identically-purposed variable already spelled that way in the sibling FLB-reset path.

Cosmetic: terminate the ring/HW-init, MSI-X admin-handler, and
media-change error messages with a newline so they are not garbled into
adjacent dmesg output, and label the per-queue rx_bytes sysctl "RX Octets"
(it was copy-pasted "TX Octets").

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74922
Build 71805: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Wed, Jul 15, 8:22 PM
This revision now requires review to proceed.Sun, Jul 19, 3:35 AM
This revision was not accepted when it landed; it landed in state Needs Review.Sun, Jul 19, 4:50 PM
This revision was automatically updated to reflect the committed changes.