From e6cd988c27bb5918630db67b3526c9e78e786818 Mon Sep 17 00:00:00 2001 From: Joseph Gasparakis Date: Thu, 24 Oct 2013 06:27:10 +0000 Subject: [PATCH] vxlan: Have the NIC drivers do less work for offloads This patch removes the burden from the NIC drivers to check if the vxlan driver is enabled in the kernel and also makes available the vxlan headrooms to them. Signed-off-by: Joseph Gasparakis Tested-by: Kavindya Deegala Signed-off-by: Jeff Kirsher --- drivers/net/vxlan.c | 4 ---- include/net/vxlan.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 75a3a740ce19..24260ced86d2 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -60,10 +60,6 @@ #define VXLAN_N_VID (1u << 24) #define VXLAN_VID_MASK (VXLAN_N_VID - 1) -/* IP header + UDP + VXLAN + Ethernet header */ -#define VXLAN_HEADROOM (20 + 8 + 8 + 14) -/* IPv6 header + UDP + VXLAN + Ethernet header */ -#define VXLAN6_HEADROOM (40 + 8 + 8 + 14) #define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) #define VXLAN_FLAGS 0x08000000 /* struct vxlanhdr.vx_flags required value. */ diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 2d64d3cd4999..6b6d180fb91a 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -36,5 +36,16 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, __be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb); +/* IP header + UDP + VXLAN + Ethernet header */ +#define VXLAN_HEADROOM (20 + 8 + 8 + 14) +/* IPv6 header + UDP + VXLAN + Ethernet header */ +#define VXLAN6_HEADROOM (40 + 8 + 8 + 14) + +#if IS_ENABLED(CONFIG_VXLAN) void vxlan_get_rx_port(struct net_device *netdev); +#else +static inline void vxlan_get_rx_port(struct net_device *netdev) +{ +} +#endif #endif -- 2.39.5