On 5/23/2024 2:04 PM, Dave Ertman wrote:
> On module load, the ice driver checks for the lack of a specific PF
> capability to determine if it should reduce the number of devlink params
> to register.  One situation when this test returns true is when the
> driver loads in safe mode.  The same check is not present on the unload
> path when devlink params are unregistered.  This results in the driver
> triggering a WARN_ON in the kernel devlink code.
> 
> The current check and code path uses a reduction in the number of elements
> reported in the list of params.  This is fragile and not good for future
> maintaining.
> 
> Change the parameters to be held in two lists, one always registered and
> one dependent on the check.
> 
> Add a symmetrical check in the unload path so that the correct parameters
> are unregistered as well.
> 
> Fixes: 109eb2917284 ("ice: Add tx_scheduling_layers devlink param")
> CC: Lukasz Czapnik <[email protected]>
> Reviewed-by: Przemek Kitszel <[email protected]>
> Signed-off-by: Dave Ertman <[email protected]>
> 
> ---
> Changes in v2: break params into two list
> clean up variable usage
> ---

Thanks for cleaning this up!

Reviewed-by: Jacob Keller <[email protected]>

Reply via email to