diff options
| author | Michal Kubeček <mkubecek@suse.cz> | 2014-08-25 09:16:22 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-08-25 20:23:03 -0400 |
| commit | db115037bb57cdfe97078b13da762213f7980e81 (patch) | |
| tree | aec2854d8cc3ac16ac4422096136839c0489dfcb | |
| parent | f95f4045c734f801031782c8c6f8a5f381b0f69c (diff) | |
net: fix checksum features handling in netif_skb_features()
This is follow-up to
da08143b8520 ("vlan: more careful checksum features handling")
which introduced more careful feature intersection in vlan code,
taking into account that HW_CSUM should be considered superset
of IP_CSUM/IPV6_CSUM. The same is needed in netif_skb_features()
in order to avoid offloading mismatch warning when vlan is
created on top of a bond consisting of slaves supporting IP/IPv6
checksumming but not vlan Tx offloading.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | net/core/dev.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 66738e9d66e4..ab9a16530c36 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -2587,13 +2587,19 @@ netdev_features_t netif_skb_features(struct sk_buff *skb) | |||
| 2587 | return harmonize_features(skb, features); | 2587 | return harmonize_features(skb, features); |
| 2588 | } | 2588 | } |
| 2589 | 2589 | ||
| 2590 | features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX | | 2590 | features = netdev_intersect_features(features, |
| 2591 | NETIF_F_HW_VLAN_STAG_TX); | 2591 | skb->dev->vlan_features | |
| 2592 | NETIF_F_HW_VLAN_CTAG_TX | | ||
| 2593 | NETIF_F_HW_VLAN_STAG_TX); | ||
| 2592 | 2594 | ||
| 2593 | if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) | 2595 | if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) |
| 2594 | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | | 2596 | features = netdev_intersect_features(features, |
| 2595 | NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX | | 2597 | NETIF_F_SG | |
| 2596 | NETIF_F_HW_VLAN_STAG_TX; | 2598 | NETIF_F_HIGHDMA | |
| 2599 | NETIF_F_FRAGLIST | | ||
| 2600 | NETIF_F_GEN_CSUM | | ||
| 2601 | NETIF_F_HW_VLAN_CTAG_TX | | ||
| 2602 | NETIF_F_HW_VLAN_STAG_TX); | ||
| 2597 | 2603 | ||
| 2598 | return harmonize_features(skb, features); | 2604 | return harmonize_features(skb, features); |
| 2599 | } | 2605 | } |
