From de15b104940fe4c656d948026c8c9bd57c6a3f96 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Fri, 6 Feb 2015 15:19:38 -0800 Subject: [PATCH] datapath: Remove compat vxlan_src_port(). vxlan_src_port() has been replaced with the more generic udp_flow_src_port() upstream. We already have a backport for this and it is used everywhere where this is needed, so we can remove the dead vxlan_src_port() function. Signed-off-by: Jesse Gross Acked-by: Thomas Graf --- datapath/linux/compat/include/net/vxlan.h | 3 --- datapath/linux/compat/vxlan.c | 18 ------------------ 2 files changed, 21 deletions(-) diff --git a/datapath/linux/compat/include/net/vxlan.h b/datapath/linux/compat/include/net/vxlan.h index d30de3127e7..7270eb15308 100644 --- a/datapath/linux/compat/include/net/vxlan.h +++ b/datapath/linux/compat/include/net/vxlan.h @@ -140,8 +140,5 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, __be16 src_port, __be16 dst_port, struct vxlan_metadata *md, bool xnet, u32 vxflags); -#define vxlan_src_port rpl_vxlan_src_port -__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); - #endif /* !HAVE_VXLAN_METADATA */ #endif diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c index 84a039cf5d8..73294e56543 100644 --- a/datapath/linux/compat/vxlan.c +++ b/datapath/linux/compat/vxlan.c @@ -161,24 +161,6 @@ static void vxlan_set_owner(struct sock *sk, struct sk_buff *skb) skb->destructor = vxlan_sock_put; } -/* Compute source port for outgoing packet - * first choice to use L4 flow hash since it will spread - * better and maybe available from hardware - * secondary choice is to use jhash on the Ethernet header - */ -__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb) -{ - unsigned int range = (port_max - port_min) + 1; - u32 hash; - - hash = skb_get_hash(skb); - if (!hash) - hash = jhash(skb->data, 2 * ETH_ALEN, - (__force u32) skb->protocol); - - return htons((((u64) hash * range) >> 32) + port_min); -} - static void vxlan_gso(struct sk_buff *skb) { int udp_offset = skb_transport_offset(skb);