ice: change devlink code to read NVM in blocks
authorPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Wed, 8 Jun 2022 21:48:32 +0000 (14:48 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 12 Jul 2022 16:25:47 +0000 (09:25 -0700)
commit7b6f9462a3234c35cf808453d39a074a04e71de1
treef89de1e5d428f29896b46a47ad0d49b43e8d642a
parentf52d166819a4d8e0d5cca07d8a8dd6397c96dcf1
ice: change devlink code to read NVM in blocks

When creating a snapshot of the NVM the driver needs to read the entire
contents from the NVM and store it. The NVM reads are protected by a lock
that is shared between the driver and the firmware.

If the driver takes too long to read the entire NVM (which can happen on
some systems) then the firmware could reclaim the lock and cause subsequent
reads from the driver to fail.

We could fix this by increasing the timeout that we pass to the firmware,
but we could end up in the same situation again if the system is slow.
Instead have the driver break the reading of the NVM into blocks that are
small enough that we have confidence that the read will complete within the
timeout time, but large enough not to cause significant AQ overhead.

Fixes: dce730f17825 ("ice: add a devlink region for dumping NVM contents")
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_devlink.c