diff options
author | David S. Miller <davem@davemloft.net> | 2015-01-27 19:59:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-27 19:59:56 -0500 |
commit | 95f873f2fff96c592c5d863e2a39825bd8bf0500 (patch) | |
tree | 0d2dd664964ba2c701aefea5b4d1e85b481045e1 /drivers/net/ethernet/emulex | |
parent | 8ea65f4a2dfaaf494ef42a16cbf2fea39b07450f (diff) | |
parent | 59343cd7c4809cf7598789e1cd14563780ae4239 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
arch/arm/boot/dts/imx6sx-sdb.dts
net/sched/cls_bpf.c
Two simple sets of overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 6c10fece1245..598c5070c629 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -4406,8 +4406,9 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
4406 | * distinguish various types of transports (VxLAN, GRE, NVGRE ..). So, offload | 4406 | * distinguish various types of transports (VxLAN, GRE, NVGRE ..). So, offload |
4407 | * is expected to work across all types of IP tunnels once exported. Skyhawk | 4407 | * is expected to work across all types of IP tunnels once exported. Skyhawk |
4408 | * supports offloads for either VxLAN or NVGRE, exclusively. So we export VxLAN | 4408 | * supports offloads for either VxLAN or NVGRE, exclusively. So we export VxLAN |
4409 | * offloads in hw_enc_features only when a VxLAN port is added. Note this only | 4409 | * offloads in hw_enc_features only when a VxLAN port is added. If other (non |
4410 | * ensures that other tunnels work fine while VxLAN offloads are not enabled. | 4410 | * VxLAN) tunnels are configured while VxLAN offloads are enabled, offloads for |
4411 | * those other tunnels are unexported on the fly through ndo_features_check(). | ||
4411 | * | 4412 | * |
4412 | * Skyhawk supports VxLAN offloads only for one UDP dport. So, if the stack | 4413 | * Skyhawk supports VxLAN offloads only for one UDP dport. So, if the stack |
4413 | * adds more than one port, disable offloads and don't re-enable them again | 4414 | * adds more than one port, disable offloads and don't re-enable them again |
@@ -4486,7 +4487,41 @@ static netdev_features_t be_features_check(struct sk_buff *skb, | |||
4486 | struct net_device *dev, | 4487 | struct net_device *dev, |
4487 | netdev_features_t features) | 4488 | netdev_features_t features) |
4488 | { | 4489 | { |
4489 | return vxlan_features_check(skb, features); | 4490 | struct be_adapter *adapter = netdev_priv(dev); |
4491 | u8 l4_hdr = 0; | ||
4492 | |||
4493 | /* The code below restricts offload features for some tunneled packets. | ||
4494 | * Offload features for normal (non tunnel) packets are unchanged. | ||
4495 | */ | ||
4496 | if (!skb->encapsulation || | ||
4497 | !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS)) | ||
4498 | return features; | ||
4499 | |||
4500 | /* It's an encapsulated packet and VxLAN offloads are enabled. We | ||
4501 | * should disable tunnel offload features if it's not a VxLAN packet, | ||
4502 | * as tunnel offloads have been enabled only for VxLAN. This is done to | ||
4503 | * allow other tunneled traffic like GRE work fine while VxLAN | ||
4504 | * offloads are configured in Skyhawk-R. | ||
4505 | */ | ||
4506 | switch (vlan_get_protocol(skb)) { | ||
4507 | case htons(ETH_P_IP): | ||
4508 | l4_hdr = ip_hdr(skb)->protocol; | ||
4509 | break; | ||
4510 | case htons(ETH_P_IPV6): | ||
4511 | l4_hdr = ipv6_hdr(skb)->nexthdr; | ||
4512 | break; | ||
4513 | default: | ||
4514 | return features; | ||
4515 | } | ||
4516 | |||
4517 | if (l4_hdr != IPPROTO_UDP || | ||
4518 | skb->inner_protocol_type != ENCAP_TYPE_ETHER || | ||
4519 | skb->inner_protocol != htons(ETH_P_TEB) || | ||
4520 | skb_inner_mac_header(skb) - skb_transport_header(skb) != | ||
4521 | sizeof(struct udphdr) + sizeof(struct vxlanhdr)) | ||
4522 | return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
4523 | |||
4524 | return features; | ||
4490 | } | 4525 | } |
4491 | #endif | 4526 | #endif |
4492 | 4527 | ||