netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2 master 0/2] setting flow label support
@ 2016-03-24 15:49 Daniel Borkmann
  2016-03-24 15:49 ` [PATCH iproute2 master 1/2] vxlan: add support to set flow label Daniel Borkmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-03-24 15:49 UTC (permalink / raw)
  To: stephen; +Cc: netdev, Daniel Borkmann

On top of Jesse's csum patches for vxlan, geneve:

  - http://patchwork.ozlabs.org/patch/599746/
  - http://patchwork.ozlabs.org/patch/599747/

Thanks!

Daniel Borkmann (2):
  vxlan: add support to set flow label
  geneve: add support to set flow label

 ip/ip_common.h        |  4 ++++
 ip/iplink_geneve.c    | 29 ++++++++++++++++++++++++-----
 ip/iplink_vxlan.c     | 29 ++++++++++++++++++++++++-----
 man/man8/ip-link.8.in | 12 ++++++++++++
 4 files changed, 64 insertions(+), 10 deletions(-)

-- 
1.9.3

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

* [PATCH iproute2 master 1/2] vxlan: add support to set flow label
  2016-03-24 15:49 [PATCH iproute2 master 0/2] setting flow label support Daniel Borkmann
@ 2016-03-24 15:49 ` Daniel Borkmann
  2016-03-24 15:49 ` [PATCH iproute2 master 2/2] geneve: " Daniel Borkmann
  2016-03-27 18:00 ` [PATCH iproute2 master 0/2] setting flow label support Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-03-24 15:49 UTC (permalink / raw)
  To: stephen; +Cc: netdev, Daniel Borkmann

Follow-up for kernel commit e7f70af111f0 ("vxlan: support setting
IPv6 flow label") to allow setting the label for the device config.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 ip/ip_common.h        |  4 ++++
 ip/iplink_vxlan.c     | 29 ++++++++++++++++++++++++-----
 man/man8/ip-link.8.in |  6 ++++++
 3 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/ip/ip_common.h b/ip/ip_common.h
index 815487a..b7361a8 100644
--- a/ip/ip_common.h
+++ b/ip/ip_common.h
@@ -92,3 +92,7 @@ void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len);
 #ifndef	INFINITY_LIFE_TIME
 #define     INFINITY_LIFE_TIME      0xFFFFFFFFU
 #endif
+
+#ifndef LABEL_MAX_MASK
+#define     LABEL_MAX_MASK          0xFFFFFU
+#endif
diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 77aabba..bfebe09 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -24,7 +24,7 @@
 static void print_explain(FILE *f)
 {
 	fprintf(f, "Usage: ... vxlan id VNI [ { group | remote } IP_ADDRESS ] [ local ADDR ]\n");
-	fprintf(f, "                 [ ttl TTL ] [ tos TOS ] [ dev PHYS_DEV ]\n");
+	fprintf(f, "                 [ ttl TTL ] [ tos TOS ] [ flowlabel LABEL ] [ dev PHYS_DEV ]\n");
 	fprintf(f, "                 [ dstport PORT ] [ srcport MIN MAX ]\n");
 	fprintf(f, "                 [ [no]learning ] [ [no]proxy ] [ [no]rsc ]\n");
 	fprintf(f, "                 [ [no]l2miss ] [ [no]l3miss ]\n");
@@ -33,10 +33,11 @@ static void print_explain(FILE *f)
 	fprintf(f, "                 [ [no]remcsumtx ] [ [no]remcsumrx ]\n");
 	fprintf(f, "                 [ [no]external ] [ gbp ]\n");
 	fprintf(f, "\n");
-	fprintf(f, "Where: VNI := 0-16777215\n");
-	fprintf(f, "       ADDR := { IP_ADDRESS | any }\n");
-	fprintf(f, "       TOS  := { NUMBER | inherit }\n");
-	fprintf(f, "       TTL  := { 1..255 | inherit }\n");
+	fprintf(f, "Where: VNI   := 0-16777215\n");
+	fprintf(f, "       ADDR  := { IP_ADDRESS | any }\n");
+	fprintf(f, "       TOS   := { NUMBER | inherit }\n");
+	fprintf(f, "       TTL   := { 1..255 | inherit }\n");
+	fprintf(f, "       LABEL := 0-1048575\n");
 }
 
 static void explain(void)
@@ -58,6 +59,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
 	unsigned int link = 0;
 	__u8 tos = 0;
 	__u8 ttl = 0;
+	__u32 label = 0;
 	__u8 learning = 1;
 	__u8 proxy = 0;
 	__u8 rsc = 0;
@@ -146,6 +148,15 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
 				tos = uval;
 			} else
 				tos = 1;
+		} else if (!matches(*argv, "label") ||
+			   !matches(*argv, "flowlabel")) {
+			__u32 uval;
+
+			NEXT_ARG();
+			if (get_u32(&uval, *argv, 0) ||
+			    (uval & ~LABEL_MAX_MASK))
+				invarg("invalid flowlabel", *argv);
+			label = htonl(uval);
 		} else if (!matches(*argv, "ageing")) {
 			NEXT_ARG();
 			if (strcmp(*argv, "none") == 0)
@@ -280,6 +291,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
 
 	if (link)
 		addattr32(n, 1024, IFLA_VXLAN_LINK, link);
+	addattr32(n, 1024, IFLA_VXLAN_LABEL, label);
 	addattr8(n, 1024, IFLA_VXLAN_TTL, ttl);
 	addattr8(n, 1024, IFLA_VXLAN_TOS, tos);
 	addattr8(n, 1024, IFLA_VXLAN_LEARNING, learning);
@@ -426,6 +438,13 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 			fprintf(f, "ttl %d ", ttl);
 	}
 
+	if (tb[IFLA_VXLAN_LABEL]) {
+		__u32 label = rta_getattr_u32(tb[IFLA_VXLAN_LABEL]);
+
+		if (label)
+			fprintf(f, "flowlabel %#x ", ntohl(label));
+	}
+
 	if (tb[IFLA_VXLAN_AGEING]) {
 		__u32 age = rta_getattr_u32(tb[IFLA_VXLAN_AGEING]);
 
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index 2cd93b0..f115c19 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -396,6 +396,8 @@ the following additional arguments are supported:
 ] [
 .BI tos " TOS "
 ] [
+.BI flowlabel " FLOWLABEL "
+] [
 .BI dstport " PORT "
 ] [
 .BI srcport " MIN MAX "
@@ -460,6 +462,10 @@ parameter.
 - specifies the TOS value to use in outgoing packets.
 
 .sp
+.BI flowlabel " FLOWLABEL"
+- specifies the flow label to use in outgoing packets.
+
+.sp
 .BI dstport " PORT"
 - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
 
-- 
1.9.3

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

* [PATCH iproute2 master 2/2] geneve: add support to set flow label
  2016-03-24 15:49 [PATCH iproute2 master 0/2] setting flow label support Daniel Borkmann
  2016-03-24 15:49 ` [PATCH iproute2 master 1/2] vxlan: add support to set flow label Daniel Borkmann
@ 2016-03-24 15:49 ` Daniel Borkmann
  2016-03-27 18:00 ` [PATCH iproute2 master 0/2] setting flow label support Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2016-03-24 15:49 UTC (permalink / raw)
  To: stephen; +Cc: netdev, Daniel Borkmann

Follow-up for kernel commit 8eb3b99554b8 ("geneve: support setting
IPv6 flow label") to allow setting the label for the device config.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
---
 ip/iplink_geneve.c    | 29 ++++++++++++++++++++++++-----
 man/man8/ip-link.8.in |  6 ++++++
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/ip/iplink_geneve.c b/ip/iplink_geneve.c
index 16e70fd..685a0eb 100644
--- a/ip/iplink_geneve.c
+++ b/ip/iplink_geneve.c
@@ -18,14 +18,15 @@
 static void print_explain(FILE *f)
 {
 	fprintf(f, "Usage: ... geneve id VNI remote ADDR\n");
-	fprintf(f, "                 [ ttl TTL ] [ tos TOS ]\n");
+	fprintf(f, "                 [ ttl TTL ] [ tos TOS ] [ flowlabel LABEL ]\n");
 	fprintf(f, "                 [ dstport PORT ] [ [no]external ]\n");
 	fprintf(f, "                 [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\n");
 	fprintf(f, "\n");
-	fprintf(f, "Where: VNI  := 0-16777215\n");
-	fprintf(f, "       ADDR := IP_ADDRESS\n");
-	fprintf(f, "       TOS  := { NUMBER | inherit }\n");
-	fprintf(f, "       TTL  := { 1..255 | inherit }\n");
+	fprintf(f, "Where: VNI   := 0-16777215\n");
+	fprintf(f, "       ADDR  := IP_ADDRESS\n");
+	fprintf(f, "       TOS   := { NUMBER | inherit }\n");
+	fprintf(f, "       TTL   := { 1..255 | inherit }\n");
+	fprintf(f, "       LABEL := 0-1048575\n");
 }
 
 static void explain(void)
@@ -40,6 +41,7 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
 	int vni_set = 0;
 	__u32 daddr = 0;
 	struct in6_addr daddr6 = IN6ADDR_ANY_INIT;
+	__u32 label = 0;
 	__u8 ttl = 0;
 	__u8 tos = 0;
 	__u16 dstport = 0;
@@ -90,6 +92,15 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
 				tos = uval;
 			} else
 				tos = 1;
+		} else if (!matches(*argv, "label") ||
+			   !matches(*argv, "flowlabel")) {
+			__u32 uval;
+
+			NEXT_ARG();
+			if (get_u32(&uval, *argv, 0) ||
+			    (uval & ~LABEL_MAX_MASK))
+				invarg("invalid flowlabel", *argv);
+			label = htonl(uval);
 		} else if (!matches(*argv, "dstport")) {
 			NEXT_ARG();
 			if (get_u16(&dstport, *argv, 0))
@@ -150,6 +161,7 @@ static int geneve_parse_opt(struct link_util *lu, int argc, char **argv,
 		addattr_l(n, 1024, IFLA_GENEVE_REMOTE, &daddr, 4);
 	if (memcmp(&daddr6, &in6addr_any, sizeof(daddr6)) != 0)
 		addattr_l(n, 1024, IFLA_GENEVE_REMOTE6, &daddr6, sizeof(struct in6_addr));
+	addattr32(n, 1024, IFLA_GENEVE_LABEL, label);
 	addattr8(n, 1024, IFLA_GENEVE_TTL, ttl);
 	addattr8(n, 1024, IFLA_GENEVE_TOS, tos);
 	if (dstport)
@@ -214,6 +226,13 @@ static void geneve_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 			fprintf(f, "tos %#x ", tos);
 	}
 
+	if (tb[IFLA_GENEVE_LABEL]) {
+		__u32 label = rta_getattr_u32(tb[IFLA_GENEVE_LABEL]);
+
+		if (label)
+			fprintf(f, "flowlabel %#x ", ntohl(label));
+	}
+
 	if (tb[IFLA_GENEVE_PORT])
 		fprintf(f, "dstport %u ",
 			ntohs(rta_getattr_u16(tb[IFLA_GENEVE_PORT])));
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index f115c19..8055114 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -752,6 +752,8 @@ the following additional arguments are supported:
 .BI ttl " TTL "
 ] [
 .BI tos " TOS "
+] [
+.BI flowlabel " FLOWLABEL "
 ]
 
 .in +8
@@ -771,6 +773,10 @@ the following additional arguments are supported:
 .BI tos " TOS"
 - specifies the TOS value to use in outgoing packets.
 
+.sp
+.BI flowlabel " FLOWLABEL"
+- specifies the flow label to use in outgoing packets.
+
 .in -8
 
 .TP
-- 
1.9.3

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

* Re: [PATCH iproute2 master 0/2] setting flow label support
  2016-03-24 15:49 [PATCH iproute2 master 0/2] setting flow label support Daniel Borkmann
  2016-03-24 15:49 ` [PATCH iproute2 master 1/2] vxlan: add support to set flow label Daniel Borkmann
  2016-03-24 15:49 ` [PATCH iproute2 master 2/2] geneve: " Daniel Borkmann
@ 2016-03-27 18:00 ` Stephen Hemminger
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2016-03-27 18:00 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: netdev

On Thu, 24 Mar 2016 16:49:54 +0100
Daniel Borkmann <daniel@iogearbox.net> wrote:

> On top of Jesse's csum patches for vxlan, geneve:
> 
>   - http://patchwork.ozlabs.org/patch/599746/
>   - http://patchwork.ozlabs.org/patch/599747/
> 
> Thanks!
> 
> Daniel Borkmann (2):
>   vxlan: add support to set flow label
>   geneve: add support to set flow label
> 
>  ip/ip_common.h        |  4 ++++
>  ip/iplink_geneve.c    | 29 ++++++++++++++++++++++++-----
>  ip/iplink_vxlan.c     | 29 ++++++++++++++++++++++++-----
>  man/man8/ip-link.8.in | 12 ++++++++++++
>  4 files changed, 64 insertions(+), 10 deletions(-)
> 

Applied thanks

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

end of thread, other threads:[~2016-03-27 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 15:49 [PATCH iproute2 master 0/2] setting flow label support Daniel Borkmann
2016-03-24 15:49 ` [PATCH iproute2 master 1/2] vxlan: add support to set flow label Daniel Borkmann
2016-03-24 15:49 ` [PATCH iproute2 master 2/2] geneve: " Daniel Borkmann
2016-03-27 18:00 ` [PATCH iproute2 master 0/2] setting flow label support Stephen Hemminger

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