net: ag71xx: disable GRO by default
Subsystems (3)
RFC PATCH 1/1 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.
--- drivers/net/ethernet/atheros/ag71xx.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/atheros/ag71xx.c +10 -0
@@ -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, };
Signature · 1 line
2.46.0
Quoted 4 lines · Rosen Penev
``` 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. ```
Comments like this should be placed under the ---. If the patch is merged, anything in the commit message under the --- is then discarded.
Quoted 1 line
ag71xx is usually paired with qca8k or ar9331, both DSA drivers.
Can it be used without a switch? It looks like this option will disable offloads which are useful when there is no switch.
Andrew
Quoted 10 lines · Andrew Lunn
Quoted 4 lines · Rosen Penev
``` 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. ```Comments like this should be placed under the ---. If the patch is merged, anything in the commit message under the --- is then discarded.
Well, I don't mean for the patch to be merged. I'm mostly trying to get feedback on it. From what I see in the tree, it's not common to disable NETIF_F_SOFT_FEATURES.
Quoted 5 lines
Quoted 2 lines
ag71xx is usually paired with qca8k or ar9331, both DSA drivers.
Can it be used without a switch? It looks like this option will disable offloads which are useful when there is no switch.
Most of the time it is used with a switch. Even in cases where only one port is available it still goes through the switch (QCA9531 single port device using AR9331 DSA).
Some older devices might not go through the switch. I'm not sure.
Quoted 2 lines
Andrew