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 53CEFC433FE for ; Tue, 24 May 2022 16:03:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239507AbiEXQD2 (ORCPT ); Tue, 24 May 2022 12:03:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239413AbiEXQCW (ORCPT ); Tue, 24 May 2022 12:02:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A592A13FBB; Tue, 24 May 2022 09:01:13 -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 ams.source.kernel.org (Postfix) with ESMTPS id C4F29B81A4F; Tue, 24 May 2022 16:01:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EC17C34116; Tue, 24 May 2022 16:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653408070; bh=yq3kpL5uLmlVYSLy8oKazIs+8ak4Uz688yskPdhZX6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lucz7zYmQfE7E2CgWc9cAI2VGWhn9xIbesoDnfhnSb1Rw0BK+8/5SwsoNsuVkIIJS OGmYHOJrw7RDzBcFrwdaXYKkgI8pPsbRo8WJ2LddfCtm2amjA7vAVMzUFViF/3plS0 nQG5t0UeBtENULOoh4Ch309VzinqTEFjyvRScPP8myKhQtI23P0nIbsor5ZPpj9WiA TyfOO2YQGihhG7VwuBMxGfZPoWBVSf0jfXk7FwSd4L8irA3bWzmg/9N9eCBosZX0L0 pqOsBj4wdlqS2mJrBXieMCilTI9Ms2Mv/aryxKZ6B1VgjrA4+BZ9mqJsYDaJomTQFV S+IQT/+kTzKCA== 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, arnd@arndb.de, chenhao288@hisilicon.com, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 3/5] net: ftgmac100: Disable hardware checksum on AST2600 Date: Tue, 24 May 2022 12:00:59 -0400 Message-Id: <20220524160102.827227-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220524160102.827227-1-sashal@kernel.org> References: <20220524160102.827227-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: netdev@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 2c06cdcd3e75..d7478d332820 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -1880,6 +1880,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