Skip to content

Commit

Permalink
net: remove NETIF_F_ALL_TX_OFFLOADS
Browse files Browse the repository at this point in the history
There is no software fallback implemented for SCTP or FCoE checksumming,
and so it should not be passed on by software devices like bridge or bonding.

For VLAN devices, this is different. First, the driver for underlying device
should be prepared to get offloaded packets even when the feature is disabled
(especially if it advertises it in vlan_features). Second, devices under
VLANs do not get replaced without tearing down the VLAN first.

This fixes a mess I accidentally introduced while converting bonding to
ndo_fix_features.

NETIF_F_SOFT_FEATURES are removed from BOND_VLAN_FEATURES because they
are unused as of commit 712ae51.

Signed-off-by: Michał Mirosław <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
osctobe authored and davem330 committed Jul 14, 2011
1 parent b73c43f commit 62f2a3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,9 +1428,9 @@ static u32 bond_fix_features(struct net_device *dev, u32 features)
return features;
}

#define BOND_VLAN_FEATURES (NETIF_F_ALL_TX_OFFLOADS | \
NETIF_F_SOFT_FEATURES | \
NETIF_F_LRO)
#define BOND_VLAN_FEATURES (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | NETIF_F_LRO)

static void bond_compute_features(struct bonding *bond)
{
Expand Down
6 changes: 0 additions & 6 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,12 +1097,6 @@ struct net_device {
#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
NETIF_F_FSO)

#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
NETIF_F_HIGHDMA | \
NETIF_F_SCTP_CSUM | \
NETIF_F_ALL_FCOE)

/*
* If one device supports one of these features, then enable them
* for all in netdev_increment_features.
Expand Down
6 changes: 5 additions & 1 deletion net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,11 @@ static int vlan_dev_init(struct net_device *dev)
(1<<__LINK_STATE_DORMANT))) |
(1<<__LINK_STATE_PRESENT);

dev->hw_features = NETIF_F_ALL_TX_OFFLOADS;
dev->hw_features = NETIF_F_ALL_CSUM | NETIF_F_SG |
NETIF_F_FRAGLIST | NETIF_F_ALL_TSO |
NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM |
NETIF_F_ALL_FCOE;

dev->features |= real_dev->vlan_features | NETIF_F_LLTX;
dev->gso_max_size = real_dev->gso_max_size;

Expand Down

0 comments on commit 62f2a3a

Please sign in to comment.