mbox series

[ovs-dev,v12,0/5] userspace: Add SRv6 tunnel support.

Message ID 20230329055118.57547-1-nmiki@yahoo-corp.jp
Headers show
Series userspace: Add SRv6 tunnel support. | expand

Message

Nobuhiro MIKI March 29, 2023, 5:51 a.m. UTC
v12:
* Fix nw_proto after encap.
* Fix to check nw_proto in system-traffic.at.
* Remove OVS_UNUSED annotation.
v11:
* Fix comments.
* Clean up conditional statements.
  ("!rt_hdr || rt_hdr->type != IPV6_SRCRT_TYPE_4").
* Remove variables from function prototype.
* Define IPPROTO_IPIP for sparse.
v10:
* Clean up tnl_type_to_nw_proto().
* Support frag_hdr=NULL and/or rt_hdr=NULL in parse_ipv6_ext_hdrs().
* Clean up srv6_build_header() to use netdev_tnl_ip_build_header().
* Fix to avoid using sizeof(<type name>) style.
* Add validation that checks segs[0] == params->flow->tunnel.ipv6_dst.
* Add more tests for tests/odp.at.
* Enhance validation for external input to prevent over-writing
v9:
* Fix compile warnings
v8:
* Split the patch into multiple patches.
* Fix docs and NEWS to point to version 3.2.
* Move tests from tests/system-userspace-traffic.at
  to tests/system-traffic.at.
v7:
* fix flake8 error
v6:
* add tests that show interoperability between OVS and native kernel's
  implementation in tests/system-userspace-traffic.at.
* fix the documentation.
* add validation in routing header by parse_ipv6_ext_hdrs.
* add parsing implementation and test in tests/odp.at,
  python/ovs/flow/odp.py and python/ovs/tests/test_odp.py.
* fix coding style.
* add build-time assertion on the structure size.
v5:
* rebased on latest master
v4:
* fix alignment on cast
v3:
* fix alignment on cast
v2:
* fix pointer arithmetic

Nobuhiro MIKI (5):
  tests: Define new ADD_VETH_NS macro.
  tnl-ports: Support multiple nw_protos.
  flow: Support rt_hdr in parse_ipv6_ext_hdrs().
  userspace: Add SRv6 tunnel support.
  odp: Add SRv6 tunnel actions.

 Documentation/faq/configuration.rst |  21 +++++
 Documentation/faq/releases.rst      |   1 +
 NEWS                                |   2 +
 include/linux/openvswitch.h         |   1 +
 include/sparse/netinet/in.h         |   1 +
 lib/conntrack.c                     |   4 +-
 lib/dpif-netlink-rtnl.c             |   5 ++
 lib/dpif-netlink.c                  |   5 ++
 lib/flow.c                          |  48 +++++++---
 lib/flow.h                          |   3 +-
 lib/ipf.c                           |  15 ++--
 lib/netdev-native-tnl.c             | 130 ++++++++++++++++++++++++++++
 lib/netdev-native-tnl.h             |  10 +++
 lib/netdev-vport.c                  |  53 ++++++++++++
 lib/netdev.h                        |   4 +
 lib/odp-util.c                      |  70 +++++++++++++++
 lib/packets.h                       |  20 +++++
 lib/tnl-ports.c                     |  85 +++++++++++-------
 ofproto/ofproto-dpif-xlate.c        |   4 +
 python/ovs/flow/odp.py              |   8 ++
 python/ovs/tests/test_odp.py        |  16 ++++
 tests/odp.at                        |  12 ++-
 tests/system-common-macros.at       |  16 ++++
 tests/system-kmod-macros.at         |   8 ++
 tests/system-traffic.at             | 124 ++++++++++++++++++++++++++
 tests/system-userspace-macros.at    |   6 ++
 tests/tunnel-push-pop-ipv6.at       |  23 +++++
 tests/tunnel.at                     |  56 ++++++++++++
 28 files changed, 695 insertions(+), 56 deletions(-)

Comments

Ilya Maximets March 29, 2023, 9:17 p.m. UTC | #1
On 3/29/23 07:51, Nobuhiro MIKI wrote:
> v12:
> * Fix nw_proto after encap.
> * Fix to check nw_proto in system-traffic.at.
> * Remove OVS_UNUSED annotation.
> v11:
> * Fix comments.
> * Clean up conditional statements.
>   ("!rt_hdr || rt_hdr->type != IPV6_SRCRT_TYPE_4").
> * Remove variables from function prototype.
> * Define IPPROTO_IPIP for sparse.
> v10:
> * Clean up tnl_type_to_nw_proto().
> * Support frag_hdr=NULL and/or rt_hdr=NULL in parse_ipv6_ext_hdrs().
> * Clean up srv6_build_header() to use netdev_tnl_ip_build_header().
> * Fix to avoid using sizeof(<type name>) style.
> * Add validation that checks segs[0] == params->flow->tunnel.ipv6_dst.
> * Add more tests for tests/odp.at.
> * Enhance validation for external input to prevent over-writing
> v9:
> * Fix compile warnings
> v8:
> * Split the patch into multiple patches.
> * Fix docs and NEWS to point to version 3.2.
> * Move tests from tests/system-userspace-traffic.at
>   to tests/system-traffic.at.
> v7:
> * fix flake8 error
> v6:
> * add tests that show interoperability between OVS and native kernel's
>   implementation in tests/system-userspace-traffic.at.
> * fix the documentation.
> * add validation in routing header by parse_ipv6_ext_hdrs.
> * add parsing implementation and test in tests/odp.at,
>   python/ovs/flow/odp.py and python/ovs/tests/test_odp.py.
> * fix coding style.
> * add build-time assertion on the structure size.
> v5:
> * rebased on latest master
> v4:
> * fix alignment on cast
> v3:
> * fix alignment on cast
> v2:
> * fix pointer arithmetic
> 
> Nobuhiro MIKI (5):
>   tests: Define new ADD_VETH_NS macro.
>   tnl-ports: Support multiple nw_protos.
>   flow: Support rt_hdr in parse_ipv6_ext_hdrs().
>   userspace: Add SRv6 tunnel support.
>   odp: Add SRv6 tunnel actions.
> 
>  Documentation/faq/configuration.rst |  21 +++++
>  Documentation/faq/releases.rst      |   1 +
>  NEWS                                |   2 +
>  include/linux/openvswitch.h         |   1 +
>  include/sparse/netinet/in.h         |   1 +
>  lib/conntrack.c                     |   4 +-
>  lib/dpif-netlink-rtnl.c             |   5 ++
>  lib/dpif-netlink.c                  |   5 ++
>  lib/flow.c                          |  48 +++++++---
>  lib/flow.h                          |   3 +-
>  lib/ipf.c                           |  15 ++--
>  lib/netdev-native-tnl.c             | 130 ++++++++++++++++++++++++++++
>  lib/netdev-native-tnl.h             |  10 +++
>  lib/netdev-vport.c                  |  53 ++++++++++++
>  lib/netdev.h                        |   4 +
>  lib/odp-util.c                      |  70 +++++++++++++++
>  lib/packets.h                       |  20 +++++
>  lib/tnl-ports.c                     |  85 +++++++++++-------
>  ofproto/ofproto-dpif-xlate.c        |   4 +
>  python/ovs/flow/odp.py              |   8 ++
>  python/ovs/tests/test_odp.py        |  16 ++++
>  tests/odp.at                        |  12 ++-
>  tests/system-common-macros.at       |  16 ++++
>  tests/system-kmod-macros.at         |   8 ++
>  tests/system-traffic.at             | 124 ++++++++++++++++++++++++++
>  tests/system-userspace-macros.at    |   6 ++
>  tests/tunnel-push-pop-ipv6.at       |  23 +++++
>  tests/tunnel.at                     |  56 ++++++++++++
>  28 files changed, 695 insertions(+), 56 deletions(-)
> 

I added back the definition of IPPROTO_IPIP as it turned out that
MSVC doesn't have it too.  With that and a minor tweak of the NEWS
entry, I applied the set.

I noticed though that we're missing an update for the vswitch.xml
file.  I didn't think that should hold the whole set, but could
you please prepare an update as a separate patch?  You may follow
the changes in ebe0e518b048 ("tunnel: Bareudp Tunnel Support.") as
an example.

Thanks!

Best regards, Ilya Maximets.
Nobuhiro MIKI March 30, 2023, 2:23 a.m. UTC | #2
On 2023/03/30 6:17, Ilya Maximets wrote:
> On 3/29/23 07:51, Nobuhiro MIKI wrote:
>> v12:
>> * Fix nw_proto after encap.
>> * Fix to check nw_proto in system-traffic.at.
>> * Remove OVS_UNUSED annotation.
>> v11:
>> * Fix comments.
>> * Clean up conditional statements.
>>   ("!rt_hdr || rt_hdr->type != IPV6_SRCRT_TYPE_4").
>> * Remove variables from function prototype.
>> * Define IPPROTO_IPIP for sparse.
>> v10:
>> * Clean up tnl_type_to_nw_proto().
>> * Support frag_hdr=NULL and/or rt_hdr=NULL in parse_ipv6_ext_hdrs().
>> * Clean up srv6_build_header() to use netdev_tnl_ip_build_header().
>> * Fix to avoid using sizeof(<type name>) style.
>> * Add validation that checks segs[0] == params->flow->tunnel.ipv6_dst.
>> * Add more tests for tests/odp.at.
>> * Enhance validation for external input to prevent over-writing
>> v9:
>> * Fix compile warnings
>> v8:
>> * Split the patch into multiple patches.
>> * Fix docs and NEWS to point to version 3.2.
>> * Move tests from tests/system-userspace-traffic.at
>>   to tests/system-traffic.at.
>> v7:
>> * fix flake8 error
>> v6:
>> * add tests that show interoperability between OVS and native kernel's
>>   implementation in tests/system-userspace-traffic.at.
>> * fix the documentation.
>> * add validation in routing header by parse_ipv6_ext_hdrs.
>> * add parsing implementation and test in tests/odp.at,
>>   python/ovs/flow/odp.py and python/ovs/tests/test_odp.py.
>> * fix coding style.
>> * add build-time assertion on the structure size.
>> v5:
>> * rebased on latest master
>> v4:
>> * fix alignment on cast
>> v3:
>> * fix alignment on cast
>> v2:
>> * fix pointer arithmetic
>>
>> Nobuhiro MIKI (5):
>>   tests: Define new ADD_VETH_NS macro.
>>   tnl-ports: Support multiple nw_protos.
>>   flow: Support rt_hdr in parse_ipv6_ext_hdrs().
>>   userspace: Add SRv6 tunnel support.
>>   odp: Add SRv6 tunnel actions.
>>
>>  Documentation/faq/configuration.rst |  21 +++++
>>  Documentation/faq/releases.rst      |   1 +
>>  NEWS                                |   2 +
>>  include/linux/openvswitch.h         |   1 +
>>  include/sparse/netinet/in.h         |   1 +
>>  lib/conntrack.c                     |   4 +-
>>  lib/dpif-netlink-rtnl.c             |   5 ++
>>  lib/dpif-netlink.c                  |   5 ++
>>  lib/flow.c                          |  48 +++++++---
>>  lib/flow.h                          |   3 +-
>>  lib/ipf.c                           |  15 ++--
>>  lib/netdev-native-tnl.c             | 130 ++++++++++++++++++++++++++++
>>  lib/netdev-native-tnl.h             |  10 +++
>>  lib/netdev-vport.c                  |  53 ++++++++++++
>>  lib/netdev.h                        |   4 +
>>  lib/odp-util.c                      |  70 +++++++++++++++
>>  lib/packets.h                       |  20 +++++
>>  lib/tnl-ports.c                     |  85 +++++++++++-------
>>  ofproto/ofproto-dpif-xlate.c        |   4 +
>>  python/ovs/flow/odp.py              |   8 ++
>>  python/ovs/tests/test_odp.py        |  16 ++++
>>  tests/odp.at                        |  12 ++-
>>  tests/system-common-macros.at       |  16 ++++
>>  tests/system-kmod-macros.at         |   8 ++
>>  tests/system-traffic.at             | 124 ++++++++++++++++++++++++++
>>  tests/system-userspace-macros.at    |   6 ++
>>  tests/tunnel-push-pop-ipv6.at       |  23 +++++
>>  tests/tunnel.at                     |  56 ++++++++++++
>>  28 files changed, 695 insertions(+), 56 deletions(-)
>>
> 
> I added back the definition of IPPROTO_IPIP as it turned out that
> MSVC doesn't have it too.  With that and a minor tweak of the NEWS
> entry, I applied the set.
> 

I think it was a complicated patch set.
Thanks so much for your kind cooperation!

> I noticed though that we're missing an update for the vswitch.xml
> file.  I didn't think that should hold the whole set, but could
> you please prepare an update as a separate patch?  You may follow
> the changes in ebe0e518b048 ("tunnel: Bareudp Tunnel Support.") as
> an example.
> 

Of course. I'll prepare a separate patch to update vswitch.xml.

Best Regards,
Nobuhiro MIKI
Ilya Maximets March 30, 2023, 8:01 p.m. UTC | #3
On 3/30/23 04:23, Nobuhiro MIKI wrote:
> On 2023/03/30 6:17, Ilya Maximets wrote:
>> On 3/29/23 07:51, Nobuhiro MIKI wrote:
>>> v12:
>>> * Fix nw_proto after encap.
>>> * Fix to check nw_proto in system-traffic.at.
>>> * Remove OVS_UNUSED annotation.
>>> v11:
>>> * Fix comments.
>>> * Clean up conditional statements.
>>>   ("!rt_hdr || rt_hdr->type != IPV6_SRCRT_TYPE_4").
>>> * Remove variables from function prototype.
>>> * Define IPPROTO_IPIP for sparse.
>>> v10:
>>> * Clean up tnl_type_to_nw_proto().
>>> * Support frag_hdr=NULL and/or rt_hdr=NULL in parse_ipv6_ext_hdrs().
>>> * Clean up srv6_build_header() to use netdev_tnl_ip_build_header().
>>> * Fix to avoid using sizeof(<type name>) style.
>>> * Add validation that checks segs[0] == params->flow->tunnel.ipv6_dst.
>>> * Add more tests for tests/odp.at.
>>> * Enhance validation for external input to prevent over-writing
>>> v9:
>>> * Fix compile warnings
>>> v8:
>>> * Split the patch into multiple patches.
>>> * Fix docs and NEWS to point to version 3.2.
>>> * Move tests from tests/system-userspace-traffic.at
>>>   to tests/system-traffic.at.
>>> v7:
>>> * fix flake8 error
>>> v6:
>>> * add tests that show interoperability between OVS and native kernel's
>>>   implementation in tests/system-userspace-traffic.at.
>>> * fix the documentation.
>>> * add validation in routing header by parse_ipv6_ext_hdrs.
>>> * add parsing implementation and test in tests/odp.at,
>>>   python/ovs/flow/odp.py and python/ovs/tests/test_odp.py.
>>> * fix coding style.
>>> * add build-time assertion on the structure size.
>>> v5:
>>> * rebased on latest master
>>> v4:
>>> * fix alignment on cast
>>> v3:
>>> * fix alignment on cast
>>> v2:
>>> * fix pointer arithmetic
>>>
>>> Nobuhiro MIKI (5):
>>>   tests: Define new ADD_VETH_NS macro.
>>>   tnl-ports: Support multiple nw_protos.
>>>   flow: Support rt_hdr in parse_ipv6_ext_hdrs().
>>>   userspace: Add SRv6 tunnel support.
>>>   odp: Add SRv6 tunnel actions.
>>>
>>>  Documentation/faq/configuration.rst |  21 +++++
>>>  Documentation/faq/releases.rst      |   1 +
>>>  NEWS                                |   2 +
>>>  include/linux/openvswitch.h         |   1 +
>>>  include/sparse/netinet/in.h         |   1 +
>>>  lib/conntrack.c                     |   4 +-
>>>  lib/dpif-netlink-rtnl.c             |   5 ++
>>>  lib/dpif-netlink.c                  |   5 ++
>>>  lib/flow.c                          |  48 +++++++---
>>>  lib/flow.h                          |   3 +-
>>>  lib/ipf.c                           |  15 ++--
>>>  lib/netdev-native-tnl.c             | 130 ++++++++++++++++++++++++++++
>>>  lib/netdev-native-tnl.h             |  10 +++
>>>  lib/netdev-vport.c                  |  53 ++++++++++++
>>>  lib/netdev.h                        |   4 +
>>>  lib/odp-util.c                      |  70 +++++++++++++++
>>>  lib/packets.h                       |  20 +++++
>>>  lib/tnl-ports.c                     |  85 +++++++++++-------
>>>  ofproto/ofproto-dpif-xlate.c        |   4 +
>>>  python/ovs/flow/odp.py              |   8 ++
>>>  python/ovs/tests/test_odp.py        |  16 ++++
>>>  tests/odp.at                        |  12 ++-
>>>  tests/system-common-macros.at       |  16 ++++
>>>  tests/system-kmod-macros.at         |   8 ++
>>>  tests/system-traffic.at             | 124 ++++++++++++++++++++++++++
>>>  tests/system-userspace-macros.at    |   6 ++
>>>  tests/tunnel-push-pop-ipv6.at       |  23 +++++
>>>  tests/tunnel.at                     |  56 ++++++++++++
>>>  28 files changed, 695 insertions(+), 56 deletions(-)
>>>
>>
>> I added back the definition of IPPROTO_IPIP as it turned out that
>> MSVC doesn't have it too.  With that and a minor tweak of the NEWS
>> entry, I applied the set.
>>
> 
> I think it was a complicated patch set.
> Thanks so much for your kind cooperation!

Thanks for your contribution!
Was a good learning exercise for me, as I learned a few
things about SRv6. :)

> 
>> I noticed though that we're missing an update for the vswitch.xml
>> file.  I didn't think that should hold the whole set, but could
>> you please prepare an update as a separate patch?  You may follow
>> the changes in ebe0e518b048 ("tunnel: Bareudp Tunnel Support.") as
>> an example.
>>
> 
> Of course. I'll prepare a separate patch to update vswitch.xml.

Thanks!

> 
> Best Regards,
> Nobuhiro MIKI