On Tue, Aug 7, 2018 at 5:49 AM, Charles Myers <[email protected]>
wrote:

> This patch series adds IPv6 support to OSv.
>
> The first 5 parts of the series should have no impact on existing
> OSv code.  The rest of the patches starting from the net channel
> changes do impact existing code.
>

Thanks. Very impressive work!

I tried to review these patches, and everything looks good - I just wrote
you a few fairly
minor comments on the individual patches.

However, I have to admit that due to the sheer breadth of these patches,
and my
lack of familiarity with some of the code involved, I can't really be sure
that no bugs
will creap in. So I'm happy that you added more tests, and I understand
that you
guys are testing this code - in both IPv4 (right?) and IPv6 - in
production, so if bugs crept
in, we'll probably find them soon, so I'm fine with committing these
patches now.

So please look at my comments, fix whatever you decide to fixed based on
these
comments, and provide a new version for me to commit. You can either post
the
series to the mailing list, or just provide me a link to a github branch to
merge.


>
> All parts should compile and test without issues, but IPv6 is only
> enabled with the last patch in the series.
>
> The IPv6 support is optional and can be enabled/disabled using the
> conf-INET6 option in the conf/base.mk file.
>
> Currently there are 2 known remaining issues left which are due to
> limitations of the FreeBSD 9.0 IPv6 code which this code is base off of.
>
> 1. The NDP code is not thread safe
>    The FreeBSD 9.0 IPv6 code is not MPSAFE and expects callouts to run
>    with the giant lock and uses splnet() to ensure thread safety.
>    Unfortunatley OSv does not support these mechanisms and it is pretty
>    tricky to modify the FreeBSD 9.0 IPv6 code to make it thread safe
>    without them due to multiple locks required in the NDP code.
>
> 2. IPv6 MAC cache entries can expire causing extra neighbor solicits
>    This does not occur when using TCP sockets which keep the cache
>    entry active using ND6_HINT() but can occur for UDP or raw IP.
>

Can you please open issues in the OSv bug tracker with these explanations
of these remaining problems?


>
> These issues appear to be fixed in FreeBSD 11, however back porting these
> fixes is pretty involved and impacts a lot of the existing FreeBSD
> code not only IPv6.
>
> IPv6 Stateless Autoconfiguration is enabled, but has not been tested yet.
>
> DHCPv6 is not supported yet.
>
> Static IPv6 addresses may be configured using command line arguments:
>
> ./scripts/run.py  --execute \
>     "--ip=eth0,2001:1:1::501,64 --defaultgw=2001:1:1::1 \
>      /tools/iperf -s -V -B ::"
>
> or using cloud-init network version 1 yaml which is also added with
> this patch series:
>
> #cloud-config
> network:
>     version: 1
>     config:
>     - type: physical
>       name: eth0
>       subnets:
>           - type: static
>             address: 2001:1:1::501/64
>
> Charles Myers (16):
>   bsd: Added unmodified IPv6 .h files from FreeBSD 9.0
>   bsd: Added unmodified IPv6 .c files from FreeBSD 9.0
>   bsd: Renamed IPv6 files from *.c to *.cc
>   bsd: Modify FreeBSD IPv6 .h files for OSv
>   bsd: Modify FreeBSD IPv6 .cc files for OSv
>   bsd: Added IPv6 net channel support
>   bsd: Modifications to shared IPv4/IPv6 code (eth,tcp,udp) for IPv6
>   bsd: OSv API support for IPv6
>   bsd: Added partial Linux NETLINK socket support
>   libc: Fix if_indextoname(), if_nametoindex()
>   libc: Add IPv6 support to getifaddrs(), if_nameindex() using NETLINK
>     socket
>   bsd: Fix SIOCSIFNAME when using linux compatiblity socket
>   bsd: linux socket support for IPv6, IP_PKTINFO, IPV6_PKTINFO,
>     SCM_TIMESTAMP
>   cloud-init: Added support for Network v1 and ConfigDrive data source
>   bsd: Added unit tests for IPv6 TCP, IP_PKTINFO, IPV6_PKTINFO,
>     SCM_TIMESTAMP
>   bsd: Added conf-INET6 option to enable IPv6 support
>
>  Makefile                              |   29 +-
>  bsd/net.cc                            |   28 +-
>  bsd/porting/netport.h                 |    4 +
>  bsd/porting/networking.cc             |  178 +-
>  bsd/porting/networking.hh             |    8 +
>  bsd/porting/route.cc                  |   86 +-
>  bsd/sys/compat/linux/linux.h          |   12 +-
>  bsd/sys/compat/linux/linux_ioctl.cc   |   37 +-
>  bsd/sys/compat/linux/linux_netlink.cc |  904 +++++++++
>  bsd/sys/compat/linux/linux_netlink.h  |  175 ++
>  bsd/sys/compat/linux/linux_socket.cc  |  731 ++++++--
>  bsd/sys/compat/linux/linux_socket.h   |  102 +-
>  bsd/sys/dev/xen/netfront/netfront.cc  |    4 +
>  bsd/sys/kern/sys_socket.cc            |    1 +
>  bsd/sys/kern/uipc_sockbuf.cc          |    1 +
>  bsd/sys/kern/uipc_socket.cc           |    1 +
>  bsd/sys/kern/uipc_syscalls.cc         |   45 +-
>  bsd/sys/kern/uipc_syscalls_wrap.cc    |    6 +-
>  bsd/sys/net/if.cc                     |   15 +
>  bsd/sys/net/if_ethersubr.cc           |    5 +-
>  bsd/sys/net/if_llatbl.cc              |   47 +-
>  bsd/sys/net/if_llatbl.h               |   13 +
>  bsd/sys/net/if_var.h                  |   14 +-
>  bsd/sys/net/netisr.h                  |    1 +
>  bsd/sys/net/routecache.hh             |    1 +
>  bsd/sys/netinet/icmp6.h               |  760 ++++++++
>  bsd/sys/netinet/in.cc                 |   10 +
>  bsd/sys/netinet/in.h                  |    1 +
>  bsd/sys/netinet/ip6.h                 |  267 +++
>  bsd/sys/netinet/tcp_input.cc          |  509 ++++-
>  bsd/sys/netinet/tcp_lro.cc            |    4 +-
>  bsd/sys/netinet/tcp_lro.h             |   15 +-
>  bsd/sys/netinet/tcp_reass.cc          |    4 +-
>  bsd/sys/netinet/tcp_subr.cc           |    6 +-
>  bsd/sys/netinet/tcp_syncache.cc       |    3 +-
>  bsd/sys/netinet/tcp_usrreq.cc         |   62 +-
>  bsd/sys/netinet/udp_usrreq.cc         |    2 +-
>  bsd/sys/netinet6/dest6.cc             |  123 ++
>  bsd/sys/netinet6/frag6.cc             |  793 ++++++++
>  bsd/sys/netinet6/icmp6.cc             | 2942 +++++++++++++++++++++++++++++
>  bsd/sys/netinet6/in6.cc               | 2791 +++++++++++++++++++++++++++
>  bsd/sys/netinet6/in6.h                |  125 +-
>  bsd/sys/netinet6/in6_cksum.cc         |  359 ++++
>  bsd/sys/netinet6/in6_ifattach.cc      |  968 ++++++++++
>  bsd/sys/netinet6/in6_ifattach.h       |   45 +
>  bsd/sys/netinet6/in6_mcast.cc         | 2833 ++++++++++++++++++++++++++++
>  bsd/sys/netinet6/in6_pcb.cc           | 1153 ++++++++++++
>  bsd/sys/netinet6/in6_pcb.h            |  124 ++
>  bsd/sys/netinet6/in6_proto.cc         |  627 +++++++
>  bsd/sys/netinet6/in6_rmx.cc           |  338 ++++
>  bsd/sys/netinet6/in6_src.cc           | 1154 ++++++++++++
>  bsd/sys/netinet6/in6_var.h            |  898 +++++++++
>  bsd/sys/netinet6/ip6_forward.cc       |  681 +++++++
>  bsd/sys/netinet6/ip6_id.cc            |  273 +++
>  bsd/sys/netinet6/ip6_input.cc         | 1891 +++++++++++++++++++
>  bsd/sys/netinet6/ip6_ipsec.cc         |  391 ++++
>  bsd/sys/netinet6/ip6_ipsec.h          |   43 +
>  bsd/sys/netinet6/ip6_mroute.cc        | 2064 ++++++++++++++++++++
>  bsd/sys/netinet6/ip6_mroute.h         |  270 +++
>  bsd/sys/netinet6/ip6_output.cc        | 3077
> ++++++++++++++++++++++++++++++
>  bsd/sys/netinet6/ip6_var.h            |  456 +++++
>  bsd/sys/netinet6/ip6protosw.h         |  148 ++
>  bsd/sys/netinet6/mld6.cc              | 3325
> +++++++++++++++++++++++++++++++++
>  bsd/sys/netinet6/mld6.h               |  119 ++
>  bsd/sys/netinet6/mld6_var.h           |  164 ++
>  bsd/sys/netinet6/nd6.cc               | 2408 ++++++++++++++++++++++++
>  bsd/sys/netinet6/nd6.h                |  455 +++++
>  bsd/sys/netinet6/nd6_nbr.cc           | 1587 ++++++++++++++++
>  bsd/sys/netinet6/nd6_rtr.cc           | 2212 ++++++++++++++++++++++
>  bsd/sys/netinet6/pim6.h               |   69 +
>  bsd/sys/netinet6/pim6_var.h           |   68 +
>  bsd/sys/netinet6/raw_ip6.cc           |  924 +++++++++
>  bsd/sys/netinet6/raw_ip6.h            |   55 +
>  bsd/sys/netinet6/route6.cc            |  110 ++
>  bsd/sys/netinet6/scope6.cc            |  506 +++++
>  bsd/sys/netinet6/scope6_var.h         |   60 +
>  bsd/sys/netinet6/send.cc              |  367 ++++
>  bsd/sys/netinet6/send.h               |   45 +
>  bsd/sys/netinet6/tcp6_var.h           |   83 +
>  bsd/sys/netinet6/udp6_usrreq.cc       | 1165 ++++++++++++
>  bsd/sys/netinet6/udp6_var.h           |   75 +
>  bsd/sys/sys/socketvar.h               |    3 +-
>  bsd/uipc_syscalls.h                   |    4 +-
>  conf/base.mk                          |    5 +
>  core/net_channel.cc                   |  183 +-
>  drivers/virtio-net.cc                 |    2 +-
>  drivers/vmxnet3.cc                    |    2 +-
>  include/api/netinet/__icmp6.h         |   11 +
>  include/api/netinet/in.h              |   52 +-
>  include/api/netinet6/__in6.h          |   70 +
>  include/osv/net_channel.hh            |   77 +-
>  libc/network/getifaddrs.c             |  392 ++--
>  libc/network/if_indextoname.c         |    2 +-
>  libc/network/if_nameindex.c           |  136 +-
>  libc/network/if_nametoindex.c         |    2 +-
>  libc/network/netlink.c                |   66 +
>  libc/network/netlink.h                |   94 +
>  loader.cc                             |   76 +-
>  modules/cloud-init/Makefile           |    2 +-
>  modules/cloud-init/main.cc            |   77 +-
>  modules/cloud-init/network-module.cc  |  369 ++++
>  modules/cloud-init/network-module.hh  |   43 +
>  modules/tests/Makefile                |   16 +-
>  tests/tst-pktinfo.cc                  |  245 +++
>  tests/tst-socket-timestamp.cc         |  162 ++
>  tests/tst-tcp-v6.cc                   |  240 ++-
>  106 files changed, 43912 insertions(+), 874 deletions(-)
>  create mode 100644 bsd/sys/compat/linux/linux_netlink.cc
>  create mode 100644 bsd/sys/compat/linux/linux_netlink.h
>  create mode 100644 bsd/sys/netinet/icmp6.h
>  create mode 100644 bsd/sys/netinet/ip6.h
>  create mode 100644 bsd/sys/netinet6/dest6.cc
>  create mode 100644 bsd/sys/netinet6/frag6.cc
>  create mode 100644 bsd/sys/netinet6/icmp6.cc
>  create mode 100644 bsd/sys/netinet6/in6.cc
>  create mode 100644 bsd/sys/netinet6/in6_cksum.cc
>  create mode 100644 bsd/sys/netinet6/in6_ifattach.cc
>  create mode 100644 bsd/sys/netinet6/in6_ifattach.h
>  create mode 100644 bsd/sys/netinet6/in6_mcast.cc
>  create mode 100644 bsd/sys/netinet6/in6_pcb.cc
>  create mode 100644 bsd/sys/netinet6/in6_pcb.h
>  create mode 100644 bsd/sys/netinet6/in6_proto.cc
>  create mode 100644 bsd/sys/netinet6/in6_rmx.cc
>  create mode 100644 bsd/sys/netinet6/in6_src.cc
>  create mode 100644 bsd/sys/netinet6/in6_var.h
>  create mode 100644 bsd/sys/netinet6/ip6_forward.cc
>  create mode 100644 bsd/sys/netinet6/ip6_id.cc
>  create mode 100644 bsd/sys/netinet6/ip6_input.cc
>  create mode 100644 bsd/sys/netinet6/ip6_ipsec.cc
>  create mode 100644 bsd/sys/netinet6/ip6_ipsec.h
>  create mode 100644 bsd/sys/netinet6/ip6_mroute.cc
>  create mode 100644 bsd/sys/netinet6/ip6_mroute.h
>  create mode 100644 bsd/sys/netinet6/ip6_output.cc
>  create mode 100644 bsd/sys/netinet6/ip6_var.h
>  create mode 100644 bsd/sys/netinet6/ip6protosw.h
>  create mode 100644 bsd/sys/netinet6/mld6.cc
>  create mode 100644 bsd/sys/netinet6/mld6.h
>  create mode 100644 bsd/sys/netinet6/mld6_var.h
>  create mode 100644 bsd/sys/netinet6/nd6.cc
>  create mode 100644 bsd/sys/netinet6/nd6.h
>  create mode 100644 bsd/sys/netinet6/nd6_nbr.cc
>  create mode 100644 bsd/sys/netinet6/nd6_rtr.cc
>  create mode 100644 bsd/sys/netinet6/pim6.h
>  create mode 100644 bsd/sys/netinet6/pim6_var.h
>  create mode 100644 bsd/sys/netinet6/raw_ip6.cc
>  create mode 100644 bsd/sys/netinet6/raw_ip6.h
>  create mode 100644 bsd/sys/netinet6/route6.cc
>  create mode 100644 bsd/sys/netinet6/scope6.cc
>  create mode 100644 bsd/sys/netinet6/scope6_var.h
>  create mode 100644 bsd/sys/netinet6/send.cc
>  create mode 100644 bsd/sys/netinet6/send.h
>  create mode 100644 bsd/sys/netinet6/tcp6_var.h
>  create mode 100644 bsd/sys/netinet6/udp6_usrreq.cc
>  create mode 100644 bsd/sys/netinet6/udp6_var.h
>  create mode 100644 include/api/netinet/__icmp6.h
>  create mode 100644 include/api/netinet6/__in6.h
>  create mode 100644 libc/network/netlink.c
>  create mode 100644 libc/network/netlink.h
>  create mode 100644 modules/cloud-init/network-module.cc
>  create mode 100644 modules/cloud-init/network-module.hh
>  create mode 100644 tests/tst-pktinfo.cc
>  create mode 100644 tests/tst-socket-timestamp.cc
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to