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

2020-09-03 Thread luobin (L)
On 2020/9/2 18:16, Eric Dumazet wrote: > > > On 9/2/20 2:41 AM, Luo bin wrote: >> When calling hinic_close in hinic_set_channels, netif_carrier_off >> and netif_tx_disable are excuted, and TX host resources are freed >> after that. Core may call hinic_xmit_frame to send pkt after >> netif_tx_disa

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

2020-09-03 Thread luobin (L)
On 2020/9/3 3:52, David Miller wrote: > From: Luo bin > 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_carr

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

2020-09-02 Thread David Miller
From: Luo bin 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_sk

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

2020-09-02 Thread Eric Dumazet
On 9/2/20 2:41 AM, Luo bin wrote: > When calling hinic_close in hinic_set_channels, netif_carrier_off > and netif_tx_disable are excuted, and TX host resources are freed > after that. Core may call hinic_xmit_frame to send pkt after > netif_tx_disable within a short time, so we should judge whet

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

2020-09-02 Thread Luo bin
When calling hinic_close in hinic_set_channels, netif_carrier_off and netif_tx_disable are excuted, and TX host resources are freed after that. Core may call hinic_xmit_frame to send pkt after netif_tx_disable within a short time, so we should judge whether carrier is on before sending pkt otherwis