Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7145716imm; Wed, 27 Jun 2018 21:33:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2Yd3RfoIO1HOBNUArQujaCQbbuSMfBrEihDNmI5atWa7K6MSlOa14QzNLsNHITsngSuss X-Received: by 2002:a62:2541:: with SMTP id l62-v6mr8655557pfl.0.1530160411445; Wed, 27 Jun 2018 21:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530160411; cv=none; d=google.com; s=arc-20160816; b=cKI0R71Ih4c++zmy3ya+8kXEmLV8lGdeR+YYcJz7rUUPyzbqDRBuMIV4saCvhB2mgZ 0MwAZ2vQd4LKPXCQwepwURgGpCfODsxD6zVSHuOUYFaoA5ESg11eAF7oL3w/RD+Iz82Q fG5wx+0XQaAhe6IRl7UFYzeZgA7hNra8FId/YKusr9Z9f1Bo+oaHLY10dvyO1kNH4wl0 4IeGsSnf1jeLU5q2/vbmetrYPrJwEWSRNTpyndbp2JDYtNSIku3dDYDkFC8hq90Nszcy QJbCcG0LPbZ7H7k8Xn3gJERgctINGB80zEG5rKUDh5DL3FzMr76L4jyiGvSxXoPlutR0 720g== 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:arc-authentication-results; bh=ssQmyItUjgq7W7j+qoRzA/FdnJeQQddOjpmbsiK2nHI=; b=vaAOj0QOQrziR4UhhyTOJQqIT8NrQUoNylRLAr8oZjezdq+9ojdxjFmv2Tqtt60HHO YM66xDCeApDIt1S2EhBbLeuEZjKCYkjKN62OESbAIgtq7r8BDLUqKS2GGiZKastSWoF4 Y2AZbd9ynbohYKBT+4TESPoaEAyNd2gRPw4pp27MYXDozXo2CKIWgybe1hGMhX6R+ovW e7m7SpKYNDJgXuTD809i+WtjOXU5z5Q4tAeJvQL/LkVavC2E/HpAW8G+a7IJfngj2PWX h++mrhqCsrXpHOmGAo5Uedi7lV9HyocKK5HPKIX2acz9oAez4usXZaWpJSRcg6WL39I3 LNpA== 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 9-v6si5491836pla.59.2018.06.27.21.33.17; Wed, 27 Jun 2018 21:33:31 -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 S932434AbeF1Dna (ORCPT + 99 others); Wed, 27 Jun 2018 23:43:30 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8740 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752993AbeF1DlM (ORCPT ); Wed, 27 Jun 2018 23:41:12 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 462068A003719; Thu, 28 Jun 2018 11:40:58 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 28 Jun 2018 11:40:52 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 04/11] net: hns3: add l4_type check for both ipv4 and ipv6 Date: Thu, 28 Jun 2018 12:12:22 +0800 Message-ID: <1530159149-122284-5-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> References: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HW supports UDP, TCP and SCTP packets checksum for both ipv4 and ipv6, but do not support other type packets checksum for ipv4 or ipv6. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 25a73bb..99bb6a8 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2103,11 +2103,11 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb, skb->csum_level = 1; case HNS3_OL4_TYPE_NO_TUN: /* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */ - if (l3_type == HNS3_L3_TYPE_IPV4 || - (l3_type == HNS3_L3_TYPE_IPV6 && - (l4_type == HNS3_L4_TYPE_UDP || - l4_type == HNS3_L4_TYPE_TCP || - l4_type == HNS3_L4_TYPE_SCTP))) + if ((l3_type == HNS3_L3_TYPE_IPV4 || + l3_type == HNS3_L3_TYPE_IPV6) && + (l4_type == HNS3_L4_TYPE_UDP || + l4_type == HNS3_L4_TYPE_TCP || + l4_type == HNS3_L4_TYPE_SCTP)) skb->ip_summed = CHECKSUM_UNNECESSARY; break; } -- 2.9.3