On Wed, Oct 7, 2020 at 7:11 PM Tony Nguyen <[email protected]> wrote:
>
> From: Jaroslaw Gawin <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: Aleksandr Loktionov <[email protected]>
> Signed-off-by: Arkadiusz Kubalewski <[email protected]>
> Tested-by: Andrew Bowers <[email protected]>
> Signed-off-by: Tony Nguyen <[email protected]>

Acked-by: Willem de Bruijn <[email protected]>

(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.

Reply via email to