From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, linux-kernel@vger.kernel.org,
o.rempel@pengutronix.de, nbd@nbd.name
Subject: [PATCH RFC net-next] net: ag71xx: disable GRO by default
Date: Fri, 16 Aug 2024 15:47:33 -0700 [thread overview]
Message-ID: <20240816224741.596989-1-rosenp@gmail.com> (raw)
```
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@gmail.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
next reply other threads:[~2024-08-16 22:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 22:47 Rosen Penev [this message]
2024-08-17 18:39 ` Andrew Lunn
2024-08-17 21:34 ` Rosen Penev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240816224741.596989-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®