[Intel-wired-lan] [iwl-next v6 2/9] ice: devlink PF MSI-X max and min parameter
Michal Schmidt
mschmidt at redhat.com
Thu Oct 31 21:58:03 UTC 2024
On Mon, Oct 28, 2024 at 11:04 AM Michal Swiatkowski
<michal.swiatkowski at linux.intel.com> wrote:
>
> Use generic devlink PF MSI-X parameter to allow user to change MSI-X
> range.
>
> Add notes about this parameters into ice devlink documentation.
>
> Reviewed-by: Wojciech Drewek <wojciech.drewek at intel.com>
> Signed-off-by: Michal Swiatkowski <michal.swiatkowski at linux.intel.com>
> ---
> Documentation/networking/devlink/ice.rst | 11 +++
> .../net/ethernet/intel/ice/devlink/devlink.c | 83 ++++++++++++++++++-
> drivers/net/ethernet/intel/ice/ice.h | 7 ++
> drivers/net/ethernet/intel/ice/ice_irq.c | 7 ++
> 4 files changed, 107 insertions(+), 1 deletion(-)
>
...
> @@ -1526,6 +1548,37 @@ static int ice_devlink_local_fwd_validate(struct devlink *devlink, u32 id,
> return 0;
> }
>
> +static int
> +ice_devlink_msix_max_pf_validate(struct devlink *devlink, u32 id,
> + union devlink_param_value val,
> + struct netlink_ext_ack *extack)
> +{
> + struct ice_pf *pf = devlink_priv(devlink);
> +
> + if (val.vu16 > pf->hw.func_caps.common_cap.num_msix_vectors ||
> + val.vu16 < pf->msix.min) {
> + NL_SET_ERR_MSG_MOD(extack, "Value is invalid");
> + return -EINVAL;
> + }
> +
> + return 0;
> +}
> +
> +static int
> +ice_devlink_msix_min_pf_validate(struct devlink *devlink, u32 id,
> + union devlink_param_value val,
> + struct netlink_ext_ack *extack)
> +{
> + struct ice_pf *pf = devlink_priv(devlink);
> +
> + if (val.vu16 <= ICE_MIN_MSIX || val.vu16 > pf->msix.max) {
Shouldn't this be "<" instead of "<=" ?
Michal
More information about the Intel-wired-lan
mailing list