vxlan: add VXLAN-GPE support
Subsystems (2)
cover vxlan: add VXLAN-GPE support
This patchset adds a couple of refinements to the 'external' keyword and adds support for configuring VXLAN-GPE interfaces.
The VXLAN-GPE support was recently merged to net-next.
The first patch is not intended to be applied directly but I still include it in order for this patchset to be compilable and testable by those interested.
Jiri Benc (4):
if_link.h: rebase to the kernel
vxlan: 'external' implies 'nolearning'
ip-link.8: document "external" flag for vxlan
vxlan: add support for VXLAN-GPE
include/linux/if_link.h | 1 + ip/iplink_vxlan.c | 14 ++++++++++++-- man/man8/ip-link.8.in | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/4 if_link.h: rebase to the kernel
Not intended to be applied directly. Instead, I assume Stephen will rebase all headers to net-next as usual.
--- include/linux/if_link.h | 1 + 1 file changed, 1 insertion(+)
include/linux/if_link.h +1 -0
@@ -484,6 +484,7 @@ enum {IFLA_VXLAN_REMCSUM_NOPARTIAL ,IFLA_VXLAN_COLLECT_METADATA ,IFLA_VXLAN_LABEL , +IFLA_VXLAN_GPE , __IFLA_VXLAN_MAX };#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
Signature · 1 line
1.8.3.1
PATCH 2/4 vxlan: 'external' implies 'nolearning'
In reply to Jiri BencIt doesn't make sense to use external control plane and fill internal FDB at the same time. It's even an illegal combination for VXLAN-GPE.
Just switch off learning when 'external' is specified.
--- ip/iplink_vxlan.c | 1 + 1 file changed, 1 insertion(+)
ip/iplink_vxlan.c +1 -0
@@ -234,6 +234,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv, remcsumrx =0 ; }else if (!matches (*argv,"external" )) { metadata =1 ; + learning =0 ; }else if (!matches (*argv,"noexternal" )) { metadata =0 ; }else if (!matches (*argv,"gbp" )) {
Signature · 1 line
1.8.3.1
PATCH 3/4 ip-link.8: document "external" flag for vxlan
In reply to Jiri Benc--- man/man8/ip-link.8.in | 8 ++++++++ 1 file changed, 8 insertions(+)
man/man8/ip-link.8.in +8 -0
@@ -422,6 +422,8 @@ the following additional arguments are supported: ] [ .BI maxaddress " NUMBER " ] [ +.RI "[no]external " +] [ .B gbp ]
@@ -516,6 +518,12 @@ are entered into the VXLAN device forwarding database. - specifies the maximum number of FDB entries. .sp +.I [no]external +- specifies whether an external control plane +.RB "(e.g. " "ip route encap" ) +or the internal FDB should be used. + +.sp .B gbp - enables the Group Policy extension (VXLAN-GBP).
Signature · 1 line
1.8.3.1
PATCH 4/4 vxlan: add support for VXLAN-GPE
In reply to Jiri BencAdds support to create a VXLAN-GPE interface.
--- ip/iplink_vxlan.c | 13 +++++++++++-- man/man8/ip-link.8.in | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
ip/iplink_vxlan.c +11 -2
@@ -31,7 +31,7 @@ static void print_explain(FILE *f)fprintf (f," [ ageing SECONDS ] [ maxaddress NUMBER ]\n" );fprintf (f," [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\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,"Where: VNI := 0-16777215\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,__u8 remcsumrx =0 ;__u8 metadata =0 ;__u8 gbp =0 ; +__u8 gpe =0 ;int dst_port_set =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, metadata =0 ; }else if (!matches (*argv,"gbp" )) { gbp =1 ; + }else if (!matches (*argv,"gpe" )) { + gpe =1 ; }else if (matches (*argv,"help" ) ==0 ) {explain ();return -1 ;
@@ -267,7 +270,9 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,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" "Will use Linux kernel default (non-standard value)\n" ); fprintf(stderr,
@@ -324,6 +329,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,if (gbp)addattr_l (n,1024 ,IFLA_VXLAN_GBP ,NULL ,0 ); +if (gpe) +addattr_l (n,1024 ,IFLA_VXLAN_GPE ,NULL ,0 );return 0 ;
@@ -490,6 +497,8 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])if (tb[IFLA_VXLAN_GBP ])fputs ("gbp " , f); +if (tb[IFLA_VXLAN_GPE ]) +fputs ("gpe " , f); } static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
man/man8/ip-link.8.in +9 -0
@@ -425,6 +425,8 @@ the following additional arguments are supported: .RI "[no]external " ] [ .B gbp +] [ +.B gpe ] .in +8
@@ -566,6 +568,13 @@ Example: .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 .TP
Signature · 1 line
1.8.3.1
Stephen Hemminger
AppliedQuoted 15 lines · On Thu, 7 Apr 2016 14:36:25 +0200 Jiri Benc <[email protected]> wrote:
This patchset adds a couple of refinements to the 'external' keyword and adds support for configuring VXLAN-GPE interfaces.
The VXLAN-GPE support was recently merged to net-next.
The first patch is not intended to be applied directly but I still include it in order for this patchset to be compilable and testable by those interested.
Jiri Benc (4):
if_link.h: rebase to the kernel
vxlan: 'external' implies 'nolearning'
ip-link.8: document "external" flag for vxlan
vxlan: add support for VXLAN-GPE
Quoted 5 lines
include/linux/if_link.h | 1 + ip/iplink_vxlan.c | 14 ++++++++++++-- man/man8/ip-link.8.in | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-)
Applied to net-next