Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351103pxb; Mon, 20 Sep 2021 19:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW0YW/nJPSugtiF5U+2m77lL/wMsFllZicYUKkYxkMjU72lJVyTBimrp6zLn3THwrIRFKe X-Received: by 2002:a05:6638:3726:: with SMTP id k38mr22286825jav.105.1632192403951; Mon, 20 Sep 2021 19:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192403; cv=none; d=google.com; s=arc-20160816; b=zw60t9CIqp87O04Enn9EeeJ8VQOaJ5LqfEwmKuXnrrkq0Hn2GSPaqVElJkJdWU9/k8 u7cIl8U5Qn39wpKpZrx2Zq4u/JiYYp6pMg6bvG5gkyFUFr4IjhFy4ikTDZ2x6ZNTfLJt U8ErNbIPykHfVBrQgFVftWPtbhq3Mob0ImBjpAjeQ9fVK2MYin5vUcLGt+NrzTWvjGkO oKGrMNrlG8Zjz7YAIVv7EYa3vAgbCR453Sjit8Bu3/bX1egbc9lfY+yzCVA2IvIBGJXR qwt5U8xzdqnB7GogGsQF0I67/NPk9nKTTYiHGZIYNtSK7EDbCh5/ZmpOP2AhxZpGQ15r XYQg== 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=GRhqONE/M4u+LkRotsgKLRMkdWhZlQ8uDKNiKWL8zO4=; b=WsBnk1v4WRrrXLXFFjLVL+VNtp/zcVGxIx4YdwVANBNXy9GrjxwU441yYRDRx4tmFK DOxzpKWjyfvlXj9SUxUMgzm9k2kCOHzJv0fM/VfSq55v+QhBeZdhkKGy1FuAw0Qdrs4U oyc1bFqgKWz9B1dkd6DEiDXYhM3M2qlMdUv7bp64FCrRLNVlAhxQX5nqhFbGnFknmDBc nLv/ZnRd6m8yvOyknNB5zeu6IEvgsvVAYdmYYd2EzB3/xr90/GEL6kC/FX2Cglp2N8Im xlZsYgGYE+HLGZ5Q1bll75F/RQlq8g9ENH2rySpicXgL7U5Q8h4bVaGoTfTqpNbH6rAY SsHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AGYuljDp; 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 i12si13291438jaf.41.2021.09.20.19.46.31; Mon, 20 Sep 2021 19:46:43 -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=AGYuljDp; 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 S1379278AbhITS2t (ORCPT + 99 others); Mon, 20 Sep 2021 14:28:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:44476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377998AbhITSW0 (ORCPT ); Mon, 20 Sep 2021 14:22:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D308632C0; Mon, 20 Sep 2021 17:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158662; bh=lQy3aUGkazS7jvwfZTLBzYM7ykK1mJIA2BHSH1PLwfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AGYuljDpABZG+oAsePRI2GUg/MCWOQgyCKFqur18tharnkqxG4K1f2RK/N58pjnLI cE7r44HMys7SZcCtesrK80V8Jx73uozhuE2xztwDcfirOqGTxdBFL+z4XXoaoCU+U5 A8RoCzrWmBSL2LhGqA/GtvcJLKKFlVgmAI+teHqk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yufeng Mo , Guangbin Huang , "David S. Miller" Subject: [PATCH 5.4 228/260] net: hns3: pad the short tunnel frame before sending to hardware Date: Mon, 20 Sep 2021 18:44:06 +0200 Message-Id: <20210920163938.865212406@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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: Yufeng Mo commit d18e81183b1cb9c309266cbbce9acd3e0c528d04 upstream. The hardware cannot handle short tunnel frames below 65 bytes, and will cause vlan tag missing problem. So pads packet size to 65 bytes for tunnel frames to fix this bug. Fixes: 3db084d28dc0("net: hns3: Fix for vxlan tx checksum bug") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -56,6 +56,7 @@ MODULE_PARM_DESC(debug, " Network interf #define HNS3_OUTER_VLAN_TAG 2 #define HNS3_MIN_TX_LEN 33U +#define HNS3_MIN_TUN_PKT_LEN 65U /* hns3_pci_tbl - PCI Device ID Table * @@ -931,8 +932,11 @@ static int hns3_set_l2l3l4(struct sk_buf l4.tcp->doff); break; case IPPROTO_UDP: - if (hns3_tunnel_csum_bug(skb)) - return skb_checksum_help(skb); + if (hns3_tunnel_csum_bug(skb)) { + int ret = skb_put_padto(skb, HNS3_MIN_TUN_PKT_LEN); + + return ret ? ret : skb_checksum_help(skb); + } hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4CS_B, 1); hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S,