HomeFreeBSD

cxgbe(4): Fix illegal hardware access in cxgbe_refresh_stats.

Description

cxgbe(4): Fix illegal hardware access in cxgbe_refresh_stats.

cxgbe_refresh_stats takes into account VI_SKIP_STATS but not
VI_INIT_DONE when deciding whether to read the hardware stats. But
before this change VI_SKIP_STATS was set only for VIs with VI_INIT_DONE.
That meant that cxgbe_refresh_stats always accessed the hardware for
uninitialized VIs, and this is a problem if the adapter is suspended or
in the middle of a reset.

Fix this by setting VI_SKIP_STATS on all VIs during suspend. While
here, ignore VI_INIT_DONE in vi_refresh_stats too to be consistent with
cxgbe_refresh_stats.

Sponsored by: Chelsio Communications

(cherry picked from commit 08c7dc7fd4735b85e9696d0439af6cc98b23b25d)

Details

Provenance
npAuthored on Feb 12 2022, 12:58 AM
Parents
rG2f733c60ff46: cxgbe(4): Avoid unsafe hardware access in the ifmedia ioctls.
Branches
Unknown
Tags
Unknown