On Wed, Oct 7, 2020 at 7:11 PM Tony Nguyen <anthony.l.ngu...@intel.com> wrote: > > From: Jaroslaw Gawin <jaroslawx.ga...@intel.com> > > Starting with API version 1.10 firmware for X722 devices has ability > to change FEC settings in PHY. Code added in this patch allows > changing FEC settings if the capability flag indicates the device > supports this feature. > > Signed-off-by: Jaroslaw Gawin <jaroslawx.ga...@intel.com> > Signed-off-by: Aleksandr Loktionov <aleksandr.loktio...@intel.com> > Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalew...@intel.com> > Tested-by: Andrew Bowers <andrewx.bow...@intel.com> > Signed-off-by: Tony Nguyen <anthony.l.ngu...@intel.com>
Acked-by: Willem de Bruijn <will...@google.com> (for netdrv) > @@ -1484,11 +1485,18 @@ static int i40e_set_fec_param(struct net_device > *netdev, > int err = 0; > > if (hw->device_id != I40E_DEV_ID_25G_SFP28 && > - hw->device_id != I40E_DEV_ID_25G_B) { > + hw->device_id != I40E_DEV_ID_25G_B && > + hw->device_id != I40E_DEV_ID_KX_X722) { > err = -EPERM; > goto done; > } > > + if (hw->mac.type == I40E_MAC_X722 && > + !(hw->flags & I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE)) { > + netdev_err(netdev, "Setting FEC encoding not supported by > firmware. Please update the NVM image.\n"); > + return -EINVAL; > + } > + no need to respin for this, but this early return is inconsistent with other error paths in the function. Label done is not needed at all, could convert them all.