Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3066269pxj; Mon, 17 May 2021 16:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbrbzNippUvSc0S4bK1G/P+pbS1GBb7YpaOdS5QmspZdt2yPwIDHPMPsyYFiiCxrSh/ZfK X-Received: by 2002:a05:6402:203c:: with SMTP id ay28mr3283202edb.100.1621295711603; Mon, 17 May 2021 16:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621295711; cv=none; d=google.com; s=arc-20160816; b=Q/lUvan1bFOEfi+L4S34G/vSsVuIFa9gnlxervyzdsxcbCwO6y/BIDkj6dVZUoPT+I c7Z+TIi5HkyN4RTEh3cXmltPBSv2eoZKVC0iMnZ9Av9Wq9KCLCRz9nI41LQVqN1J6s42 XZFDL3DUmaMDw/YUPIR9/vRG9VzeJjz9XjbVH3rWubAgqSviLHwyBPMoa7q8jarGl/E4 +TndrECmTqp2rprDDM62QCdoU0K1adoPDUHaGbJeuldIQmHHcUGNHreaxz9VnDfq01/c Tz/ge0E388LgoLbY2GpnqsLlXv2F/iLH4ofJfpVOXANq66tEmdcCZN1Rb2oABmbY4jJB Weqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lwmV62fP8WNbkMSqMoikB9SCSBKgzlN377lJt14BrTc=; b=SEdpq4/A+2gr8foSJxeUxghxHShi7w4+nyIl4A0y3F/ZtEifIYbRpbQ9M4tsUu/0pi gmi3IB3jJOUyorqx5EFOhlV9Z/28+3JNSyzuEtv7rEaiGSP4pHtzA2PC8YF5VOKCNNLz 9delnB3PFGGTgs/9Lth+WcdQnBC5CRNg8d8H6kuvFvtrx2lns7JS36kBBSDTApConhRg npVhIW5j+tcV3Jb7kFPXCkVJmbbR8WWbPLeVaV6nIuhhVJBGGDSlJE3IRLJQpBG6+svY AnGk4BqJHYgWb0s482tVd4tayA2YPSus4Gew7uTn0tweF7WtmYnuLu9hX5Nq3pI9B8mv 7SyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="C/zWR2uC"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z27si11178452ejc.287.2021.05.17.16.54.47; Mon, 17 May 2021 16:55:11 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="C/zWR2uC"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239531AbhEQOYW (ORCPT + 99 others); Mon, 17 May 2021 10:24:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:58640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239008AbhEQOVB (ORCPT ); Mon, 17 May 2021 10:21:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 780E96145A; Mon, 17 May 2021 14:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260690; bh=deHbqRUUgZPz+UsnjEDUFUzpigvktFyFPnMrbOKAWJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/zWR2uC8hzYVltH18OljJjuA7EIyEPsrTRGreiyfXLju58Otvl3nB8dXorqs333b R4JlZ/4tOSy3bXgda/0hfDwv6KZGNJzSvZLKBJlJH7Hmrn69BASKbp2hRgu6YD+ogU YB15jPHv4P+cFFAPVj+6r57jJhpu+QvGFjbIba+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hao Chen , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 196/363] net: hns3: fix for vxlan gpe tx checksum bug Date: Mon, 17 May 2021 16:01:02 +0200 Message-Id: <20210517140309.207389447@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hao Chen [ Upstream commit 905416f18fe74bdd4de91bf94ef5a790a36e4b99 ] When skb->ip_summed is CHECKSUM_PARTIAL, for non-tunnel udp packet, which has a dest port as the IANA assigned, the hardware is expected to do the checksum offload, but the hardware whose version is below V3 will not do the checksum offload when udp dest port is 4790. So fixes it by doing the checksum in software for this case. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Hao Chen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 59d4d1e87f65..d24bafb7ce46 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -823,7 +823,7 @@ static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto, * and it is udp packet, which has a dest port as the IANA assigned. * the hardware is expected to do the checksum offload, but the * hardware will not do the checksum offload when udp dest port is - * 4789 or 6081. + * 4789, 4790 or 6081. */ static bool hns3_tunnel_csum_bug(struct sk_buff *skb) { @@ -841,7 +841,8 @@ static bool hns3_tunnel_csum_bug(struct sk_buff *skb) if (!(!skb->encapsulation && (l4.udp->dest == htons(IANA_VXLAN_UDP_PORT) || - l4.udp->dest == htons(GENEVE_UDP_PORT)))) + l4.udp->dest == htons(GENEVE_UDP_PORT) || + l4.udp->dest == htons(4790)))) return false; skb_checksum_help(skb); -- 2.30.2