[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <959e5cd6-21d9-4397-a22e-4e383083c186@intel.com>
Date: Mon, 5 Aug 2024 15:49:23 +0200
From: Przemek Kitszel <przemyslaw.kitszel@...el.com>
To: Wojciech Drewek <wojciech.drewek@...el.com>
CC: <intel-wired-lan@...ts.osuosl.org>, <horms@...nel.org>,
<netdev@...r.kernel.org>, <anthony.l.nguyen@...el.com>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH iwl-next v2] ice: Implement ethtool reset support
On 8/5/24 14:46, Wojciech Drewek wrote:
> Enable ethtool reset support. Ethtool reset flags are mapped to the
> E810 reset type:
> PF reset:
> $ ethtool --reset <ethX> irq dma filter offload
> CORE reset:
> $ ethtool --reset <ethX> irq-shared dma-shared filter-shared \
> offload-shared ram-shared
> GLOBAL reset:
> $ ethtool --reset <ethX> irq-shared dma-shared filter-shared \
> offload-shared mac-shared phy-shared ram-shared
>
> Calling the same set of flags as in PF reset case on port representor
> triggers VF reset.
>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
> Reviewed-by: Marcin Szycik <marcin.szycik@...ux.intel.com>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@...el.com>
> +/**
> + * ice_repr_ethtool_reset - triggers a VF reset
> + * @dev: network interface device structure
> + * @flags: set of reset flags
> + *
> + * Return: 0 on success,
> + * -EOPNOTSUPP when using unsupported set of flags
> + * -EBUSY when VF is not ready for reset.
nit: technically it could return also -EIO, -EINVAL, or -EFAULT if VF
reset fails
I don't know if this list needs to be exhaustive though
> + */
> +static int ice_repr_ethtool_reset(struct net_device *dev, u32 *flags)
> +{
> + struct ice_repr *repr = ice_netdev_to_repr(dev);
> + struct ice_vf *vf;
> +
> + if (repr->type != ICE_REPR_TYPE_VF ||
> + *flags != ICE_ETHTOOL_VFR)
> + return -EOPNOTSUPP;
> +
> + vf = repr->vf;
> +
> + if (ice_check_vf_ready_for_cfg(vf))
> + return -EBUSY;
> +
> + *flags = 0;
I'm fine with zeroing the flags here even if the reset fails afterwards
> +
> + return ice_reset_vf(vf, ICE_VF_RESET_VFLR | ICE_VF_RESET_LOCK);
> +}
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@...el.com>
Powered by blists - more mailing lists