Skip to contentSkip to conversation

Patch "benet: stricter vxlan offloading check in be_features_check" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Aug 4, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

benet: stricter vxlan offloading check in be_features_check

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
benet-stricter-vxlan-offloading-check-in-be_features_check.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 4 15:15:01 PDT 2017

From: Sabrina Dubroca <[email protected]>
Date: Tue, 3 Jan 2017 16:26:04 +0100
Subject: benet: stricter vxlan offloading check in be_features_check

From: Sabrina Dubroca <[email protected]>

[ Upstream commit 096de2f83ebc8e0404c5b7e847a4abd27b9739da ]

When VXLAN offloading is enabled, be_features_check() tries to check if an encapsulated packet is indeed a VXLAN packet. The check is not strict enough, and considers any UDP-encapsulated ethernet frame with a 8-byte tunnel header as being VXLAN. Unfortunately, both GENEVE and VXLAN-GPE have a 8-byte header, so they get through this check.

Force the UDP destination port to be the one that has been offloaded to hardware.

Without this, GENEVE-encapsulated packets can end up having an incorrect checksum when both a GENEVE and a VXLAN (offloaded) tunnel are configured.

This is similar to commit a547224dceed ("mlx4e: Do not attempt to offload VXLAN ports that are unrecognized").

---
 drivers/net/ethernet/emulex/benet/be_main.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +3 -1
@@ -5186,7 +5186,9 @@ static netdev_features_t be_features_che
 	    skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
 	    skb->inner_protocol != htons(ETH_P_TEB) ||
 	    skb_inner_mac_header(skb) - skb_transport_header(skb) !=
-	    sizeof(struct udphdr) + sizeof(struct vxlanhdr))
+		sizeof(struct udphdr) + sizeof(struct vxlanhdr) ||
+	    !adapter->vxlan_port ||
+	    udp_hdr(skb)->dest != adapter->vxlan_port)
 		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
 
 	return features;

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/benet-stricter-vxlan-offloading-check-in-be_features_check.patch