Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp930983imu; Sat, 17 Nov 2018 12:23:11 -0800 (PST) X-Google-Smtp-Source: AJdET5f+Qhas/uOclyofd0SoDs7Uu6H9j9DV1yYbDsCf71ewrGlJocrGKkBYW5FbttxwPUrt52OK X-Received: by 2002:a17:902:147:: with SMTP id 65-v6mr16363581plb.140.1542486190998; Sat, 17 Nov 2018 12:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542486190; cv=none; d=google.com; s=arc-20160816; b=QBTnBVcdILQDPKIJIU+mwpAbc1Wo+cV2FHSy69HB7th3KKiRe3wZ/JDgnNbCcd9Sdd aHx1jm4DLgaP9lOdmeYOkyR8PnIQW+DWnU/Y2See7dAGNfVF+oP+/xpBB8IqG+sL6AWj Uwpl+gJkCWQ/HRUzup5+Ur2CNw2ujFvfIapFYFW/MLbTWy0O31YNnUJWyYuqBXvrrKdX kPq9Ri5vzMiybogj35CNuBWkPuxSLrrC451/PQ1M6/8VqdwEYseeptJUKdVz07lIljiY FoIFBM18AFa2nYKcZJ6EW7M1sFYRTjpuMdxtpj09rlajcs0+xb2vW0BrLwDr2bGmMP9k JNKQ== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=LGMMBoKRjqfQmyqA178q6Er6LzEwfz6cxNqs35wN41A=; b=kozylt2Z3g56CzGApdEUT1vrGDFnmB2NfOkCTnxF+QQH8lOFmL6FNg8RPNb4L1yWR6 qvVEMRbVEzuU14zppc6i31VANyJl1GpnqG1fTCOxUEjScVe6a86gvHdTEMnFIW1P2XE3 VHYw8YUpubUD8ACjFmMBsBSnxhmd8/ILEfKXV1w1rR58xhGaX7MJf09QuJctF7486Dm4 a0s9tKLEhg6CEY0+UtvsgFyxMbpEJ++li9q87B2SAhGIsaSc4BDO7LbbocyaGHyu05R8 oOb9TMBa0RanG77W+syVN0dLEyyqDz0JAtKUi4U55HSK8z9OYKL7qgYBMnMrofN68P7V sj4Q== 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 e68-v6si18323949pfb.215.2018.11.17.12.22.53; Sat, 17 Nov 2018 12:23:10 -0800 (PST) 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 S1726481AbeKRGkD (ORCPT + 99 others); Sun, 18 Nov 2018 01:40:03 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:34678 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725835AbeKRGkD (ORCPT ); Sun, 18 Nov 2018 01:40:03 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 7CFE6146FE6EE; Sat, 17 Nov 2018 12:22:13 -0800 (PST) Date: Sat, 17 Nov 2018 12:22:12 -0800 (PST) Message-Id: <20181117.122212.954465454738045729.davem@davemloft.net> To: xuechaojing@huawei.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, wulike1@huawei.com, chiqijun@huawei.com, fy.wang@huawei.com, tony.qu@huawei.com, luoshaokai@huawei.com Subject: Re: [PATCH 2/3] net-next/hinic:performance improvement for HiNIC From: David Miller In-Reply-To: <20181115200548.5326-2-xuechaojing@huawei.com> References: <20181115200548.5326-1-xuechaojing@huawei.com> <20181115200548.5326-2-xuechaojing@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 17 Nov 2018 12:22:13 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xue Chaojing Date: Thu, 15 Nov 2018 20:05:47 +0000 > In order to improve performance, this patch adds rx checksum offload > for the HiNIC driver and optimizes the code. Performance test(Iperf) > shows more than 95% improvement in TCP streams. > > Signed-off-by: Xue Chaojing What kind of "optimizes the code" is being done here? Be explicit. And such unrelated changes to supporting checksum offload should be split into another patch. > + csum_err = HINIC_RQ_CQE_STATUS_GET(status, CSUM_ERR); > + > + if (!(netdev->features & NETIF_F_RXCSUM)) > + return; > + > + if (!csum_err) > + skb->ip_summed = CHECKSUM_UNNECESSARY; > + else > + skb->ip_summed = CHECKSUM_NONE; Does the CQE status word provide more information? Like the checksum computed over the packet? That's more useful than a binary "csum correct" state. > +#define BIT(nr) (1UL << (nr)) This is unnecessary, please include linux/bits.h and use the definition from there.