Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3691866ybv; Mon, 10 Feb 2020 04:48:20 -0800 (PST) X-Google-Smtp-Source: APXvYqw4ZIslBoLIYua6tcDkfB5QE9BLXQ8Utf4jA6XZKila8XIHYjb1aCfzdv7VyGdX2bClVxDI X-Received: by 2002:a9d:7ccd:: with SMTP id r13mr919191otn.56.1581338900208; Mon, 10 Feb 2020 04:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581338900; cv=none; d=google.com; s=arc-20160816; b=fV68pf+8iCRiQFxkRAqaqUf8IFh/3hCUYd6Y0yxTaJN0utFCJnO//tJ480lTrKIGjn ky1Udp2s5JF0krkjc3/cyHkronc8wm/GFEAyB9wf7toL2fU+5UUIOyOO5oX3gDWoJWFL D5Nu4rTfh8supIw77sv5qSz0qedMziJkcQSqiA+SpY/KpUu7yLDHPEdR0nNsXMdPhmFj u645seyfBbBr0RhcaSpI1uSTNAyt25CV7dT9WV2JTq2F/hf9ABqWOvY5orvLMjkOUojH 2GFeXaDtcSt6XlKVoZKdqGzr6EcYhqM/zUfIQXB5+LmWEAJOg1x0rD9orUEr5QOFMo7M kRPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VqsEETFLoxnTdx1IXEtBHQTro2Cpm1RYnkgUKhPi0UA=; b=PBkcEMCkwR7Kq0grupTxkZFacrhRwtVhLtj18VmWqmwuY+AMgSbz+ZCAMZDNC/usYT N9ZbyrnHDzK5YQVx0/q824ONWdToKOeFUEsOi8aZzfkxzw52ngJ7yvB3Rl5cwQ8VLo+Q hBNWxaA/AHmpWZFVE1qwOFOKGxeimDGeZCpJ4wnlUQrAHdR9q2VV3jsxa7SCmx+J7BFE ADzLs+YBP19+JmEDn7uH6smJr/1AeCTrv3L3ZIiqwbELLZ7wFHcfwbxACDEktriyuaUD dhrIfXJVGObFhS7JQm4StYfsBIRT4cW1Bzq6kHFuVXzZtpu+pXkH6qfEMIAMBj2RHah4 /D3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pSaxWGuQ; 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 o25si152735otk.28.2020.02.10.04.48.08; Mon, 10 Feb 2020 04:48:20 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=pSaxWGuQ; 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 S1728360AbgBJMrH (ORCPT + 99 others); Mon, 10 Feb 2020 07:47:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:45456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728053AbgBJMl7 (ORCPT ); Mon, 10 Feb 2020 07:41:59 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 039ED2085B; Mon, 10 Feb 2020 12:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338519; bh=f4kmDu/JvwbQrWcKHUCplWeVGT/aIKbR1AJbtnX2X9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pSaxWGuQGvuGHGkccFuchpKP6LjfWWpk8bzM3917BfpLy678G2HiqEqq0JyyKDWOF veZtcVK1W2r9RHZuaoxvCkoBjcJZ28QA82Gu7veotByTBJO3Ae+gz/RIc0U13SQyTC 9shANLkXx4TaW5HUEc1So1GYbuTLvZhgkePHHBnc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harini Katakam , "David S. Miller" Subject: [PATCH 5.5 329/367] net: macb: Limit maximum GEM TX length in TSO Date: Mon, 10 Feb 2020 04:34:02 -0800 Message-Id: <20200210122453.260145919@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Harini Katakam [ Upstream commit f822e9c4ffa511a5c681cf866287d9383a3b6f1b ] GEM_MAX_TX_LEN currently resolves to 0x3FF8 for any IP version supporting TSO with full 14bits of length field in payload descriptor. But an IP errata causes false amba_error (bit 6 of ISR) when length in payload descriptors is specified above 16387. The error occurs because the DMA falsely concludes that there is not enough space in SRAM for incoming payload. These errors were observed continuously under stress of large packets using iperf on a version where SRAM was 16K for each queue. This errata will be documented shortly and affects all versions since TSO functionality was added. Hence limit the max length to 0x3FC0 (rounded). Signed-off-by: Harini Katakam Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/cadence/macb_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -73,7 +73,11 @@ struct sifive_fu540_macb_mgmt { /* Max length of transmit frame must be a multiple of 8 bytes */ #define MACB_TX_LEN_ALIGN 8 #define MACB_MAX_TX_LEN ((unsigned int)((1 << MACB_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1))) -#define GEM_MAX_TX_LEN ((unsigned int)((1 << GEM_TX_FRMLEN_SIZE) - 1) & ~((unsigned int)(MACB_TX_LEN_ALIGN - 1))) +/* Limit maximum TX length as per Cadence TSO errata. This is to avoid a + * false amba_error in TX path from the DMA assuming there is not enough + * space in the SRAM (16KB) even when there is. + */ +#define GEM_MAX_TX_LEN (unsigned int)(0x3FC0) #define GEM_MTU_MIN_SIZE ETH_MIN_MTU #define MACB_NETIF_LSO NETIF_F_TSO