netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tunnels: Don't require remote endpoint or ID during creation.
@ 2015-10-16 23:36 Jesse Gross
  2015-10-17  7:45 ` Thomas Graf
  2015-10-19  5:44 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jesse Gross @ 2015-10-16 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, John Linville

Before lightweight tunnels existed, it really didn't make sense to
create a tunnel that was not fully specified, such as without a
destination IP address - the resulting packets would go nowhere.
However, with lightweight tunnels, the opposite is true - it doesn't
make sense to require this information when it will be provided later
on by the route. This loosens the requirements for this information.

An alternative would be to allow the relaxed version only when
COLLECT_METADATA is enabled. However, since there are several
variations on this theme (such as NBMA tunnels in GRE), just dropping
the restrictions seems the most consistent across tunnels and with
the existing configuration.

CC: John Linville <linville@tuxdriver.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 drivers/net/geneve.c | 12 ++++++------
 drivers/net/vxlan.c  |  7 +++----
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 8f5c02e..cde29f8 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -870,14 +870,14 @@ static int geneve_newlink(struct net *net, struct net_device *dev,
 	__be16 dst_port = htons(GENEVE_UDP_PORT);
 	__u8 ttl = 0, tos = 0;
 	bool metadata = false;
-	__be32 rem_addr;
-	__u32 vni;
+	__be32 rem_addr = 0;
+	__u32 vni = 0;
 
-	if (!data[IFLA_GENEVE_ID] || !data[IFLA_GENEVE_REMOTE])
-		return -EINVAL;
+	if (data[IFLA_GENEVE_ID])
+		vni = nla_get_u32(data[IFLA_GENEVE_ID]);
 
-	vni = nla_get_u32(data[IFLA_GENEVE_ID]);
-	rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);
+	if (data[IFLA_GENEVE_REMOTE])
+		rem_addr = nla_get_in_addr(data[IFLA_GENEVE_REMOTE]);
 
 	if (data[IFLA_GENEVE_TTL])
 		ttl = nla_get_u8(data[IFLA_GENEVE_TTL]);
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index bbac1d3..afdc65f 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2745,11 +2745,10 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev,
 	struct vxlan_config conf;
 	int err;
 
-	if (!data[IFLA_VXLAN_ID])
-		return -EINVAL;
-
 	memset(&conf, 0, sizeof(conf));
-	conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);
+
+	if (data[IFLA_VXLAN_ID])
+		conf.vni = nla_get_u32(data[IFLA_VXLAN_ID]);
 
 	if (data[IFLA_VXLAN_GROUP]) {
 		conf.remote_ip.sin.sin_addr.s_addr = nla_get_in_addr(data[IFLA_VXLAN_GROUP]);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] tunnels: Don't require remote endpoint or ID during creation.
  2015-10-16 23:36 [PATCH net] tunnels: Don't require remote endpoint or ID during creation Jesse Gross
@ 2015-10-17  7:45 ` Thomas Graf
  2015-10-19  5:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Graf @ 2015-10-17  7:45 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, netdev, John Linville

On 10/16/15 at 04:36pm, Jesse Gross wrote:
> Before lightweight tunnels existed, it really didn't make sense to
> create a tunnel that was not fully specified, such as without a
> destination IP address - the resulting packets would go nowhere.
> However, with lightweight tunnels, the opposite is true - it doesn't
> make sense to require this information when it will be provided later
> on by the route. This loosens the requirements for this information.
> 
> An alternative would be to allow the relaxed version only when
> COLLECT_METADATA is enabled. However, since there are several
> variations on this theme (such as NBMA tunnels in GRE), just dropping
> the restrictions seems the most consistent across tunnels and with
> the existing configuration.
> 
> CC: John Linville <linville@tuxdriver.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

I left it like it was for VXLAN with the thought that you had
specifically enable the metadata driven TX but I'm perfectly
fine with this as well.

Signed-off-by: Thomas Graf <tgraf@suug.ch>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] tunnels: Don't require remote endpoint or ID during creation.
  2015-10-16 23:36 [PATCH net] tunnels: Don't require remote endpoint or ID during creation Jesse Gross
  2015-10-17  7:45 ` Thomas Graf
@ 2015-10-19  5:44 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-10-19  5:44 UTC (permalink / raw)
  To: jesse; +Cc: netdev, linville

From: Jesse Gross <jesse@nicira.com>
Date: Fri, 16 Oct 2015 16:36:00 -0700

> Before lightweight tunnels existed, it really didn't make sense to
> create a tunnel that was not fully specified, such as without a
> destination IP address - the resulting packets would go nowhere.
> However, with lightweight tunnels, the opposite is true - it doesn't
> make sense to require this information when it will be provided later
> on by the route. This loosens the requirements for this information.
> 
> An alternative would be to allow the relaxed version only when
> COLLECT_METADATA is enabled. However, since there are several
> variations on this theme (such as NBMA tunnels in GRE), just dropping
> the restrictions seems the most consistent across tunnels and with
> the existing configuration.
> 
> CC: John Linville <linville@tuxdriver.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Applied, thanks Jesse.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-19  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 23:36 [PATCH net] tunnels: Don't require remote endpoint or ID during creation Jesse Gross
2015-10-17  7:45 ` Thomas Graf
2015-10-19  5:44 ` David Miller

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).