lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240816224741.596989-1-rosenp@gmail.com>
Date: Fri, 16 Aug 2024 15:47:33 -0700
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	linux-kernel@...r.kernel.org,
	o.rempel@...gutronix.de,
	nbd@....name
Subject: [PATCH RFC net-next] net: ag71xx: disable GRO by default

```
Currently this is handled in userspace with ethtool. Not sure if this
should be done in the kernel or if this is even the proper place for it.
```

ag71xx is usually paired with qca8k or ar9331, both DSA drivers. DSA
internally uses GRO cells to speed up transactions. But this speed up
only works if hardware checksumming is supported. Unfortunately for
ag71xx, this is unsupported. On newer QCA devices, there is an external
HWNAT module that can be used to provide this, but the necessary code
has not been written. Mainly because at the time, the proper netfilter
code adding the proper APIs was not present.

Signed-off-by: Rosen Penev <rosenp@...il.com>
---
 drivers/net/ethernet/atheros/ag71xx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index b74856760be3..95da34c71b34 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1770,6 +1770,15 @@ static int ag71xx_change_mtu(struct net_device *ndev, int new_mtu)
 	return 0;
 }
 
+static netdev_features_t ag71xx_fix_features(struct net_device *ndev,
+					     netdev_features_t features)
+{
+	/* remove GRO. Hardware checksumming is needed to avoid a massive
+	 * reduction in switching speed */
+	features &= ~NETIF_F_SOFT_FEATURES;
+	return features;
+}
+
 static const struct net_device_ops ag71xx_netdev_ops = {
 	.ndo_open		= ag71xx_open,
 	.ndo_stop		= ag71xx_stop,
@@ -1777,6 +1786,7 @@ static const struct net_device_ops ag71xx_netdev_ops = {
 	.ndo_eth_ioctl		= phy_do_ioctl,
 	.ndo_tx_timeout		= ag71xx_tx_timeout,
 	.ndo_change_mtu		= ag71xx_change_mtu,
+	.ndo_fix_features	= ag71xx_fix_features,
 	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_validate_addr	= eth_validate_addr,
 };
-- 
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ