Skip to content

Commit

Permalink
datapath: Remove compat vxlan_src_port().
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Thomas Graf <[email protected]>
  • Loading branch information
jessegross committed Feb 20, 2015
1 parent bedd685 commit de15b10
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
3 changes: 0 additions & 3 deletions datapath/linux/compat/include/net/vxlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 0 additions & 18 deletions datapath/linux/compat/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit de15b10

Please sign in to comment.