From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CFD6C4332F for ; Tue, 24 May 2022 16:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239281AbiEXQB3 (ORCPT ); Tue, 24 May 2022 12:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239396AbiEXQA5 (ORCPT ); Tue, 24 May 2022 12:00:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DBD9E9F3; Tue, 24 May 2022 09:00:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03DCB61777; Tue, 24 May 2022 16:00:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22072C34113; Tue, 24 May 2022 16:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653408028; bh=rhSReVfYA015Yqcr13AeznBlSDShTNdEP+EIElwOAPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QqPCvtByBbT1wQoRFf98TwpOToERhNgFJcR/H+uqlMYygmc9w/8YMOcMgdpWYjdR2 v4Y6WsqUZUYc1GO0WPVWy8vjUxERYiIHP/Il44U156iDnYgpa7SNR1BgU9tN2QkLNW VJ3+/iZeemiHIgG03JbV1HYhawpQg7ur//ERy7qlsaDmsqjnDXnI8wrseKOK2Vxy/n j2b+zMNc8SKne2WY2TZW2/QNM/MDSPJh9c0FfgS7L2dTCH2NRFVJyaHzZf4eaDBNbW cFKsTcbi0Z9wyhubHJOzgkOALgMpQhYXSf+3Cdp+8MjGwOZ99HcErgqNArlPAnvB+o Bgtv5cSAn51Vg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Joel Stanley , David Wilder , Dylan Hung , "David S . Miller" , Sasha Levin , edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, guoheyi@linux.alibaba.com, chenhao288@hisilicon.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 08/10] net: ftgmac100: Disable hardware checksum on AST2600 Date: Tue, 24 May 2022 12:00:05 -0400 Message-Id: <20220524160009.826957-8-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524160009.826957-1-sashal@kernel.org> References: <20220524160009.826957-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joel Stanley [ Upstream commit 6fd45e79e8b93b8d22fb8fe22c32fbad7e9190bd ] The AST2600 when using the i210 NIC over NC-SI has been observed to produce incorrect checksum results with specific MTU values. This was first observed when sending data across a long distance set of networks. On a local network, the following test was performed using a 1MB file of random data. On the receiver run this script: #!/bin/bash while [ 1 ]; do # Zero the stats nstat -r > /dev/null nc -l 9899 > test-file # Check for checksum errors TcpInCsumErrors=$(nstat | grep TcpInCsumErrors) if [ -z "$TcpInCsumErrors" ]; then echo No TcpInCsumErrors else echo TcpInCsumErrors = $TcpInCsumErrors fi done On an AST2600 system: # nc 9899 < test-file The test was repeated with various MTU values: # ip link set mtu 1410 dev eth0 The observed results: 1500 - good 1434 - bad 1400 - good 1410 - bad 1420 - good The test was repeated after disabling tx checksumming: # ethtool -K eth0 tx-checksumming off And all MTU values tested resulted in transfers without error. An issue with the driver cannot be ruled out, however there has been no bug discovered so far. David has done the work to take the original bug report of slow data transfer between long distance connections and triaged it down to this test case. The vendor suspects this this is a hardware issue when using NC-SI. The fixes line refers to the patch that introduced AST2600 support. Reported-by: David Wilder Reviewed-by: Dylan Hung Signed-off-by: Joel Stanley Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/faraday/ftgmac100.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index e1df2dc810a2..0b833572205f 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1910,6 +1910,11 @@ static int ftgmac100_probe(struct platform_device *pdev) /* AST2400 doesn't have working HW checksum generation */ if (np && (of_device_is_compatible(np, "aspeed,ast2400-mac"))) netdev->hw_features &= ~NETIF_F_HW_CSUM; + + /* AST2600 tx checksum with NCSI is broken */ + if (priv->use_ncsi && of_device_is_compatible(np, "aspeed,ast2600-mac")) + netdev->hw_features &= ~NETIF_F_HW_CSUM; + if (np && of_get_property(np, "no-hw-checksum", NULL)) netdev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM); netdev->features |= netdev->hw_features; -- 2.35.1