Data structure to fix slow write/append to files on ramfs

2018-08-06 Thread Waldek Kozaczuk
I am planning to take a stab at fixing https://github.com/cloudius-systems/osv/issues/884. As explained in the issue, possible solution would require data structure supporting efficient read from and write to the file as well as memory allocation. One candidate is std::deque. Another

[PATCH 06/16] bsd: Added IPv6 net channel support

2018-08-06 Thread Charles Myers
classifier changed to object pointer instead of embedded in struct ifnet to reduce compile dependencies. There was also issue with including ip6.h in this file, but that could probably be fixed with struct ip6_hdr forward delcaration and including in6.h instead. Signed-off-by: Charles Myers ---

[PATCH 12/16] bsd: Fix SIOCSIFNAME when using linux compatiblity socket

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- bsd/sys/compat/linux/linux_ioctl.cc | 37 + 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/bsd/sys/compat/linux/linux_ioctl.cc b/bsd/sys/compat/linux/linux_ioctl.cc index 43a50bb..d49386d 100644 ---

[PATCH 10/16] libc: Fix if_indextoname(), if_nametoindex()

2018-08-06 Thread Charles Myers
Use AF_INET instead of AF_UNIX Signed-off-by: Charles Myers --- libc/network/if_indextoname.c | 2 +- libc/network/if_nametoindex.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/network/if_indextoname.c b/libc/network/if_indextoname.c index e7f526d..edda5f0 100644

[PATCH 08/16] bsd: OSv API support for IPv6

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- bsd/porting/networking.cc | 178 +- bsd/porting/networking.hh | 8 +++ bsd/porting/route.cc | 86 ++ bsd/sys/netinet/in.cc | 10 +++ bsd/sys/netinet/in.h | 1 + loader.cc

[PATCH 09/16] bsd: Added partial Linux NETLINK socket support

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- Makefile | 1 + bsd/net.cc| 5 + bsd/sys/compat/linux/linux_netlink.cc | 904 ++ bsd/sys/compat/linux/linux_netlink.h | 175 +++ bsd/sys/compat/linux/linux_socket.cc

[PATCH 14/16] cloud-init: Added support for Network v1 and ConfigDrive data source

2018-08-06 Thread Charles Myers
https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html Currently only interface naming, static IP, routes and DNS are supported. Signed-off-by: Charles Myers --- modules/cloud-init/Makefile | 2 +- modules/cloud-init/main.cc | 77 +---

[PATCH 15/16] bsd: Added unit tests for IPv6 TCP, IP_PKTINFO, IPV6_PKTINFO, SCM_TIMESTAMP

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- modules/tests/Makefile| 16 ++- tests/tst-pktinfo.cc | 245 ++ tests/tst-socket-timestamp.cc | 162 tests/tst-tcp-v6.cc | 240

[PATCH 16/16] bsd: Added conf-INET6 option to enable IPv6 support

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- Makefile | 27 ++- bsd/net.cc | 23 +++- bsd/porting/netport.h| 4 +++ bsd/sys/dev/xen/netfront/netfront.cc | 4 +++ conf/base.mk | 5

[PATCH 11/16] libc: Add IPv6 support to getifaddrs(), if_nameindex() using NETLINK socket

2018-08-06 Thread Charles Myers
libc code is from musl library with minor change to prevent partial reads if faster than sender. Signed-off-by: Charles Myers --- Makefile| 1 + libc/network/getifaddrs.c | 392 libc/network/if_nameindex.c | 136

[PATCH 13/16] bsd: linux socket support for IPv6, IP_PKTINFO, IPV6_PKTINFO, SCM_TIMESTAMP

2018-08-06 Thread Charles Myers
l_size_t in linux.h was not correct size for 64-bit long Signed-off-by: Charles Myers --- bsd/sys/compat/linux/linux.h | 12 +- bsd/sys/compat/linux/linux_socket.cc | 727 ++- bsd/sys/compat/linux/linux_socket.h | 101 -

[PATCH 07/16] bsd: Modifications to shared IPv4/IPv6 code (eth,tcp,udp) for IPv6

2018-08-06 Thread Charles Myers
lltable_foreach(), lltable_foreach_lle() added to support NETLINK sockets Signed-off-by: Charles Myers --- bsd/sys/net/if_ethersubr.cc | 5 ++--- bsd/sys/net/if_llatbl.cc| 47 ++--- bsd/sys/net/if_llatbl.h | 13

[PATCH 03/16] bsd: Renamed IPv6 files from *.c to *.cc

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- bsd/sys/netinet6/{dest6.c => dest6.cc} | 0 bsd/sys/netinet6/{frag6.c => frag6.cc} | 0 bsd/sys/netinet6/{icmp6.c => icmp6.cc} | 0 bsd/sys/netinet6/{in6.c => in6.cc} | 0 bsd/sys/netinet6/{in6_cksum.c

[PATCH 04/16] bsd: Modify FreeBSD IPv6 .h files for OSv

2018-08-06 Thread Charles Myers
Signed-off-by: Charles Myers --- bsd/sys/netinet/icmp6.h | 2 + bsd/sys/netinet/ip6.h | 93 +-- bsd/sys/netinet6/in6.h| 125 +++ bsd/sys/netinet6/in6_pcb.h| 30 bsd/sys/netinet6/in6_var.h| 170

[PATCH 00/16] OSv IPv6 support

2018-08-06 Thread Charles Myers
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. All parts should compile and test without issues, but IPv6 is only enabled with the last

Re: [PATCH] Implemented multiboot mode

2018-08-06 Thread Nadav Har'El
On Mon, Aug 6, 2018 at 6:17 PM, Nadav Har'El wrote: > > Oh, I found the problem. It is OSv's bug, on the way we define uint64_t > (we define it ourselves, we don't use gcc's headers): > In: > > include/api/x64/bits/alltypes.h.sh:TYPEDEF unsigned long uint64_t; > > This is incorrect for

Re: [PATCH] Implemented multiboot mode

2018-08-06 Thread Nadav Har'El
On Tue, Jul 31, 2018 at 9:08 PM, Waldek Kozaczuk wrote: > When possible, it's a worthy goal to have a kernel and usr.img which can >> work for all platforms (xen, qemu, qemu-with-kernel, etc.) and we don't >> need >> to recompile for each different cloud platform. I didn't fully understand >> if

Re: [RFC] Optimize bootfs memory utilization

2018-08-06 Thread Waldek Kozaczuk
Thanks. So fundamentally you think this patch is OK? Even possible memory misalligment is not a big deal? On Monday, August 6, 2018 at 10:48:46 AM UTC-4, Nadav Har'El wrote: > > > On Wed, Aug 1, 2018 at 7:48 AM, Waldemar Kozaczuk > wrote: > >> This patch optimizes RAM utilization of bootfs by

Re: [RFC] Optimize bootfs memory utilization

2018-08-06 Thread Nadav Har'El
On Wed, Aug 1, 2018 at 7:48 AM, Waldemar Kozaczuk wrote: > This patch optimizes RAM utilization of bootfs by > eliminating unnecessary copy of data. It does so by > pointing created file nodes to existing data offset in memory > which is part of area where kernel is copied after decompression. >