[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0901245c-5f3d-455c-9d5a-b1b5695755dc@huawei.com>
Date: Fri, 28 Apr 2017 11:39:35 +0800
From: "lipeng (Y)" <lipeng321@...wei.com>
To: Florian Fainelli <f.fainelli@...il.com>,
Yankejian <yankejian@...wei.com>, <davem@...emloft.net>,
<salil.mehta@...wei.com>, <yisen.zhuang@...wei.com>,
<matthias.bgg@...il.com>, <zhouhuiru@...wei.com>,
<huangdaode@...ilicon.com>
CC: <netdev@...r.kernel.org>, <linuxarm@...wei.com>
Subject: Re: [PATCH net v4 3/3] net: hns: fixed bug that skb used after kfree
On 2017/4/28 1:38, Florian Fainelli wrote:
> On 04/26/2017 07:44 PM, Yankejian wrote:
>> struct hns_nic_priv *priv = netdev_priv(ndev);
>> struct hnae_ring *ring = ring_data->ring;
>> @@ -361,6 +361,10 @@ int hns_nic_net_xmit_hw(struct net_device *ndev,
>> dev_queue = netdev_get_tx_queue(ndev, skb->queue_mapping);
>> netdev_tx_sent_queue(dev_queue, skb->len);
>>
>> + netif_trans_update(ndev);
>> + ndev->stats.tx_bytes += skb->len;
>> + ndev->stats.tx_packets++;
> This is still wrong though, you should not update your TX statistics
> until you get a TX completion interrupt that confirms these packets were
> actually transmitted. This has the advantage of not causing use after
> free in your ndo_start_xmit() function (current bug), and also allows
> feeding information into BQL where it is appropriate, and in a central
> location: the TX completion handler.
Agree, I will fix this, and will delete this patch from patchset and
refloat it later.
Powered by blists - more mailing lists