Re: [PATCH net-next v4] hinic: add set_channels ethtool_ops support

From: Michal Kubecek
Date: Mon Jun 01 2020 - 00:54:26 EST


On Mon, Jun 01, 2020 at 09:42:06AM +0000, Luo bin wrote:
> add support to change TX/RX queue number with ethtool -L ethx combined
>
> Signed-off-by: Luo bin <luobin9@xxxxxxxxxx>
> ---
[...]

The patch looks correct but I'm not sure how is this change

> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
> index 4c66a0bc1b28..6da761d7a6ef 100644
> --- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
> +++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
> @@ -470,6 +470,11 @@ netdev_tx_t hinic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
> struct hinic_txq *txq;
> struct hinic_qp *qp;
>
> + if (unlikely(!netif_carrier_ok(netdev))) {
> + dev_kfree_skb_any(skb);
> + return NETDEV_TX_OK;
> + }
> +
> txq = &nic_dev->txqs[q_id];
> qp = container_of(txq->sq, struct hinic_qp, sq);
>

related to the rest. It rather looks as a fix/workaround for a race
condition you encountered while testing it but which could also happen
under other circumstances.

Michal