Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1620191imm; Fri, 6 Jul 2018 03:32:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfxthU1dLdExiRdmLn4TxCSPOGL52/xUy9aVEsR9vWgaG26hRflkbr1Gn3AtQ6A5cQSGAav X-Received: by 2002:a65:5a49:: with SMTP id z9-v6mr8971638pgs.244.1530873163408; Fri, 06 Jul 2018 03:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530873163; cv=none; d=google.com; s=arc-20160816; b=cIkbEYiDYZfr3o5ocR7F4f2x0boikz1QYwrdXNCUYvpcVLKpIySF9FTVh4bQr5ojv7 0MDo4nxtY41Lyr1S3B/8KGfPneAvCZNLcAjGhOBxtUOZXRf4TOh8hfXI2J1ciD2DQ/iY EuG95WoI79R/hMkFBqSUlCrHA7mBhcXvZe8g9X5Tla0ZiyMMonil/N9qNEJIjhdoc1lQ cZ4HzPN0v0WdeDfqyebBZLyJMRV07MemYNopjA4JPHZctFwnpYwGj7/9UEgu3IdV6o/z 7Geh5Hy6hckEqt1KJ2jQjPIyre5zB8s/eNswewOopUcxM8i6uJvBlefTY+9swIN3Dr7n S5MQ== 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=7H5g8SOL+BObaxpfQ3ewPRG6nyJ40q+EBK9xzBR+KW0=; b=00txZCaof0CsbC23jYctEpysvdtnaCvWWWaEabclUiNWNO7JddaPXFsFeI4MDgoJmY tJ/IgSHl9nORsEswo3JZXzc4/T6rOPXRzaY++vWxn0bYNwqssevSg9NC8soIdzxO9htB b6aq+ShC/JXxo6TTZdk11nsVsvhTzqYPXidxArDTcKSusJmmcYfxEUBYEVdyWIFgJeWx ty6GIKwdw5zYvHJLdgiVsw/TJqJISIN2jHcqRsriA56FNPgroCUabu3bpVQ4+9MFrlqy SL6c6LN7PTR+YX+CxvhluLevRlmHnu6pzFaVPp0wtP8T0U7LQ14MZMY1bVgrKh/KpeUE CS/Q== 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 v17-v6si6400869pgk.135.2018.07.06.03.32.28; Fri, 06 Jul 2018 03:32:43 -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 S932510AbeGFK3V (ORCPT + 99 others); Fri, 6 Jul 2018 06:29:21 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:9161 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932439AbeGFK3T (ORCPT ); Fri, 6 Jul 2018 06:29:19 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 93EFD6ABBC82C; Fri, 6 Jul 2018 18:29:05 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.382.0; Fri, 6 Jul 2018 18:28:58 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 04/10] net: hns3: Fix for l4 checksum offload bug Date: Fri, 6 Jul 2018 11:27:58 +0100 Message-ID: <20180706102804.196-5-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180706102804.196-1-salil.mehta@huawei.com> References: <20180706102804.196-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin Hardware only support tcp/udp/sctp l4 checksum offload, but the driver currently tell hardware to do l4 checksum offlad when l3 is IPv4 or IPv6, which may cause checksumm error. This patch fixes it by only enabling the l4 offload when l4 is tcp/udp/sctp. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index e5e51e8..c211450 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -791,16 +791,14 @@ static int hns3_set_l3l4_type_csum(struct sk_buff *skb, u8 ol4_proto, */ if (skb_is_gso(skb)) hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L3CS_B, 1); - - hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); } else if (l3.v6->version == 6) { hnae3_set_field(*type_cs_vlan_tso, HNS3_TXD_L3T_M, HNS3_TXD_L3T_S, HNS3_L3T_IPV6); - hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); } switch (l4_proto) { case IPPROTO_TCP: + hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); hnae3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_M, HNS3_TXD_L4T_S, @@ -810,12 +808,14 @@ static int hns3_set_l3l4_type_csum(struct sk_buff *skb, u8 ol4_proto, if (hns3_tunnel_csum_bug(skb)) break; + hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); hnae3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_M, HNS3_TXD_L4T_S, HNS3_L4T_UDP); break; case IPPROTO_SCTP: + hnae3_set_bit(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); hnae3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_M, HNS3_TXD_L4T_S, -- 2.7.4