Commit 346410bd authored by Jiri Benc's avatar Jiri Benc Committed by Stephen Hemminger

vxlan: add support for VXLAN-GPE

Adds support to create a VXLAN-GPE interface.
Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
parent 42d17a61
...@@ -31,7 +31,7 @@ static void print_explain(FILE *f) ...@@ -31,7 +31,7 @@ static void print_explain(FILE *f)
fprintf(f, " [ ageing SECONDS ] [ maxaddress NUMBER ]\n"); fprintf(f, " [ ageing SECONDS ] [ maxaddress NUMBER ]\n");
fprintf(f, " [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\n"); fprintf(f, " [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\n");
fprintf(f, " [ [no]remcsumtx ] [ [no]remcsumrx ]\n"); fprintf(f, " [ [no]remcsumtx ] [ [no]remcsumrx ]\n");
fprintf(f, " [ [no]external ] [ gbp ]\n"); fprintf(f, " [ [no]external ] [ gbp ] [ gpe ]\n");
fprintf(f, "\n"); fprintf(f, "\n");
fprintf(f, "Where: VNI := 0-16777215\n"); fprintf(f, "Where: VNI := 0-16777215\n");
fprintf(f, " ADDR := { IP_ADDRESS | any }\n"); fprintf(f, " ADDR := { IP_ADDRESS | any }\n");
...@@ -79,6 +79,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, ...@@ -79,6 +79,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 remcsumrx = 0; __u8 remcsumrx = 0;
__u8 metadata = 0; __u8 metadata = 0;
__u8 gbp = 0; __u8 gbp = 0;
__u8 gpe = 0;
int dst_port_set = 0; int dst_port_set = 0;
struct ifla_vxlan_port_range range = { 0, 0 }; struct ifla_vxlan_port_range range = { 0, 0 };
...@@ -239,6 +240,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, ...@@ -239,6 +240,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
metadata = 0; metadata = 0;
} else if (!matches(*argv, "gbp")) { } else if (!matches(*argv, "gbp")) {
gbp = 1; gbp = 1;
} else if (!matches(*argv, "gpe")) {
gpe = 1;
} else if (matches(*argv, "help") == 0) { } else if (matches(*argv, "help") == 0) {
explain(); explain();
return -1; return -1;
...@@ -267,7 +270,9 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, ...@@ -267,7 +270,9 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
return -1; return -1;
} }
if (!dst_port_set) { if (!dst_port_set && gpe) {
dstport = 4790;
} else if (!dst_port_set) {
fprintf(stderr, "vxlan: destination port not specified\n" fprintf(stderr, "vxlan: destination port not specified\n"
"Will use Linux kernel default (non-standard value)\n"); "Will use Linux kernel default (non-standard value)\n");
fprintf(stderr, fprintf(stderr,
...@@ -324,6 +329,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, ...@@ -324,6 +329,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
if (gbp) if (gbp)
addattr_l(n, 1024, IFLA_VXLAN_GBP, NULL, 0); addattr_l(n, 1024, IFLA_VXLAN_GBP, NULL, 0);
if (gpe)
addattr_l(n, 1024, IFLA_VXLAN_GPE, NULL, 0);
return 0; return 0;
...@@ -490,6 +497,8 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) ...@@ -490,6 +497,8 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
if (tb[IFLA_VXLAN_GBP]) if (tb[IFLA_VXLAN_GBP])
fputs("gbp ", f); fputs("gbp ", f);
if (tb[IFLA_VXLAN_GPE])
fputs("gpe ", f);
} }
static void vxlan_print_help(struct link_util *lu, int argc, char **argv, static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
......
...@@ -425,6 +425,8 @@ the following additional arguments are supported: ...@@ -425,6 +425,8 @@ the following additional arguments are supported:
.RI "[no]external " .RI "[no]external "
] [ ] [
.B gbp .B gbp
] [
.B gpe
] ]
.in +8 .in +8
...@@ -566,6 +568,13 @@ Example: ...@@ -566,6 +568,13 @@ Example:
.in -4 .in -4
.sp
.B gpe
- enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
only supported together with the
.B external
keyword.
.in -8 .in -8
.TP .TP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment