net: driver: use NETIF_F_GSO_SOFTWARE masks directly
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
2011/5/11 Shan Wei <[email protected]>:
Quoted 37 lines
For loopback device can support any offload, so directly using
NETIF_F_GSO_SOFTWAREoffload mask is enough safe.
And as Michał Mirosław suggested, addNETIF_F_HIGHDMAtohw_features.For
virtio_netdriver, safely usingNETIF_F_GSO_SOFTWAREoffload mask for bit operation.Signed-off-by Shan Wei <[email protected]>---
drivers/net/loopback.c | 16 +++++-----------
drivers/net/virtio_net.c | 3 ++-2 files changed, 7 insertions(+), 12 deletions(-)drivers/net/loopback.c +0
-0@@ -165,17 +165,11 @@ static void loopback_setup(struct net_device *dev)dev->type =
ARPHRD_LOOPBACK; /* 0x0001*/dev->flags=IFF_LOOPBACK;dev->priv_flags&= ~IFF_XMIT_DST_RELEASE;
-dev->hw_features=NETIF_F_ALL_TSO|NETIF_F_UFO;
-dev->features=NETIF_F_SG|NETIF_F_FRAGLIST- | NETIF_F_ALL_TSO - | NETIF_F_UFO - | NETIF_F_NO_CSUM - | NETIF_F_RXCSUM - | NETIF_F_HIGHDMA - | NETIF_F_LLTX - | NETIF_F_NETNS_LOCAL - | NETIF_F_VLAN_CHALLENGED - | NETIF_F_LOOPBACK; + dev->hw_features = NETIF_F_GSO_SOFTWARE | NETIF_F_HIGHDMA; + dev->features = dev->hw_features | NETIF_F_SG + | NETIF_F_FRAGLIST | NETIF_F_NO_CSUM | NETIF_F_RXCSUM + | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL + | NETIF_F_VLAN_CHALLENGED | NETIF_F_LOOPBACK;
Quoted 3 lines
dev->ethtool_ops =
&loopback_ethtool_ops;dev->header_ops=ð_header_ops;dev->netdev_ops=&loopback_ops;
[...]
Looks ok. For loopback, more features are actually changeable - only last 4 are really forced here.
Best Regards,
Michał Mirosław