Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353489pxb; Mon, 20 Sep 2021 19:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1qBxkxJGk0BRSeM+v0eglZyN1umDix5J8kzuYyEhChEIDUgOgQsvMp9z/TBkMtOoTfgEJ X-Received: by 2002:a92:c64a:: with SMTP id 10mr19525267ill.102.1632192710971; Mon, 20 Sep 2021 19:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192710; cv=none; d=google.com; s=arc-20160816; b=SBvKdBIrERQpZt/y64H/jRv1zQw6UZ0XFMazs2iWvCPlLfjazZidzWVpEHtqV5EdQW EH0vkF4c6J41uTFnmChAZzA48+3v57wRFsdwUMuox2pciEVTjqzZ5TyaZc/tK7kv1IhU sJj7OaT2a7sL5bqPJudzh+c/W87+CKzy6s6syPUcJIIIur34kIw/Vf4NRBsyUKRTU4BA USlkPN4f82fZLEiUTY5fn0WHjBREa0SWsSRBOOmspCuQtVVbyZKB3v3Kg0AdFvWbe1yW 9OQILjm771ZXLiYwE5F9XCB1JyvNmr1ceHboXMS2pIZg+j37v9B1HiKl8+hC7Ae6/kEg vjqQ== 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=HdSmhsQugTn75jPXc5YwiPR1AVsYUePImrwZs0yJB7k=; b=oxjSAPMW5XxNqntXPEMCJWVN7QK0moFePcI5vdT9+5bDdlJhE8eibHI3tg2MZ951UF giREBmVnF3rJC9kp6EcGWCG76V2arzkVM1E6xddQyFViWmDpqgvTVRvBOXWIE/a0Q3gW MBsFaGY7mz6ynZMd26LAzHRttOye5poq2+wMqMkQF/yNjwfQPquDsMA3J+G748rD8ngc +kazZItaqFYRPHnS3r83XvwrGsvFoNNpZueaWlMkB7iMRrtSeczp+ZO7z98JTCLPHus9 wTlhsIvD4xF0rZ0GRTAWL6d2J/FLkEx+y+M4euEr4fTqIYcUlrlr7IU+nFYP9bIWGyww ZIOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a1ul84jb; 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 k126si12379100iof.103.2021.09.20.19.51.38; Mon, 20 Sep 2021 19:51:50 -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=a1ul84jb; 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 S1384273AbhITSrb (ORCPT + 99 others); Mon, 20 Sep 2021 14:47:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:56264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382624AbhITSmL (ORCPT ); Mon, 20 Sep 2021 14:42:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1343360EDF; Mon, 20 Sep 2021 17:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159096; bh=2ukfzemYUJPIp38Lz1VzoE+4LlfYKGpUjT+Qwg6EOaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1ul84jbXxpsaKdcG1BRmTRNA+fOIIwi51blMAKNc6fhthlTkg8RuRxTkhQGlzx6f wWEv2gctSHfg+wjuesFZu8Fx1N0T1v5fSgJlnx0+skbXL7KP8nwafytTglcHQsE4Su 6zOKER9KhuCualqNCUBypqacHx9y74oji7jayKkc= 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.14 075/168] net: hns3: pad the short tunnel frame before sending to hardware Date: Mon, 20 Sep 2021 18:43:33 +0200 Message-Id: <20210920163924.107492833@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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 @@ -73,6 +73,7 @@ MODULE_PARM_DESC(tx_sgl, "Minimum number #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 * @@ -1425,8 +1426,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,