Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On 6/21/2019 10:25 AM, William Tu wrote: On Fri, Jun 21, 2019 at 10:00 AM Gregory Rose wrote: On 6/20/2019 8:55 AM, William Tu wrote: The patch adds ip6gretap support. Tunnel type ip6gretap is a layer 2 GRE tunnel over IPv6, carrying inner ethernet packets and encap with GRE header with outer IPv6 header. I tested it by running: # make check-kernel under kernel 5.2 and for userspace: # make check TESTSUITEFLAGS='-k ip6gretap' Signed-off-by: William Tu --- v1-v2: rebase to master Thanks William, looks good for testing and documentation. Tested-by: Greg Rose Reviewed-by: Greg Rose Thanks Greg, I will send out v3 adding more Documentation suggested by Eli and carry over these two tags. Sounds good, I forgot about vswitchd.xml. Thanks! William ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On Fri, Jun 21, 2019 at 10:00 AM Gregory Rose wrote: > > > On 6/20/2019 8:55 AM, William Tu wrote: > > The patch adds ip6gretap support. Tunnel type ip6gretap is a layer 2 GRE > > tunnel over IPv6, carrying inner ethernet packets and encap with GRE header > > with outer IPv6 header. I tested it by running: > ># make check-kernel > > under kernel 5.2 and for userspace: > ># make check TESTSUITEFLAGS='-k ip6gretap' > > > > Signed-off-by: William Tu > > --- > > v1-v2: rebase to master > > Thanks William, looks good for testing and documentation. > > Tested-by: Greg Rose > Reviewed-by: Greg Rose Thanks Greg, I will send out v3 adding more Documentation suggested by Eli and carry over these two tags. William ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On Thu, Jun 20, 2019 at 12:23 PM Eli Britstein wrote: > > > On 6/20/2019 9:19 PM, William Tu wrote: > >> I'll be working on clarifying the documentation. And we need to clarify > >> that we will not be supporting ip6gre because it > >> requires ARPHRD_IP6GRE. OVS only works with ARPHRD_ETHER so it can only > >> support ip6gretap. > >> > >>> Alternatively, we can maybe detect the options:remote_ip to be an > >>> IPv4/IPv6 address in type=gre and do the proper adjustments behind the > >>> scenes. > >>> > >>> What do you think? > > But when users set type=gre, and underneath we might created gre or > > ip6gretap. > > I think it better makes it clear using ip6gretap or gre. > > In gre we use "gre" for both "gre" or "gretap", so we should maybe use > "ip6gre" and not "ip6gretap", though "ip6gre" is not supported but only > "ip6gretap". BTW, can't OVS be updated to support it as well in the future? Yes, we can do that. First we need to upstream to netdev to add ARPHRD_IP6GRE support in ovs_netdev_link() at net/openvswitch/vport-netdev.c. Then we backport to OVS compat kernel module. For this patch, let's fix the ip6gretap first. > > In any case, I think documentation should be updated in the same commit. > Agree, I will update the vswitchd/vswitch.xml in next version Thanks! William ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On 6/20/2019 8:55 AM, William Tu wrote: The patch adds ip6gretap support. Tunnel type ip6gretap is a layer 2 GRE tunnel over IPv6, carrying inner ethernet packets and encap with GRE header with outer IPv6 header. I tested it by running: # make check-kernel under kernel 5.2 and for userspace: # make check TESTSUITEFLAGS='-k ip6gretap' Signed-off-by: William Tu --- v1-v2: rebase to master Thanks William, looks good for testing and documentation. Tested-by: Greg Rose Reviewed-by: Greg Rose --- Documentation/faq/configuration.rst | 12 +++ NEWS| 1 + datapath/linux/compat/ip6_gre.c | 2 +- lib/dpif-netlink-rtnl.c | 2 +- lib/dpif-netlink.c | 4 ++- lib/netdev-vport.c | 4 +-- lib/tnl-ports.c | 3 +- tests/system-traffic.at | 40 ++ tests/tunnel-push-pop-ipv6.at | 68 + 9 files changed, 130 insertions(+), 6 deletions(-) diff --git a/Documentation/faq/configuration.rst b/Documentation/faq/configuration.rst index cb2c6b4eca98..c9bcfa8a790d 100644 --- a/Documentation/faq/configuration.rst +++ b/Documentation/faq/configuration.rst @@ -212,6 +212,18 @@ Q: Does Open vSwitch support ERSPAN? options:erspan_ver=2 options:erspan_dir=1 \ options:erspan_hwid=4 +Q: Does Open vSwitch support IPv6 GRE? + +A: Yes. L2 tunnel interface GRE over IPv6 is supported. +L3 GRE tunnel over IPv6 is not supported. + +:: + +$ ovs-vsctl add-br br0 +$ ovs-vsctl add-port br0 at_gretap0 -- \ +set int at_gretap0 type=ip6gretap \ +options:remote_ip=fc00:100::1 + Q: How do I connect two bridges? A: First, why do you want to do this? Two connected bridges are not much diff --git a/NEWS b/NEWS index a38ab258fc6c..c7e84ed7931d 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,7 @@ Post-v2.11.0 - Linux datapath: * Support for the kernel versions 4.19.x and 4.20.x. * Support for the kernel version 5.0.x. + - Add L2 GRE tunnel over IPv6 support. v2.11.0 - 19 Feb 2019 diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c index ca4e66133570..ab50c72d0753 100644 --- a/datapath/linux/compat/ip6_gre.c +++ b/datapath/linux/compat/ip6_gre.c @@ -2550,7 +2550,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = { }; static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { - .kind = "ip6gre", + .kind = "ip6gretap", .maxtype= RPL_IFLA_GRE_MAX, .policy = ip6gre_policy, .priv_size = sizeof(struct ip6_tnl), diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index 2e23a8c14fcf..d666f239aeed 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -104,7 +104,7 @@ vport_type_to_kind(enum ovs_vport_type type, case OVS_VPORT_TYPE_IP6ERSPAN: return "ip6erspan"; case OVS_VPORT_TYPE_IP6GRE: -return "ip6gre"; +return "ip6gretap"; case OVS_VPORT_TYPE_NETDEV: case OVS_VPORT_TYPE_INTERNAL: case OVS_VPORT_TYPE_LISP: diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index ba80a0079181..fc1d1591975e 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -699,7 +699,7 @@ get_vport_type(const struct dpif_netlink_vport *vport) return "ip6erspan"; case OVS_VPORT_TYPE_IP6GRE: -return "ip6gre"; +return "ip6gretap"; case OVS_VPORT_TYPE_UNSPEC: case __OVS_VPORT_TYPE_MAX: @@ -730,6 +730,8 @@ netdev_to_ovs_vport_type(const char *type) return OVS_VPORT_TYPE_ERSPAN; } else if (!strcmp(type, "ip6erspan")) { return OVS_VPORT_TYPE_IP6ERSPAN; +} else if (!strcmp(type, "ip6gretap")) { +return OVS_VPORT_TYPE_IP6GRE; } else if (!strcmp(type, "ip6gre")) { return OVS_VPORT_TYPE_IP6GRE; } else if (!strcmp(type, "gre")) { diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 92a256af16ed..5a20415529eb 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -1212,10 +1212,10 @@ netdev_vport_tunnel_register(void) }, {{NULL, NULL, 0, 0}} }, -{ "ip6gre_sys", +{ "ip6gretap_sys", { TUNNEL_FUNCTIONS_COMMON, - .type = "ip6gre", + .type = "ip6gretap", .build_header = netdev_gre_build_header, .push_header = netdev_gre_push_header, .pop_header = netdev_gre_pop_header diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c index 17353046cc6e..62065c0027cd 100644 --- a/lib/tnl-ports.c +++ b/lib/tnl-ports.c @@ -172,7 +172,8 @@ tnl_type_to_nw_proto(const char type[]) return IPPROTO_TCP; } if (!strcmp(type, "gre") || !strcmp(type, "erspan") || -!strcmp(type,
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On 6/20/2019 9:19 PM, William Tu wrote: >> I'll be working on clarifying the documentation. And we need to clarify >> that we will not be supporting ip6gre because it >> requires ARPHRD_IP6GRE. OVS only works with ARPHRD_ETHER so it can only >> support ip6gretap. >> >>> Alternatively, we can maybe detect the options:remote_ip to be an >>> IPv4/IPv6 address in type=gre and do the proper adjustments behind the >>> scenes. >>> >>> What do you think? > But when users set type=gre, and underneath we might created gre or ip6gretap. > I think it better makes it clear using ip6gretap or gre. In gre we use "gre" for both "gre" or "gretap", so we should maybe use "ip6gre" and not "ip6gretap", though "ip6gre" is not supported but only "ip6gretap". BTW, can't OVS be updated to support it as well in the future? In any case, I think documentation should be updated in the same commit. >> >> >> Would take user space changes. I'd be fine with it - I think it would >> work more like geneve and vxlan that way. >> > For geneve and vxlan (see drivers/net/geneve.c), it uses only one type > rtnl_link_ops.kind ="geneve" for handling both ipv6 and ipv4. > > But for gre/erspan, there are separate rtnl_link_ops.kind in > net/ipv4/ip_gre.c and net/ipv6/ip6_gre.c > So I think we have to do separate type=ip6gre or type=gre. > > Regards, > William > > >> - Greg ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
> I'll be working on clarifying the documentation. And we need to clarify > that we will not be supporting ip6gre because it > requires ARPHRD_IP6GRE. OVS only works with ARPHRD_ETHER so it can only > support ip6gretap. > > > > > Alternatively, we can maybe detect the options:remote_ip to be an > > IPv4/IPv6 address in type=gre and do the proper adjustments behind the > > scenes. > > > > What do you think? But when users set type=gre, and underneath we might created gre or ip6gretap. I think it better makes it clear using ip6gretap or gre. > > > > Would take user space changes. I'd be fine with it - I think it would > work more like geneve and vxlan that way. > For geneve and vxlan (see drivers/net/geneve.c), it uses only one type rtnl_link_ops.kind ="geneve" for handling both ipv6 and ipv4. But for gre/erspan, there are separate rtnl_link_ops.kind in net/ipv4/ip_gre.c and net/ipv6/ip6_gre.c So I think we have to do separate type=ip6gre or type=gre. Regards, William > - Greg ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On 6/20/2019 10:00 AM, Eli Britstein wrote: On 6/20/2019 6:55 PM, William Tu wrote: The patch adds ip6gretap support. Tunnel type ip6gretap is a layer 2 GRE tunnel over IPv6, carrying inner ethernet packets and encap with GRE header with outer IPv6 header. I tested it by running: # make check-kernel under kernel 5.2 and for userspace: # make check TESTSUITEFLAGS='-k ip6gretap' Signed-off-by: William Tu --- v1-v2: rebase to master --- Documentation/faq/configuration.rst | 12 +++ NEWS| 1 + datapath/linux/compat/ip6_gre.c | 2 +- lib/dpif-netlink-rtnl.c | 2 +- lib/dpif-netlink.c | 4 ++- lib/netdev-vport.c | 4 +-- lib/tnl-ports.c | 3 +- tests/system-traffic.at | 40 ++ tests/tunnel-push-pop-ipv6.at | 68 + 9 files changed, 130 insertions(+), 6 deletions(-) diff --git a/Documentation/faq/configuration.rst b/Documentation/faq/configuration.rst index cb2c6b4eca98..c9bcfa8a790d 100644 --- a/Documentation/faq/configuration.rst +++ b/Documentation/faq/configuration.rst @@ -212,6 +212,18 @@ Q: Does Open vSwitch support ERSPAN? options:erspan_ver=2 options:erspan_dir=1 \ options:erspan_hwid=4 +Q: Does Open vSwitch support IPv6 GRE? + +A: Yes. L2 tunnel interface GRE over IPv6 is supported. +L3 GRE tunnel over IPv6 is not supported. + +:: + +$ ovs-vsctl add-br br0 +$ ovs-vsctl add-port br0 at_gretap0 -- \ +set int at_gretap0 type=ip6gretap \ +options:remote_ip=fc00:100::1 + Q: How do I connect two bridges? A: First, why do you want to do this? Two connected bridges are not much diff --git a/NEWS b/NEWS index a38ab258fc6c..c7e84ed7931d 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,7 @@ Post-v2.11.0 - Linux datapath: * Support for the kernel versions 4.19.x and 4.20.x. * Support for the kernel version 5.0.x. + - Add L2 GRE tunnel over IPv6 support. v2.11.0 - 19 Feb 2019 diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c index ca4e66133570..ab50c72d0753 100644 --- a/datapath/linux/compat/ip6_gre.c +++ b/datapath/linux/compat/ip6_gre.c @@ -2550,7 +2550,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = { }; static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { - .kind = "ip6gre", + .kind = "ip6gretap", .maxtype= RPL_IFLA_GRE_MAX, .policy = ip6gre_policy, .priv_size = sizeof(struct ip6_tnl), diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index 2e23a8c14fcf..d666f239aeed 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -104,7 +104,7 @@ vport_type_to_kind(enum ovs_vport_type type, case OVS_VPORT_TYPE_IP6ERSPAN: return "ip6erspan"; case OVS_VPORT_TYPE_IP6GRE: -return "ip6gre"; +return "ip6gretap"; case OVS_VPORT_TYPE_NETDEV: case OVS_VPORT_TYPE_INTERNAL: case OVS_VPORT_TYPE_LISP: diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index ba80a0079181..fc1d1591975e 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -699,7 +699,7 @@ get_vport_type(const struct dpif_netlink_vport *vport) return "ip6erspan"; case OVS_VPORT_TYPE_IP6GRE: -return "ip6gre"; +return "ip6gretap"; case OVS_VPORT_TYPE_UNSPEC: case __OVS_VPORT_TYPE_MAX: @@ -730,6 +730,8 @@ netdev_to_ovs_vport_type(const char *type) return OVS_VPORT_TYPE_ERSPAN; } else if (!strcmp(type, "ip6erspan")) { return OVS_VPORT_TYPE_IP6ERSPAN; +} else if (!strcmp(type, "ip6gretap")) { +return OVS_VPORT_TYPE_IP6GRE; } else if (!strcmp(type, "ip6gre")) { return OVS_VPORT_TYPE_IP6GRE; } else if (!strcmp(type, "gre")) { diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 92a256af16ed..5a20415529eb 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -1212,10 +1212,10 @@ netdev_vport_tunnel_register(void) }, {{NULL, NULL, 0, 0}} }, -{ "ip6gre_sys", +{ "ip6gretap_sys", { TUNNEL_FUNCTIONS_COMMON, - .type = "ip6gre", + .type = "ip6gretap", .build_header = netdev_gre_build_header, .push_header = netdev_gre_push_header, .pop_header = netdev_gre_pop_header diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c index 17353046cc6e..62065c0027cd 100644 --- a/lib/tnl-ports.c +++ b/lib/tnl-ports.c @@ -172,7 +172,8 @@ tnl_type_to_nw_proto(const char type[]) return IPPROTO_TCP; } if (!strcmp(type, "gre") || !strcmp(type, "erspan") || -!strcmp(type, "ip6erspan") ||
Re: [ovs-dev] [PATCHv2] tunnel: add ip6gretap support.
On 6/20/2019 6:55 PM, William Tu wrote: > The patch adds ip6gretap support. Tunnel type ip6gretap is a layer 2 GRE > tunnel over IPv6, carrying inner ethernet packets and encap with GRE header > with outer IPv6 header. I tested it by running: ># make check-kernel > under kernel 5.2 and for userspace: ># make check TESTSUITEFLAGS='-k ip6gretap' > > Signed-off-by: William Tu > --- > v1-v2: rebase to master > > --- > Documentation/faq/configuration.rst | 12 +++ > NEWS| 1 + > datapath/linux/compat/ip6_gre.c | 2 +- > lib/dpif-netlink-rtnl.c | 2 +- > lib/dpif-netlink.c | 4 ++- > lib/netdev-vport.c | 4 +-- > lib/tnl-ports.c | 3 +- > tests/system-traffic.at | 40 ++ > tests/tunnel-push-pop-ipv6.at | 68 > + > 9 files changed, 130 insertions(+), 6 deletions(-) > > diff --git a/Documentation/faq/configuration.rst > b/Documentation/faq/configuration.rst > index cb2c6b4eca98..c9bcfa8a790d 100644 > --- a/Documentation/faq/configuration.rst > +++ b/Documentation/faq/configuration.rst > @@ -212,6 +212,18 @@ Q: Does Open vSwitch support ERSPAN? > options:erspan_ver=2 options:erspan_dir=1 \ > options:erspan_hwid=4 > > +Q: Does Open vSwitch support IPv6 GRE? > + > +A: Yes. L2 tunnel interface GRE over IPv6 is supported. > +L3 GRE tunnel over IPv6 is not supported. > + > +:: > + > +$ ovs-vsctl add-br br0 > +$ ovs-vsctl add-port br0 at_gretap0 -- \ > +set int at_gretap0 type=ip6gretap \ > +options:remote_ip=fc00:100::1 > + > Q: How do I connect two bridges? > > A: First, why do you want to do this? Two connected bridges are not > much > diff --git a/NEWS b/NEWS > index a38ab258fc6c..c7e84ed7931d 100644 > --- a/NEWS > +++ b/NEWS > @@ -47,6 +47,7 @@ Post-v2.11.0 > - Linux datapath: >* Support for the kernel versions 4.19.x and 4.20.x. >* Support for the kernel version 5.0.x. > + - Add L2 GRE tunnel over IPv6 support. > > > v2.11.0 - 19 Feb 2019 > diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c > index ca4e66133570..ab50c72d0753 100644 > --- a/datapath/linux/compat/ip6_gre.c > +++ b/datapath/linux/compat/ip6_gre.c > @@ -2550,7 +2550,7 @@ static struct rtnl_link_ops ip6gre_link_ops > __read_mostly = { > }; > > static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = { > - .kind = "ip6gre", > + .kind = "ip6gretap", > .maxtype= RPL_IFLA_GRE_MAX, > .policy = ip6gre_policy, > .priv_size = sizeof(struct ip6_tnl), > diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c > index 2e23a8c14fcf..d666f239aeed 100644 > --- a/lib/dpif-netlink-rtnl.c > +++ b/lib/dpif-netlink-rtnl.c > @@ -104,7 +104,7 @@ vport_type_to_kind(enum ovs_vport_type type, > case OVS_VPORT_TYPE_IP6ERSPAN: > return "ip6erspan"; > case OVS_VPORT_TYPE_IP6GRE: > -return "ip6gre"; > +return "ip6gretap"; > case OVS_VPORT_TYPE_NETDEV: > case OVS_VPORT_TYPE_INTERNAL: > case OVS_VPORT_TYPE_LISP: > diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c > index ba80a0079181..fc1d1591975e 100644 > --- a/lib/dpif-netlink.c > +++ b/lib/dpif-netlink.c > @@ -699,7 +699,7 @@ get_vport_type(const struct dpif_netlink_vport *vport) > return "ip6erspan"; > > case OVS_VPORT_TYPE_IP6GRE: > -return "ip6gre"; > +return "ip6gretap"; > > case OVS_VPORT_TYPE_UNSPEC: > case __OVS_VPORT_TYPE_MAX: > @@ -730,6 +730,8 @@ netdev_to_ovs_vport_type(const char *type) > return OVS_VPORT_TYPE_ERSPAN; > } else if (!strcmp(type, "ip6erspan")) { > return OVS_VPORT_TYPE_IP6ERSPAN; > +} else if (!strcmp(type, "ip6gretap")) { > +return OVS_VPORT_TYPE_IP6GRE; > } else if (!strcmp(type, "ip6gre")) { > return OVS_VPORT_TYPE_IP6GRE; > } else if (!strcmp(type, "gre")) { > diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c > index 92a256af16ed..5a20415529eb 100644 > --- a/lib/netdev-vport.c > +++ b/lib/netdev-vport.c > @@ -1212,10 +1212,10 @@ netdev_vport_tunnel_register(void) > }, > {{NULL, NULL, 0, 0}} > }, > -{ "ip6gre_sys", > +{ "ip6gretap_sys", > { > TUNNEL_FUNCTIONS_COMMON, > - .type = "ip6gre", > + .type = "ip6gretap", > .build_header = netdev_gre_build_header, > .push_header = netdev_gre_push_header, > .pop_header = netdev_gre_pop_header > diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c > index 17353046cc6e..62065c0027cd 100644 > --- a/lib/tnl-ports.c > +++ b/lib/tnl-ports.c > @@ -172,7 +172,8 @@ tnl_type_to_nw_proto(const char