Re: [PATCH net 3/3] hinic: fix bug of send pkts while setting channels

From: luobin (L)
Date: Thu Sep 03 2020 - 10:32:47 EST


On 2020/9/3 3:52, David Miller wrote:
> From: Luo bin <luobin9@xxxxxxxxxx>
> Date: Wed, 2 Sep 2020 17:41:45 +0800
>
>> @@ -531,6 +531,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;
>> + }
>
> As Eric said, these kinds of tests should not be placed in the fast path
> of the driver.
>
> If you invoke close and the core networking still sends packets to the
> driver, that's a bug that needs to be fixed in the core networking.
> .
>
Okay, I'm trying to figure out why the core networking can still call ndo_start_xmit
after netif_tx_disable and solve the problem fundamentally. And I'll undo this patch
temporarily.