From: Alexander Duyck <aduyck@mirantis.com>
To: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Cc: hannes@redhat.com, jesse@kernel.org, jbenc@redhat.com,
alexander.duyck@gmail.com, saeedm@mellanox.com,
ariel.elior@qlogic.com, tom@herbertland.com,
Dept-GELinuxNICDev@qlogic.com, davem@davemloft.net,
eugenia@mellanox.com
Subject: [net-next PATCH 15/15] vxlan: Add new UDP encapsulation offload type for VXLAN-GPE
Date: Mon, 13 Jun 2016 10:50:08 -0700 [thread overview]
Message-ID: <20160613175008.15186.76657.stgit@localhost.localdomain> (raw)
In-Reply-To: <20160613173750.15186.24381.stgit@localhost.localdomain>
The fact is VXLAN with Generic Protocol Extensions cannot be supported by
the same hardware parsers as that support VXLAN. The protocol extensions
allow for things like a Next Protocol field which in turn allows for things
other than Ethernet to be passed over the tunnel. Most existing parsers
will not know how to interpret this.
To resolve this I am giving VXLAN-GPE its own UDP encapsulation offload
type. This way hardware that does support GPE can simply add this type to
the switch statement for VXLAN, and if they don't support it then this will
fix any issues where headers might be interpreted incorrectly.
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
---
drivers/net/vxlan.c | 12 ++++++++++--
include/net/udp_tunnel.h | 1 +
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 72da056abdf4..501c9e4741ed 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -622,13 +622,19 @@ static int vxlan_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff)
/* Notify netdevs that UDP port started listening */
static void vxlan_notify_add_rx_port(struct vxlan_sock *vs)
{
- udp_tunnel_notify_add_rx_port(vs->sock, UDP_ENC_OFFLOAD_TYPE_VXLAN);
+ udp_tunnel_notify_add_rx_port(vs->sock,
+ (vs->flags & VXLAN_F_GPE) ?
+ UDP_ENC_OFFLOAD_TYPE_VXLAN_GPE :
+ UDP_ENC_OFFLOAD_TYPE_VXLAN);
}
/* Notify netdevs that UDP port is no more listening */
static void vxlan_notify_del_rx_port(struct vxlan_sock *vs)
{
- udp_tunnel_notify_del_rx_port(vs->sock, UDP_ENC_OFFLOAD_TYPE_VXLAN);
+ udp_tunnel_notify_del_rx_port(vs->sock,
+ (vs->flags & VXLAN_F_GPE) ?
+ UDP_ENC_OFFLOAD_TYPE_VXLAN_GPE :
+ UDP_ENC_OFFLOAD_TYPE_VXLAN);
}
/* Add new entry to forwarding table -- assumes lock held */
@@ -2516,6 +2522,8 @@ static void vxlan_push_rx_ports(struct net_device *dev)
for (i = 0; i < PORT_HASH_SIZE; ++i) {
hlist_for_each_entry_rcu(vs, &vn->sock_list[i], hlist)
udp_tunnel_push_rx_port(dev, vs->sock,
+ (vs->flags & VXLAN_F_GPE) ?
+ UDP_ENC_OFFLOAD_TYPE_VXLAN_GPE :
UDP_ENC_OFFLOAD_TYPE_VXLAN);
}
spin_unlock(&vn->sock_lock);
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
index 9ea813740231..cc85e9e53f3d 100644
--- a/include/net/udp_tunnel.h
+++ b/include/net/udp_tunnel.h
@@ -88,6 +88,7 @@ void setup_udp_tunnel_sock(struct net *net, struct socket *sock,
enum udp_enc_offloads {
UDP_ENC_OFFLOAD_TYPE_VXLAN, /* RFC 7348 */
UDP_ENC_OFFLOAD_TYPE_GENEVE, /* draft-ietf-nvo3-geneve */
+ UDP_ENC_OFFLOAD_TYPE_VXLAN_GPE, /* draft-ietf-nvo3-vxlan-gpe */
};
/* Notify network devices of offloadable types */
prev parent reply other threads:[~2016-06-13 17:50 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 17:47 [net-next PATCH 00/15] Future-proof tunnel offload handlers Alexander Duyck
2016-06-13 17:47 ` [net-next PATCH 01/15] net: Combine GENEVE and VXLAN port offload notifiers into single functions Alexander Duyck
2016-06-13 19:55 ` Tom Herbert
2016-06-13 20:24 ` Alexander Duyck
2016-06-13 20:36 ` Tom Herbert
2016-06-13 21:51 ` Alexander Duyck
2016-06-13 22:17 ` Tom Herbert
2016-06-13 23:12 ` Alexander Duyck
2016-06-14 0:28 ` Tom Herbert
2016-06-14 2:50 ` Alexander Duyck
2016-06-15 7:22 ` David Miller
2016-06-15 16:12 ` Tom Herbert
2016-06-13 17:48 ` [net-next PATCH 02/15] net: Merge VXLAN and GENEVE push notifiers into a single notifier Alexander Duyck
2016-06-13 17:57 ` Hannes Frederic Sowa
2016-06-13 19:31 ` Tom Herbert
2016-06-13 19:47 ` Alexander Duyck
2016-06-13 21:08 ` Hannes Frederic Sowa
2016-06-13 21:58 ` Alexander Duyck
2016-06-13 20:03 ` [Intel-wired-lan] " kbuild test robot
2016-06-13 17:48 ` [net-next PATCH 03/15] bnx2x: Move all UDP port notifiers to single function Alexander Duyck
2016-06-13 18:48 ` [Intel-wired-lan] " kbuild test robot
2016-06-13 17:48 ` [net-next PATCH 04/15] bnxt: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port Alexander Duyck
2016-06-13 18:41 ` Jesse Gross
2016-06-13 19:14 ` Hannes Frederic Sowa
2016-06-13 19:16 ` Alex Duyck
2016-06-13 19:16 ` Michael Chan
2016-06-13 19:31 ` [Intel-wired-lan] " kbuild test robot
2016-06-13 19:45 ` kbuild test robot
2016-06-13 17:48 ` [net-next PATCH 05/15] benet: " Alexander Duyck
2016-06-13 17:48 ` [net-next PATCH 06/15] fm10k: " Alexander Duyck
2016-06-13 17:48 ` [net-next PATCH 07/15] i40e: Move all UDP port notifiers to single function Alexander Duyck
2016-06-13 17:48 ` [net-next PATCH 08/15] ixgbe: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 09/15] mlx4_en: " Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 10/15] mlx5_en: " Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 11/15] nfp: " Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 12/15] qede: Move all UDP port notifiers to single function Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 13/15] qlcnic: Replace ndo_add/del_vxlan_port with ndo_add/del_udp_enc_port Alexander Duyck
2016-06-13 17:49 ` [net-next PATCH 14/15] net: Remove deprecated tunnel specific UDP offload functions Alexander Duyck
2016-06-13 17:50 ` Alexander Duyck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160613175008.15186.76657.stgit@localhost.localdomain \
--to=aduyck@mirantis.com \
--cc=Dept-GELinuxNICDev@qlogic.com \
--cc=alexander.duyck@gmail.com \
--cc=ariel.elior@qlogic.com \
--cc=davem@davemloft.net \
--cc=eugenia@mellanox.com \
--cc=hannes@redhat.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jbenc@redhat.com \
--cc=jesse@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=tom@herbertland.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).