[Intel-wired-lan] [intel-next PATCH 02/14] ice: convert ice_mbx_clear_malvf to void and use WARN
Szlosek, Marek
marek.szlosek at intel.com
Fri Mar 10 13:15:28 UTC 2023
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Jacob Keller
> Sent: środa, 22 lutego 2023 18:09
> To: Intel Wired LAN <intel-wired-lan at lists.osuosl.org>
> Cc: Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Brandeburg, Jesse
> <jesse.brandeburg at intel.com>
> Subject: [Intel-wired-lan] [intel-next PATCH 02/14] ice: convert
> ice_mbx_clear_malvf to void and use WARN
>
> The ice_mbx_clear_malvf function checks for a few error conditions before
> clearing the appropriate data. These error conditions are really warnings that
> should never occur in a properly initialized driver. Every caller of
> ice_mbx_clear_malvf just prints a dev_dbg message on failure which will
> generally be ignored.
>
> Convert this function to void and switch the error return values to
> WARN_ON. This will make any potentially misconfiguration more visible and
> makes future refactors that involve changing how we store the malicious VF
> data easier.
>
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
> ---
> drivers/net/ethernet/intel/ice/ice_sriov.c | 6 ++----
> drivers/net/ethernet/intel/ice/ice_vf_lib.c | 12 ++++--------
> drivers/net/ethernet/intel/ice/ice_vf_mbx.c | 16 +++++++---------
> drivers/net/ethernet/intel/ice/ice_vf_mbx.h | 2 +-
> 4 files changed, 14 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c
> b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index 96a64c25e2ef..7107c279752a 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
Tested-by: Marek Szlosek <marek.szlosek at intel.com>
More information about the Intel-wired-lan
mailing list