Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp477049pxj; Tue, 18 May 2021 07:35:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwADLeDICyI2poypSDTwVzHbYmsJbXwLetq7hcbbxyASeKsSzXDYzqr6PpbZuIvhMRb0q+e X-Received: by 2002:a17:906:604a:: with SMTP id p10mr6396267ejj.148.1621348554383; Tue, 18 May 2021 07:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621348554; cv=none; d=google.com; s=arc-20160816; b=0y1nvAGM9en/ZVNwslec2YJv4/3BYdSzfYkyg+wFELnctOy307kJ6EE8Ec/4Xlyuzj N9K6qifAE+yLbRx3V94Fv6bnnYatWMpRzNGp3QOXeSCzuKk2dMHUPmHR67Yb5HaK5tER BsfRwbaQ31xKQAtXdOPfIJyaUi4R/KyLAKITpjZVG+jd0lIXDEIjhmtg8UscJqHHvLnI VVjpMI9zv7Sff2o0kc32n9WnGGvDcIcYC5EO0JSSx3WrQFLEU5rtLQ7Zy02zOgYsGK6D urG0D5p6joZ2L2hz8k5wZJn112Iq/S4j4ofshFoAot+FND7/hDY5o33ASoo8a+Az/idS JqSA== 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=vszTBeY2cfc5IvOrKNRmqmYTIOAIWrneHnpKg75Hjb0=; b=iMYghgQZkLVkJBMk29blYiIAWfou7t76ZS1gTRvzzk4WLe5OiQJ4XwfL7KqE1R+H4e cVs595LhMVolqxXI8gLI8QSMFJMj4ydB//tyt6qdBrfo51aG9D/4ZfwRKugbu33e519X DpM5+gsuG/oY09Tw9cP3dO9S+MZ0mNqFDAkDe0PyF4ZJJxwADOMK6mmlkq64mBGiIsUF oQ+0q4vNmRYZgZpqVPzS77UNxk41VIKBy5gGl+KxGN8r1GeDHCha/rxLMUPTOxkqb6Mj +dYxwCT9e70QiqqfWb+WURbfEvEsdAvrD2Coa8JNBV703G07arSC2hE3uiS94uGW9gKm evQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZiIspJXN; 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 z14si159879ejj.11.2021.05.18.07.35.10; Tue, 18 May 2021 07:35:54 -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=ZiIspJXN; 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 S1344721AbhEQPpc (ORCPT + 99 others); Mon, 17 May 2021 11:45:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:53994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245560AbhEQP35 (ORCPT ); Mon, 17 May 2021 11:29:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3455D61CB4; Mon, 17 May 2021 14:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262260; bh=xyGP8voSp3t7WUe7MsHcqhiMr7Su3q/1F7FUnHGZ1e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiIspJXNG2C8N/hxLmZO4/1Chan/TEsIenKxHJPM+sJ7pgT/0zKtpdIVaYhHUtZVl vmk/ctBuo6Lr3oWxc1MK4IghmWFOwHLMSAd4jgof3TDPCg55mvlWrY7DhEQS7KpQkM 3SJyy8dCwxDsavVi8UmNLNhiHcr3LtQS/+hToIsU= 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.10 148/289] net: hns3: fix for vxlan gpe tx checksum bug Date: Mon, 17 May 2021 16:01:13 +0200 Message-Id: <20210517140310.134435585@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 6066cb0a5abb..3a42b96cb843 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -778,7 +778,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) { @@ -788,7 +788,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