Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1301170ybk; Thu, 14 May 2020 05:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu3SDALMD7jySsIooyqewuOKCL5qWz1ekv/3N5g4IZKdBetRLDChEz754padwwSesRqLpl X-Received: by 2002:a17:906:84cf:: with SMTP id f15mr3766205ejy.185.1589460317415; Thu, 14 May 2020 05:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589460317; cv=none; d=google.com; s=arc-20160816; b=sSx0yGvTBd1zC2BDFpkrYBVJwaN+5pnFOm/40U+U9D6V7OH5Zv3RHcEx0/P1fit/Ih M7kRGPYYbsAZ95khmXIuWlzTAq6jBic1zkUFe+Os4tHY47FAq8RWx+XMcFjcAcB+d36M 2jchqvEvX/cVbU6kzH9IXw6kyE1NpF8B+awmGLsajwMzvXkNOjcrzVVehJfuGQmzX+kK j28vDc0Ve/jKiTIq4YSUHcv9/wGiMjpunDfWUqSZqzpf2Pawy5zDSI/Lk+X241DndomF linWXCKaQpF2gr884axP7K7EN0sWfOo1yyHf1Juu/0hz0DR3ywZ0HTZtEnuKv19x2mKc BkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=6Dy5A5305dncf1P0jAS3+8wEqyp5PYJV7usJT40UXxo=; b=iJXboRjjDLzEfqOpYLasoU7lanQ22sx512WE+sTt9sd6c492VHbHSC6bGcYfvw4+JZ 5eblMRUaAUPFsKmaIiLrZ0gMhL+4O1kWc1JMXav0PYVxK8vYMlTTKMtnKkwxKF6wuG5r l7gjz1qchbw2//+RconqjWwwV0s69tmdNGBzb9rR4P28IpSD8oFL5zM5EAsu0kKsrrQX 1XHcJfZYxfdo0BrmIi6D6eUrpLaK+qJBaxbyYxRkxJ742sn6LyCLaepOH6WFHVXTKJlW qsvyyIQs4hzfyNECrOn/skjbc1H348gftD2Pea4d3Gwl3aQcbSZbwd8PByZh9Nyk+uzf N3ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx7si1878272ejb.149.2020.05.14.05.44.55; Thu, 14 May 2020 05:45:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726388AbgENMnB (ORCPT + 99 others); Thu, 14 May 2020 08:43:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59340 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726117AbgENMnA (ORCPT ); Thu, 14 May 2020 08:43:00 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 108BAD8A4B1C2E6F9133; Thu, 14 May 2020 20:42:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 14 May 2020 20:42:50 +0800 From: Huazhong Tan To: CC: , , , , , , Huazhong Tan Subject: [PATCH net-next 5/5] net: hns3: remove unnecessary frag list checking in hns3_nic_net_xmit() Date: Thu, 14 May 2020 20:41:26 +0800 Message-ID: <1589460086-61130-6-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589460086-61130-1-git-send-email-tanhuazhong@huawei.com> References: <1589460086-61130-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The skb_has_frag_list() in hns3_nic_net_xmit() is redundant, since skb_walk_frags() includes this checking implicitly. Reported-by: Yunsheng Lin Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index c79d6a3..9fe40c7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1445,9 +1445,6 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) bd_num += ret; - if (!skb_has_frag_list(skb)) - goto out; - skb_walk_frags(skb, frag_skb) { ret = hns3_fill_skb_to_desc(ring, frag_skb, DESC_TYPE_FRAGLIST_SKB); @@ -1456,7 +1453,7 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) bd_num += ret; } -out: + pre_ntu = ring->next_to_use ? (ring->next_to_use - 1) : (ring->desc_num - 1); ring->desc[pre_ntu].tx.bdtp_fe_sc_vld_ra_ri |= -- 2.7.4