Re: [PATCH 5.10 45/67] octeontx2-pf: Fix interface down flag on error
From: Pavel Machek
Date: Mon Aug 02 2021 - 13:40:51 EST
Hi!
> This patch fixes the issue by setting the INTF_DOWN flag on
> error and free the resources in otx2_stop only if the flag is
> not set.
Ok.
ernet/marvell/octeontx2/nic/otx2_ethtool.c
> index 662fb80dbb9d..c6d408de0605 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
> @@ -230,15 +230,14 @@ static int otx2_set_channels(struct net_device *dev,
> err = otx2_set_real_num_queues(dev, channel->tx_count,
> channel->rx_count);
> if (err)
> - goto fail;
> + return err;
>
But with the new flag, this change is not neccessary, right?
Plus, it will lead to surprising result of otx2_set_channels() downing
interface on failure, no?
> pfvf->hw.rx_queues = channel->rx_count;
> pfvf->hw.tx_queues = channel->tx_count;
> pfvf->qset.cq_cnt = pfvf->hw.tx_queues + pfvf->hw.rx_queues;
>
> -fail:
> if (if_up)
> - dev->netdev_ops->ndo_open(dev);
> + err = dev->netdev_ops->ndo_open(dev);
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Attachment:
signature.asc
Description: Digital signature