diff mbox series

[net] net: ftgmac100: Disable hardware checksum on AST2600

Message ID 20220428082858.545176-1-joel@jms.id.au (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net] net: ftgmac100: Disable hardware checksum on AST2600 | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 2 blamed authors not CCed: andrew@aj.id.au andrew@lunn.ch; 4 maintainers not CCed: andrew@aj.id.au andrew@lunn.ch guoheyi@linux.alibaba.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Joel Stanley April 28, 2022, 8:28 a.m. UTC
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 <IP of  receiver host> 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.

Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
Reported-by: David Wilder <wilder@us.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
Net maintainers, if no one has a counter proposal I would like this
merged as a fix. Please give Dylan from Aspeed a chance to reply before
applying the patch.

 drivers/net/ethernet/faraday/ftgmac100.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andrew Lunn April 29, 2022, 1:02 a.m. UTC | #1
> Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
> Reported-by: David Wilder <wilder@us.ibm.com>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> Net maintainers, if no one has a counter proposal I would like this
> merged as a fix. Please give Dylan from Aspeed a chance to reply before
> applying the patch.

What has phy-handle got to do with this? You might want to add an
explanation why you picked that as a Fixes: commit, if it is in fact
correct.


     Andrew
Joel Stanley April 29, 2022, 1:35 a.m. UTC | #2
On Fri, 29 Apr 2022 at 01:02, Andrew Lunn <andrew@lunn.ch> wrote:
>
> > Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
> > Reported-by: David Wilder <wilder@us.ibm.com>
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > ---
> > Net maintainers, if no one has a counter proposal I would like this
> > merged as a fix. Please give Dylan from Aspeed a chance to reply before
> > applying the patch.
>
> What has phy-handle got to do with this? You might want to add an
> explanation why you picked that as a Fixes: commit, if it is in fact
> correct.

If you have a look at that commit, you can see that was where ast2600
support was added to the driver.
Andrew Lunn April 29, 2022, 1:40 a.m. UTC | #3
On Fri, Apr 29, 2022 at 01:35:43AM +0000, Joel Stanley wrote:
> On Fri, 29 Apr 2022 at 01:02, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
> > > Reported-by: David Wilder <wilder@us.ibm.com>
> > > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > > ---
> > > Net maintainers, if no one has a counter proposal I would like this
> > > merged as a fix. Please give Dylan from Aspeed a chance to reply before
> > > applying the patch.
> >
> > What has phy-handle got to do with this? You might want to add an
> > explanation why you picked that as a Fixes: commit, if it is in fact
> > correct.
> 
> If you have a look at that commit, you can see that was where ast2600
> support was added to the driver.

O.K, so please do add an explanation, because it is not obvious. I'm
partially to blame, i should of asked for that patch to be split in
two.

     Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index caf48023f8ea..5231818943c6 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1928,6 +1928,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;