Re: [ovs-dev] [PATCH 1/1] userspace: Add SRv6 tunnel support.
References: <20220704044103.15546-1-nm...@yahoo-corp.jp> Bleep bloop. Greetings Nobuhiro MIKI, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: /bin/sh ./libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror -g -O2 -MT lib/odp-util.lo -MD -MP -MF $depbase.Tpo -c -o lib/odp-util.lo lib/odp-util.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror -g -O2 -MT lib/odp-util.lo -MD -MP -MF lib/.deps/odp-util.Tpo -c lib/odp-util.c -o lib/odp-util.o lib/odp-util.c: In function 'format_odp_tnl_push_header': lib/odp-util.c:724:18: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] srh = l3 + IPV6_HEADER_LEN; ^ lib/odp-util.c:725:29: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] segs = (void *) srh + sizeof(struct srv6_base_hdr); ^ lib/odp-util.c:733:13: error: passing argument 1 of 'ipv6_format_addr' from incompatible pointer type [-Werror] ipv6_format_addr([nr_segs - i - 1], ds); ^ In file included from lib/flow.h:31:0, from lib/odp-util.h:24, from lib/odp-util.c:21: lib/packets.h:1569:6: note: expected 'const struct in6_addr *' but argument is of type 'union ovs_16aligned_in6_addr *' void ipv6_format_addr(const struct in6_addr *addr, struct ds *); ^ cc1: all warnings being treated as errors make[2]: *** [lib/odp-util.lo] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/0day_robot_upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/0day_robot_upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@redhat.com Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH 1/1] userspace: Add SRv6 tunnel support.
References: <20220704043619.14452-1-nm...@yahoo-corp.jp> Bleep bloop. Greetings Nobuhiro MIKI, I am a robot and I have tried out your patch. Thanks for your contribution. I encountered some error that I wasn't expecting. See the details below. build: /bin/sh ./libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib-Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror -g -O2 -MT lib/odp-util.lo -MD -MP -MF $depbase.Tpo -c -o lib/odp-util.lo lib/odp-util.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I ./include -I ./include -I ./lib -I ./lib -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Werror -Werror -g -O2 -MT lib/odp-util.lo -MD -MP -MF lib/.deps/odp-util.Tpo -c lib/odp-util.c -o lib/odp-util.o lib/odp-util.c: In function 'format_odp_tnl_push_header': lib/odp-util.c:724:18: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] srh = l3 + IPV6_HEADER_LEN; ^ lib/odp-util.c:725:29: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith] segs = (void *) srh + sizeof(struct srv6_base_hdr); ^ lib/odp-util.c:733:13: error: passing argument 1 of 'ipv6_format_addr' from incompatible pointer type [-Werror] ipv6_format_addr([nr_segs - i - 1], ds); ^ In file included from lib/flow.h:31:0, from lib/odp-util.h:24, from lib/odp-util.c:21: lib/packets.h:1569:6: note: expected 'const struct in6_addr *' but argument is of type 'union ovs_16aligned_in6_addr *' void ipv6_format_addr(const struct in6_addr *addr, struct ds *); ^ cc1: all warnings being treated as errors make[2]: *** [lib/odp-util.lo] Error 1 make[2]: Leaving directory `/var/lib/jenkins/jobs/0day_robot_upstream_build_from_pw/workspace' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/lib/jenkins/jobs/0day_robot_upstream_build_from_pw/workspace' make: *** [all] Error 2 Please check this out. If you feel there has been an error, please email acon...@redhat.com Thanks, 0-day Robot ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] [PATCH 1/1] userspace: Add SRv6 tunnel support.
SRv6 (Segment Routing IPv6) tunnel vport is responsible for encapsulation and decapsulation the inner packets with IPv6 header and an extended header called SRH (Segment Routing Header). See spec in: https://datatracker.ietf.org/doc/html/rfc8754 This patch implements SRv6 tunneling in userspace datapath. It uses `remote_ip` and `local_ip` options as with existing tunnel protocols. It also adds a dedicated `srv6_segs` option to define a sequence of routers called segment list. Signed-off-by: Nobuhiro MIKI --- Documentation/faq/configuration.rst | 14 ++ Documentation/faq/releases.rst| 1 + NEWS | 2 + .../linux/compat/include/linux/openvswitch.h | 1 + lib/dpif-netlink-rtnl.c | 5 + lib/dpif-netlink.c| 5 + lib/netdev-native-tnl.c | 126 ++ lib/netdev-native-tnl.h | 13 ++ lib/netdev-vport.c| 52 lib/netdev.h | 4 + lib/odp-util.c| 18 +++ lib/packets.h | 12 ++ lib/tnl-ports.c | 5 +- ofproto/ofproto-dpif-ipfix.c | 5 + ofproto/ofproto-dpif-xlate.c | 3 + tests/tunnel-push-pop-ipv6.at | 20 +++ tests/tunnel.at | 55 17 files changed, 340 insertions(+), 1 deletion(-) diff --git a/Documentation/faq/configuration.rst b/Documentation/faq/configuration.rst index dc6c92446..5603ac3fd 100644 --- a/Documentation/faq/configuration.rst +++ b/Documentation/faq/configuration.rst @@ -238,6 +238,20 @@ Q: Does Open vSwitch support GTP-U? set int gtpu0 type=gtpu options:key= \ options:remote_ip=172.31.1.1 +Q: Does Open vSwitch support SRv6? + +A: Yes. Starting with version 2.17, the Open vSwitch userspace +datapath supports SRv6 (Segment Routing over IPv6). The following +example shows tunneling to fc00:300::1 via fc00:100::1 and fc00:200::1. + +:: + +$ ovs-vsctl add-br br0 +$ ovs-vsctl add-port br0 srv6_0 -- \ +set int srv6_0 type=srv6 \ +options:remote_ip=fc00:300::1 \ +options:srv6_segs="fc00:100::1,fc00:200::1,fc00:300::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/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index 8cfe2d392..a99ca5697 100644 --- a/Documentation/faq/releases.rst +++ b/Documentation/faq/releases.rst @@ -149,6 +149,7 @@ Q: Are all features available with all datapaths? Tunnel - ERSPAN 4.18 2.10 2.10 NO Tunnel - ERSPAN-IPv64.18 2.10 2.10 NO Tunnel - GTP-U NO NO 2.14 NO +Tunnel - SRv6 NO NO 2.17 NO Tunnel - Bareudp5.7NO NO NO QoS - Policing YES1.1 2.6 NO QoS - Shaping YES1.1 NO NO diff --git a/NEWS b/NEWS index 994fdf6a9..9a55a6e84 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,8 @@ Post-v2.17.0 * 'dpif-netdev/subtable-lookup-prio-get' appctl command renamed to 'dpif-netdev/subtable-lookup-info-get' to better reflect its purpose. The old variant is kept for backward compatibility. + - SRv6 Tunnel Protocol + * Only support for userspace datapath. v2.17.0 - 17 Feb 2022 diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index 8bb5abdc8..987b5cbf7 100644 --- a/datapath/linux/compat/include/linux/openvswitch.h +++ b/datapath/linux/compat/include/linux/openvswitch.h @@ -254,6 +254,7 @@ enum ovs_vport_type { OVS_VPORT_TYPE_IP6GRE = 109, OVS_VPORT_TYPE_GTPU = 110, OVS_VPORT_TYPE_BAREUDP = 111, /* Bareudp tunnel. */ + OVS_VPORT_TYPE_SRV6 = 112, /* SRv6 tunnel. */ __OVS_VPORT_TYPE_MAX }; diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index 4fc42daed..5788294ae 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -129,6 +129,8 @@ vport_type_to_kind(enum ovs_vport_type type, } case OVS_VPORT_TYPE_GTPU: return NULL; +case OVS_VPORT_TYPE_SRV6: +return "srv6"; case OVS_VPORT_TYPE_BAREUDP: return "bareudp"; case OVS_VPORT_TYPE_NETDEV: @@ -319,6 +321,7 @@ dpif_netlink_rtnl_verify(const struct netdev_tunnel_config *tnl_cfg, case OVS_VPORT_TYPE_LISP: case OVS_VPORT_TYPE_STT: case OVS_VPORT_TYPE_GTPU: +case OVS_VPORT_TYPE_SRV6: case OVS_VPORT_TYPE_UNSPEC: case __OVS_VPORT_TYPE_MAX:
[ovs-dev] [PATCH 1/1] userspace: Add SRv6 tunnel support.
SRv6 (Segment Routing IPv6) tunnel vport is responsible for encapsulation and decapsulation the inner packets with IPv6 header and an extended header called SRH (Segment Routing Header). See spec in: https://datatracker.ietf.org/doc/html/rfc8754 This patch implements SRv6 tunneling in userspace datapath. It uses `remote_ip` and `local_ip` options as with existing tunnel protocols. It also adds a dedicated `srv6_segs` option to define a sequence of routers called segment list. Signed-off-by: Nobuhiro MIKI --- Documentation/faq/configuration.rst | 14 ++ Documentation/faq/releases.rst| 1 + NEWS | 2 + .../linux/compat/include/linux/openvswitch.h | 1 + lib/dpif-netlink-rtnl.c | 5 + lib/dpif-netlink.c| 5 + lib/netdev-native-tnl.c | 126 ++ lib/netdev-native-tnl.h | 13 ++ lib/netdev-vport.c| 52 lib/netdev.h | 4 + lib/odp-util.c| 18 +++ lib/packets.h | 12 ++ lib/tnl-ports.c | 5 +- ofproto/ofproto-dpif-ipfix.c | 5 + ofproto/ofproto-dpif-xlate.c | 3 + tests/tunnel-push-pop-ipv6.at | 20 +++ tests/tunnel.at | 55 17 files changed, 340 insertions(+), 1 deletion(-) diff --git a/Documentation/faq/configuration.rst b/Documentation/faq/configuration.rst index dc6c92446..5603ac3fd 100644 --- a/Documentation/faq/configuration.rst +++ b/Documentation/faq/configuration.rst @@ -238,6 +238,20 @@ Q: Does Open vSwitch support GTP-U? set int gtpu0 type=gtpu options:key= \ options:remote_ip=172.31.1.1 +Q: Does Open vSwitch support SRv6? + +A: Yes. Starting with version 2.17, the Open vSwitch userspace +datapath supports SRv6 (Segment Routing over IPv6). The following +example shows tunneling to fc00:300::1 via fc00:100::1 and fc00:200::1. + +:: + +$ ovs-vsctl add-br br0 +$ ovs-vsctl add-port br0 srv6_0 -- \ +set int srv6_0 type=srv6 \ +options:remote_ip=fc00:300::1 \ +options:srv6_segs="fc00:100::1,fc00:200::1,fc00:300::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/Documentation/faq/releases.rst b/Documentation/faq/releases.rst index 8cfe2d392..a99ca5697 100644 --- a/Documentation/faq/releases.rst +++ b/Documentation/faq/releases.rst @@ -149,6 +149,7 @@ Q: Are all features available with all datapaths? Tunnel - ERSPAN 4.18 2.10 2.10 NO Tunnel - ERSPAN-IPv64.18 2.10 2.10 NO Tunnel - GTP-U NO NO 2.14 NO +Tunnel - SRv6 NO NO 2.17 NO Tunnel - Bareudp5.7NO NO NO QoS - Policing YES1.1 2.6 NO QoS - Shaping YES1.1 NO NO diff --git a/NEWS b/NEWS index 994fdf6a9..9a55a6e84 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,8 @@ Post-v2.17.0 * 'dpif-netdev/subtable-lookup-prio-get' appctl command renamed to 'dpif-netdev/subtable-lookup-info-get' to better reflect its purpose. The old variant is kept for backward compatibility. + - SRv6 Tunnel Protocol + * Only support for userspace datapath. v2.17.0 - 17 Feb 2022 diff --git a/datapath/linux/compat/include/linux/openvswitch.h b/datapath/linux/compat/include/linux/openvswitch.h index 8bb5abdc8..987b5cbf7 100644 --- a/datapath/linux/compat/include/linux/openvswitch.h +++ b/datapath/linux/compat/include/linux/openvswitch.h @@ -254,6 +254,7 @@ enum ovs_vport_type { OVS_VPORT_TYPE_IP6GRE = 109, OVS_VPORT_TYPE_GTPU = 110, OVS_VPORT_TYPE_BAREUDP = 111, /* Bareudp tunnel. */ + OVS_VPORT_TYPE_SRV6 = 112, /* SRv6 tunnel. */ __OVS_VPORT_TYPE_MAX }; diff --git a/lib/dpif-netlink-rtnl.c b/lib/dpif-netlink-rtnl.c index 4fc42daed..5788294ae 100644 --- a/lib/dpif-netlink-rtnl.c +++ b/lib/dpif-netlink-rtnl.c @@ -129,6 +129,8 @@ vport_type_to_kind(enum ovs_vport_type type, } case OVS_VPORT_TYPE_GTPU: return NULL; +case OVS_VPORT_TYPE_SRV6: +return "srv6"; case OVS_VPORT_TYPE_BAREUDP: return "bareudp"; case OVS_VPORT_TYPE_NETDEV: @@ -319,6 +321,7 @@ dpif_netlink_rtnl_verify(const struct netdev_tunnel_config *tnl_cfg, case OVS_VPORT_TYPE_LISP: case OVS_VPORT_TYPE_STT: case OVS_VPORT_TYPE_GTPU: +case OVS_VPORT_TYPE_SRV6: case OVS_VPORT_TYPE_UNSPEC: case __OVS_VPORT_TYPE_MAX: