Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp252011ybg; Thu, 17 Oct 2019 22:26:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwamOCRLmfmubS2l4/gf44RX1xtI/HQxy+wOsI9qP9bl++2ptOpW1g2W+CLjcnGcNL9clB8 X-Received: by 2002:a05:6402:2c5:: with SMTP id b5mr7838144edx.45.1571376377609; Thu, 17 Oct 2019 22:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571376377; cv=none; d=google.com; s=arc-20160816; b=Ky+loOZqcuG+9EwBo2XOZMVC2gl4ZBi494GTI0QLBGioxDtetpmEr64KJuOYnR+UcD P2SWiORsZ+qilUI0MA0Ot/bqKj3+WNcoD/efRpsxJShUgIdHd/F6mqvSztqSPd4awIai jP4/Tt4TkdByxMpLOyM6zCHA6GTLvqyrS+teny6FSV1UclC/jyy3+m68EnehbBqUNBGe Pw6tzWZW+X/s76rPpuWCc+ON4d/ip9k+fZQSrsC/4Tk6CcdmCHgps0d19Nkmrrmav564 PVDyEaOD5Ax9yrydeb+vUcPz9OlV8gKcGXBuwN1kRIpTbC0CeeMFlnNdpqsoAE71ru+S iRhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=gbLgnLtv07B383dYm3OD2JZr7VSxmU2NvwPXFyMkmL4=; b=mvgw4eLXenkXLgexrHOa1SOlYoEHJDfHiVQd1RyvyQZebw4mKsHVKDjVwPZroRP3Y7 T0YKIjmeoks7yJvtSmwr3bcwl6EQztf2Mr6r589ZjRKlcKM4FB9x9nqLhhUR4kV16SlK 1wQmLcnpbKZf5dGAvDtMsBIj0o7BalVKr7jrdKVmdEM6NVezd8n3zyBNi2G5CnVtAD3J pSifmi/Z5j70Hmfi0XKo05BLR6Bn1STbFVghAu7ZzTRSXzFN+iA5q/NP3+kSz8VM5RQ8 XO3P2WVQjPULT33dGDh0zKdlMHkTbbTsM7jFaJH+4z4gzBPKwH68m6rP0gi+5J2j3L81 JgXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si2628849eju.25.2019.10.17.22.25.54; Thu, 17 Oct 2019 22:26:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391758AbfJQAyk (ORCPT + 99 others); Wed, 16 Oct 2019 20:54:40 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4193 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388082AbfJQAyk (ORCPT ); Wed, 16 Oct 2019 20:54:40 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 28EAFA16A269D42F243C; Thu, 17 Oct 2019 08:54:37 +0800 (CST) Received: from [127.0.0.1] (10.74.149.191) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Thu, 17 Oct 2019 08:54:29 +0800 Subject: Re: [PATCH net-next 11/12] net: hns3: do not allocate linear data for fraglist skb To: Jakub Kicinski CC: , , , , , , Yunsheng Lin References: <1571210231-29154-1-git-send-email-tanhuazhong@huawei.com> <1571210231-29154-12-git-send-email-tanhuazhong@huawei.com> <20191016101817.725b6d28@cakuba.netronome.com> From: tanhuazhong Message-ID: <2bf7e500-66e0-1b24-f940-5f8c4952038a@huawei.com> Date: Thu, 17 Oct 2019 08:54:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20191016101817.725b6d28@cakuba.netronome.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.149.191] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/17 1:18, Jakub Kicinski wrote: > On Wed, 16 Oct 2019 15:17:10 +0800, Huazhong Tan wrote: >> From: Yunsheng Lin >> >> 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 >> Signed-off-by: Huazhong Tan > > 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"); > > > . >