From: Yunsheng Lin <linyunsheng@huawei.com>
To: David Miller <davem@davemloft.net>
Cc: <tanhuazhong@huawei.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <salil.mehta@huawei.com>,
<yisen.zhuang@huawei.com>, <linuxarm@huawei.com>,
<jakub.kicinski@netronome.com>
Subject: Re: [PATCH net 1/3] net: hns3: fix for TX queue not restarted problem
Date: Wed, 4 Dec 2019 09:32:17 +0800 [thread overview]
Message-ID: <fbb92429-7242-3716-0f53-35e6b83aeeb2@huawei.com> (raw)
In-Reply-To: <20191203.004850.2142378371017096251.davem@davemloft.net>
On 2019/12/3 16:48, David Miller wrote:
> From: Yunsheng Lin <linyunsheng@huawei.com>
> Date: Tue, 3 Dec 2019 12:28:22 +0800
>
>> On 2019/12/3 11:25, David Miller wrote:
>>> From: Huazhong Tan <tanhuazhong@huawei.com>
>>> Date: Tue, 3 Dec 2019 11:08:53 +0800
>>>
>>>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>>>> index ba05368..b2bb8e2 100644
>>>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>>>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>>>> @@ -1286,13 +1286,16 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
>>>> return false;
>>>> }
>>>>
>>>> -static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
>>>> +static int hns3_nic_maybe_stop_tx(struct net_device *netdev,
>>>> struct sk_buff **out_skb)
>>>> {
>>>> + struct hns3_nic_priv *priv = netdev_priv(netdev);
>>>> unsigned int bd_size[HNS3_MAX_TSO_BD_NUM + 1U];
>>>> struct sk_buff *skb = *out_skb;
>>>> + struct hns3_enet_ring *ring;
>>>> unsigned int bd_num;
>>>>
>>>> + ring = &priv->ring[skb->queue_mapping];
>>>
>>> Please just pass the ring pointer into hns3_nic_maybe_stop_tx() instead of
>>> needlessly recalculating it.
>>
>> The reason that I am passing the netdev instead of ring pointer is
>> that the netif_start_subqueue() need a netdev parameter, and the
>> netdev can not be derived from the ring pointer.
>>
>> Do you think it is better to keep it as this patch, or add a new
>> netdevice parameter? like below:
>
> Just add the netdev parameter, in addition to the ring parameter.
>
> All arguments fit in the register argument passing conventions of
> various cpus so the cost of adding the parameter is zero.
Ok, thanks.
>
> .
>
next prev parent reply other threads:[~2019-12-04 1:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 3:08 [PATCH net 0/3] net: hns3: fixes for -net Huazhong Tan
2019-12-03 3:08 ` [PATCH net 1/3] net: hns3: fix for TX queue not restarted problem Huazhong Tan
2019-12-03 3:25 ` David Miller
2019-12-03 4:28 ` Yunsheng Lin
2019-12-03 8:48 ` David Miller
2019-12-04 1:32 ` Yunsheng Lin [this message]
2019-12-03 3:08 ` [PATCH net 2/3] net: hns3: fix a use after free problem in hns3_nic_maybe_stop_tx() Huazhong Tan
2019-12-03 3:28 ` David Miller
2019-12-03 4:22 ` Yunsheng Lin
2019-12-03 19:57 ` David Miller
2019-12-04 1:33 ` Yunsheng Lin
2019-12-03 3:08 ` [PATCH net 3/3] net: hns3: fix VF ID issue for setting VF VLAN Huazhong Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fbb92429-7242-3716-0f53-35e6b83aeeb2@huawei.com \
--to=linyunsheng@huawei.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=tanhuazhong@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).