aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-05-24 16:27:22 -0400
committerDavid S. Miller <davem@davemloft.net>2017-05-24 16:27:22 -0400
commite6a88e4ba88f3dd9d772f0ff7a88837939264883 (patch)
tree2b342f50dd0d585ce34c08e68cd6d1fcd4ddae40
parentf2899788353c13891412b273fdff5f02d49aa40f (diff)
parent2836b4f224d4fd7d1a2b23c3eecaf0f0ae199a74 (diff)
Merge branch 'q-in-q-checksums'
Daniel Borkmann says: ==================== BPF pruning follow-up Follow-up to fix incorrect pruning when alignment tracking is in use and to properly clear regs after call to not leave stale data behind. For details, please see individual patches. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c4
-rw-r--r--drivers/net/virtio_net.c1
-rw-r--r--include/linux/if_vlan.h18
3 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f3a09ab55900..4eee18ce9be4 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -5078,9 +5078,11 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
5078 struct be_adapter *adapter = netdev_priv(dev); 5078 struct be_adapter *adapter = netdev_priv(dev);
5079 u8 l4_hdr = 0; 5079 u8 l4_hdr = 0;
5080 5080
5081 /* The code below restricts offload features for some tunneled packets. 5081 /* The code below restricts offload features for some tunneled and
5082 * Q-in-Q packets.
5082 * Offload features for normal (non tunnel) packets are unchanged. 5083 * Offload features for normal (non tunnel) packets are unchanged.
5083 */ 5084 */
5085 features = vlan_features_check(skb, features);
5084 if (!skb->encapsulation || 5086 if (!skb->encapsulation ||
5085 !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS)) 5087 !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS))
5086 return features; 5088 return features;
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9320d96a1632..3e9246cc49c3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1989,6 +1989,7 @@ static const struct net_device_ops virtnet_netdev = {
1989 .ndo_poll_controller = virtnet_netpoll, 1989 .ndo_poll_controller = virtnet_netpoll,
1990#endif 1990#endif
1991 .ndo_xdp = virtnet_xdp, 1991 .ndo_xdp = virtnet_xdp,
1992 .ndo_features_check = passthru_features_check,
1992}; 1993};
1993 1994
1994static void virtnet_config_changed_work(struct work_struct *work) 1995static void virtnet_config_changed_work(struct work_struct *work)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 8d5fcd6284ce..283dc2f5364d 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -614,14 +614,16 @@ static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb)
614static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, 614static inline netdev_features_t vlan_features_check(const struct sk_buff *skb,
615 netdev_features_t features) 615 netdev_features_t features)
616{ 616{
617 if (skb_vlan_tagged_multi(skb)) 617 if (skb_vlan_tagged_multi(skb)) {
618 features = netdev_intersect_features(features, 618 /* In the case of multi-tagged packets, use a direct mask
619 NETIF_F_SG | 619 * instead of using netdev_interesect_features(), to make
620 NETIF_F_HIGHDMA | 620 * sure that only devices supporting NETIF_F_HW_CSUM will
621 NETIF_F_FRAGLIST | 621 * have checksum offloading support.
622 NETIF_F_HW_CSUM | 622 */
623 NETIF_F_HW_VLAN_CTAG_TX | 623 features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
624 NETIF_F_HW_VLAN_STAG_TX); 624 NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
625 NETIF_F_HW_VLAN_STAG_TX;
626 }
625 627
626 return features; 628 return features;
627} 629}