Commit e6a88e4b authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents f2899788 2836b4f2
...@@ -5078,9 +5078,11 @@ static netdev_features_t be_features_check(struct sk_buff *skb, ...@@ -5078,9 +5078,11 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
struct be_adapter *adapter = netdev_priv(dev); struct be_adapter *adapter = netdev_priv(dev);
u8 l4_hdr = 0; u8 l4_hdr = 0;
/* The code below restricts offload features for some tunneled packets. /* The code below restricts offload features for some tunneled and
* Q-in-Q packets.
* Offload features for normal (non tunnel) packets are unchanged. * Offload features for normal (non tunnel) packets are unchanged.
*/ */
features = vlan_features_check(skb, features);
if (!skb->encapsulation || if (!skb->encapsulation ||
!(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS)) !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS))
return features; return features;
......
...@@ -1989,6 +1989,7 @@ static const struct net_device_ops virtnet_netdev = { ...@@ -1989,6 +1989,7 @@ static const struct net_device_ops virtnet_netdev = {
.ndo_poll_controller = virtnet_netpoll, .ndo_poll_controller = virtnet_netpoll,
#endif #endif
.ndo_xdp = virtnet_xdp, .ndo_xdp = virtnet_xdp,
.ndo_features_check = passthru_features_check,
}; };
static void virtnet_config_changed_work(struct work_struct *work) static void virtnet_config_changed_work(struct work_struct *work)
......
...@@ -614,14 +614,16 @@ static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb) ...@@ -614,14 +614,16 @@ static inline bool skb_vlan_tagged_multi(const struct sk_buff *skb)
static inline netdev_features_t vlan_features_check(const struct sk_buff *skb, static inline netdev_features_t vlan_features_check(const struct sk_buff *skb,
netdev_features_t features) netdev_features_t features)
{ {
if (skb_vlan_tagged_multi(skb)) if (skb_vlan_tagged_multi(skb)) {
features = netdev_intersect_features(features, /* In the case of multi-tagged packets, use a direct mask
NETIF_F_SG | * instead of using netdev_interesect_features(), to make
NETIF_F_HIGHDMA | * sure that only devices supporting NETIF_F_HW_CSUM will
NETIF_F_FRAGLIST | * have checksum offloading support.
NETIF_F_HW_CSUM | */
NETIF_F_HW_VLAN_CTAG_TX | features &= NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_CSUM |
NETIF_F_HW_VLAN_STAG_TX); NETIF_F_FRAGLIST | NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_STAG_TX;
}
return features; return features;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment