From: tanhuazhong <tanhuazhong@huawei.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <salil.mehta@huawei.com>,
<yisen.zhuang@huawei.com>, <linuxarm@huawei.com>,
Yunsheng Lin <linyunsheng@huawei.com>
Subject: Re: [PATCH net-next 11/12] net: hns3: do not allocate linear data for fraglist skb
Date: Thu, 17 Oct 2019 08:54:28 +0800 [thread overview]
Message-ID: <2bf7e500-66e0-1b24-f940-5f8c4952038a@huawei.com> (raw)
In-Reply-To: <20191016101817.725b6d28@cakuba.netronome.com>
On 2019/10/17 1:18, Jakub Kicinski wrote:
> On Wed, 16 Oct 2019 15:17:10 +0800, Huazhong Tan wrote:
>> From: Yunsheng Lin <linyunsheng@huawei.com>
>>
>> Currently, napi_alloc_skb() is used to allocate skb for fraglist
>> when the head skb is not enough to hold the remaining data, and
>> the remaining data is added to the frags part of the fraglist skb,
>> leaving the linear part unused.
>>
>> So this patch passes length of 0 to allocate fraglist skb with
>> zero size of linear data.
>>
>> Fixes: 81ae0e0491f3 ("net: hns3: Add skb chain when num of RX buf exceeds MAX_SKB_FRAGS")
>> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
>> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
>
> Is this really a fix? I just wastes memory, right?
It is a minor optimizations. This fix tag is a mistake.
Thanks.
>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> index 6172eb2..14111af 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> @@ -2866,8 +2866,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring, struct hns3_desc *desc,
>> return -ENXIO;
>>
>> if (unlikely(ring->frag_num >= MAX_SKB_FRAGS)) {
>> - new_skb = napi_alloc_skb(&ring->tqp_vector->napi,
>> - HNS3_RX_HEAD_SIZE);
>> + new_skb = napi_alloc_skb(&ring->tqp_vector->napi, 0);
>> if (unlikely(!new_skb)) {
>> hns3_rl_err(ring_to_netdev(ring),
>> "alloc rx fraglist skb fail\n");
>
>
> .
>
next prev parent reply other threads:[~2019-10-17 0:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 7:16 [PATCH net-next 00/12] net: hns3: add some bugfixes and optimizations Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 01/12] net: hns3: remove struct hns3_nic_ring_data in hns3_enet module Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 02/12] net: hns3: fix TX queue not restarted problem Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 03/12] net: hns3: fix a use after freed problem in hns3_nic_maybe_stop_tx() Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 04/12] net: hns3: fix mis-counting IRQ vector numbers issue Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 05/12] net: hns3: fix VF VLAN table entries inconsistent issue Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 06/12] net: hns3: optimized MAC address in management table Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 07/12] net: hns3: minor optimization for barrier in IO path Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 08/12] net: hns3: introduce ring_to_netdev() in enet module Huazhong Tan
2019-10-16 17:10 ` Jakub Kicinski
2019-10-17 0:50 ` tanhuazhong
2019-10-16 7:17 ` [PATCH net-next 09/12] net: hns3: minor cleanup for hns3_handle_rx_bd() Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 10/12] net: hns3: fix VF id issue for setting VF VLAN Huazhong Tan
2019-10-16 7:17 ` [PATCH net-next 11/12] net: hns3: do not allocate linear data for fraglist skb Huazhong Tan
2019-10-16 17:18 ` Jakub Kicinski
2019-10-17 0:54 ` tanhuazhong [this message]
2019-10-16 7:17 ` [PATCH net-next 12/12] net: hns3: log and clear hardware error after reset complete Huazhong Tan
2019-10-16 17:19 ` [PATCH net-next 00/12] net: hns3: add some bugfixes and optimizations Jakub Kicinski
2019-10-16 17:50 ` David Miller
2019-10-17 0:56 ` tanhuazhong
2019-10-17 3:27 ` tanhuazhong
2019-10-17 15:47 ` Jakub Kicinski
2019-10-18 0:57 ` tanhuazhong
2019-10-17 0:55 ` tanhuazhong
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=2bf7e500-66e0-1b24-f940-5f8c4952038a@huawei.com \
--to=tanhuazhong@huawei.com \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@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).