Git Product home page Git Product logo

net-next-nuse's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

net-next-nuse's Issues

generic config interface for NUSE stack

ideas:

  1. proxy-based solution like microkernel server
    the server accept and dispatch which NUSE process is listening
  2. .conf based solution
  3. per-NUSE process UNIX domain socket (e.g., /var/run/nuse-1234-pid/RT_NETLINK)

currently, NUSEVIF (vif type) and nuse-(ifname) environmental variable is used.

epoll rework

nginx-1.6.1 crashes when epoll_wait () wakes up second time.

arch/lib/tools missing.

Hi,
I was trying to test nuse but could not compile at all. It complains that this directory is missing and attempts to fetch it while "make library ARCH=lib" fail with error:
Cloning into 'arch/lib/tools'...
remote: Counting objects: 324, done.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
make: *** [arch/lib/tools] Error 128

I would appreciate any help on this.

relax interface name restrictions

currently, all interface name of VIF needs to include a local one:
e.g.,
if
% ifconfig
lo:
eth0
p1p1:

then, vif need to be assign nuse-eth0 or nuse-p1p1.
but an interface created for tap doesn't need to be like this: this restriction should be relaxed.

NET_NS=n leads to strange program header in liblinux.so

After make defconfig ARCH=lib && make library ARCH=lib, examining liblinux.so's program headers with readelf -l shows:

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x00000000005eabf4 0x00000000005eabf4  **RWE**    200000
  LOAD           0x0000000000600000 0x0000000000800000 0x0000000000800000
                 0x000000000003b3f0 0x000000000004efe8  RW     200000
  DYNAMIC        0x000000000060f460 0x000000000080f460 0x000000000080f460
                 0x0000000000000180 0x0000000000000180  RW     8
  NOTE           0x00000000000001c8 0x00000000000001c8 0x00000000000001c8
                 0x0000000000000024 0x0000000000000024  R      4
  GNU_EH_FRAME   0x000000000057c050 0x000000000057c050 0x000000000057c050
                 0x000000000001600c 0x000000000001600c  R      4
  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     10
  GNU_RELRO      0x0000000000600000 0x0000000000800000 0x0000000000800000
                 0x0000000000011000 0x0000000000011000  R      1

 Section to Segment mapping:
  Segment Sections...
   00     .note.gnu.build-id .gnu.hash .dynsym .dynstr .rela.dyn .rela.plt .init .plt .text .init.text .sched.text .ref.text .exit.text .fini .rodata __ksymtab_strings .init.rodata .eh_frame_hdr .eh_frame

The issue is the rwx permissions on section 00. As far as I can tell, the ELF standard allows for executable regions to be writable, but this breaks some standard tools (in particular, Valgrind on amd64) and may cause very subtle bugs down the line. It will also cause issues if nuse is run on architectures with W^X protection. It is caused by a quirk of config options, and isn't necessary for the library to work.

The problem is in section .init.rodata, which has rw- permissions. The problem in .init.rodata comes from net/ipv6/{fib6_rules,addrlabel}.o and net/ipv4/{fib_rules,ipmr}.o, which all have .init.rodata sections with rw- permissions.

The problem there comes from the use of the following macros, defined in include/net/net_namespace.h:

#ifdef CONFIG_NET_NS
#define __net_init
#define __net_exit
#define __net_initdata
#define __net_initconst
#else
#define __net_init  __init
#define __net_exit  __exit_refok
#define __net_initdata  __initdata
#define __net_initconst __initconst
#endif

which depend on the macros defined in include/linux/init.h:

#define __init          __section(.init.text) __cold notrace
#define __initdata      __section(.init.data)
#define __initconst     __constsection(.init.rodata)
#define __exitdata      __section(.exit.data)
#define __exit_call     __used __section(.exitcall.exit)

It can be fixed either by changing the #ifdef CONFIG_NET_NS line in include/net/net_namespace.h to #if 1, or by adding:

config NET_NS
       def_bool y

to arch/lib/Kconfig. Then As far as I can tell, CONFIG_NET_NS=y doesn't break anything in nuse, but I haven't yet tested it thoroughly. There may be a better fix that involves changing the problematic functions annotated with __net_initconst in net/ipv6/{fib6_rules,addrlabel}.c and net/ipv4/{fib_rules,ipmr}.c --- presumably this is not intended behavior.

invalid fd number return when open(2) is used.

  • How to reproduce it
    • with raw socket

sudo NUSEDEV=eno16777736 nuse-eno16777736=192.168.209.39 ./nuse ../nginx-1.6.1/objs/nginx -c >pwd/../nginx-1.6.1/conf/nginx.conf -p ./

  • with tap

sudo NUSEDEV=eth1 NUSEVIF=TAP nuse-eth1=192.168.0.2 ./nuse nginx -c pwd/../nginx-1.6.1/conf/nginx.conf -p ./

both are closing socket for VIF, resulting no VIF channel after that (no RX/TX).

simple nuse crashes with wait_queue

TSIA.

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `ping 192.168.49.58'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __list_del (next=0x7f759c713e1a <lib_sock_poll+90>, prev=0x0) at ./include/linux/list.h:90
90              prev->next = next;
(gdb) bt
#0  __list_del (next=0x7f759c713e1a <lib_sock_poll+90>, prev=0x0) at ./include/linux/list.h:90
#1  __list_del_entry (entry=0x7fff7c482948) at ./include/linux/list.h:102
#2  list_del_init (entry=0x7fff7c482948) at ./include/linux/list.h:145
#3  autoremove_wake_function (wait=0x7fff7c482930, mode=<optimized out>, sync=<optimized out>, key=<optimized out>) at arch/lib/sched.c:173
#4  0x00007f759c714bc6 in __wake_up (q=0x1645318, mode=mode@entry=1, nr_exclusive=nr_exclusive@entry=1, key=key@entry=0xc3) at arch/lib/sched.c:242
#5  0x00007f759c714c05 in __wake_up_sync_key (q=<optimized out>, mode=mode@entry=1, nr_exclusive=nr_exclusive@entry=1, key=key@entry=0xc3) at arch/lib/sched.c:251
#6  0x00007f759c75a2a9 in sock_def_readable (sk=0x16474f8) at net/core/sock.c:2235
#7  0x00007f759c7590ed in sock_queue_rcv_skb (sk=sk@entry=0x16474f8, skb=skb@entry=0x7f75800011b8) at net/core/sock.c:474
#8  0x00007f759c7e863c in raw_rcv_skb (sk=sk@entry=0x16474f8, skb=skb@entry=0x7f75800011b8) at net/ipv4/raw.c:315
#9  0x00007f759c7e9924 in raw_rcv (sk=sk@entry=0x16474f8, skb=0x7f75800011b8) at net/ipv4/raw.c:334
#10 0x00007f759c7e9b11 in raw_v4_input (skb=skb@entry=0x7f758c0008c8, iph=0x7f758c0009e6, hash=hash@entry=1) at net/ipv4/raw.c:194
#11 0x00007f759c7e9b6c in raw_local_deliver (skb=skb@entry=0x7f758c0008c8, protocol=protocol@entry=1) at net/ipv4/raw.c:216
#12 0x00007f759c7bea99 in ip_local_deliver_finish (sk=sk@entry=0x0, skb=skb@entry=0x7f758c0008c8) at net/ipv4/ip_input.c:203
#13 0x00007f759c7bf092 in NF_HOOK_THRESH (thresh=-2147483648, okfn=0x7f759c7be9a0 <ip_local_deliver_finish>, out=0x0, in=<optimized out>, skb=0x7f758c0008c8, sk=0x0, hook=1, pf=2 '\002')
    at ./include/linux/netfilter.h:220
#14 NF_HOOK (okfn=0x7f759c7be9a0 <ip_local_deliver_finish>, out=0x0, in=<optimized out>, skb=0x7f758c0008c8, sk=0x0, hook=1, pf=2 '\002') at ./include/linux/netfilter.h:242
#15 ip_local_deliver (skb=0x7f758c0008c8) at net/ipv4/ip_input.c:256
#16 0x00007f759c7bf2f3 in NF_HOOK_THRESH (thresh=-2147483648, okfn=0x7f759c7bebd0 <ip_rcv_finish>, out=0x0, in=0x163f200, skb=0x7f758c0008c8, sk=0x0, hook=0, pf=2 '\002')
    at ./include/linux/netfilter.h:220
#17 NF_HOOK (okfn=0x7f759c7bebd0 <ip_rcv_finish>, out=0x0, in=0x163f200, skb=0x7f758c0008c8, sk=0x0, hook=0, pf=2 '\002') at ./include/linux/netfilter.h:242
#18 ip_rcv (skb=<optimized out>, dev=0x163f200, pt=<optimized out>, orig_dev=<optimized out>) at net/ipv4/ip_input.c:455
#19 0x00007f759c76d203 in __netif_receive_skb_core (skb=0x7f758c0008c8, pfmemalloc=<optimized out>) at net/core/dev.c:3895
#20 0x00007f759c76da74 in process_backlog (napi=0x7f759cc7be70 <softnet_data+112>, quota=64) at net/core/dev.c:4506
#21 0x00007f759c76d8be in napi_poll (n=0x7f759cc7be70 <softnet_data+112>, repoll=repoll@entry=0x7f759b63ce20) at net/core/dev.c:4744
#22 0x00007f759c76db98 in net_rx_action (h=<optimized out>) at net/core/dev.c:4809
#23 0x00007f759c713fe3 in do_softirq () at arch/lib/softirq.c:69
#24 0x00007f759c714048 in softirq_task_function (context=<optimized out>) at arch/lib/softirq.c:28
#25 0x00007f759c45624d in nuse_task_start_trampoline (context=0x15a6250) at nuse.c:175
#26 0x00007f759b84e182 in start_thread (arg=0x7f759b63d700) at pthread_create.c:312
#27 0x00007f759bf7d47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
  • hardware/or VM configuration (number of cpus, memory)
    • 8 cores Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz, 16G Memory
    • running Centos 6.4 final
    • running KVM to host multiple virtual guest
    • libos is on virtual guest running ubuntu 14.04.2 with 4 virtual cpus and 4G memory
  • host OS (distribution, version, kernel version)
    • KVM guest OS 4 virtual cpus, 4G memory
    • Linux ubuntu14 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
    • libos is from your github clone on kernel 4.1.0-rc7+ :
# ./nuse ping 192.168.49.254

<5>Linux version 4.1.0-rc7+ (root@ubuntu14) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #0 Wed Jun 17 12:56:11 PDT 2015
  • how to build it (only make library ARCH=lib or with OPT=no)
    • make defconfig ARCH=lib
    • make library ARCH=lib
  • how often this happens
    • once in two runs,

atexit symbol lookup error on Ubuntu 14.04

nuse-test.sh fails due to missing symbol, on Ubuntu 14.04 64bit.
Ubuntu 14.04.1 64bits works fine though.

ping: symbol lookup error: /usr/lib/libnuse-linux.so: undefined symbol: atexit

clean up codes

  • mixture of user and kernel space headers
  • duplicated prototype declaration across files
  • coding style => should be linux net-next
  • Werror compile

makefile cleanup with Kbuild

I created a dedicated topic branch for this issue.

https://github.com/libos-nuse/net-next-nuse/tree/kbuild-makefile

I'm also working to solve this issue, patches are highly appreciated !!!

the specific challenges here for LibOS to be on Kbuild system are:

reference:
http://www.spinics.net/lists/linux-mm/msg87029.html

nuse-vif batching

Problem with using NUSE with netmap

Hi, I am doing something with LibOS. And I am facing some problems which is I can't use it successfully with netmap.
When I want to test NUSE, I always meet a core dump after it shows the vif log just like this

create vif eth0
  address = 192.168.108.136
  netmask = 255.255.255.0
  macaddr = 00:0c:29:70:93:12
  type    = 1
Segmentation fault (core dumped)

My test conf as this

interface eth0
    address 192.168.108.136
    netmask 255.255.255.0
    macaddr 00:0c:29:70:93:12
#   if macaddr is not specified, random mac addr is used.
    viftype NETMAP


route
    network 192.168.108.0
    netmask 255.255.255.0
    gateway 192.168.108.2

While, I have already loaded the module netmap.ko and its driver e1000.ko

sunlifei@sunlifei-VPC:~/Documents/net-next-nuse/arch/lib/tools$ lsmod | grep netmap
netmap                114576  1 e1000

I'm confused what was wrong with my environment. Should it be something about the kenel version where I use

sunlifei@sunlifei-VPC:~/Documents/net-next-nuse/arch/lib/tools$ uname -a
Linux sunlifei-VPC 3.13.0-45-generic #1 SMP Mon Apr 27 22:00:27 CST 2015 x86_64 x86_64 x86_64 GNU/Linux

,would this matter?

QCA9887 not reply arp message

Hit this patch。
I use a wireless network card of laptop,Cannot connect to 5.8GWiFi of qca9887 with openwrt route
can get the IP address, but there is no network,but Mobile normal。

I capture wireless analysis No reply arp of station arp request。
Do you have any suggestions for me?
thanks ;

Fail to install bake.py configure -e dce-linux-1.10 Ubuntu 16.4

Hi all,

I am trying to install DCE with Linux Stack in order to execute some mmWave experiments, but I keep getting error messages. The last one failed in the addition of the following files:

In file included from rump/lib/librumpuser/rumpuser_port.h:70:0,
from rump/lib/librumpuser/rumpuser_sp.c:37:
./rump/sys/sys/cdefs.h:58:27: fatal error: machine/cdefs.h: No such file or directory

Could anyone help me?

Best regards,
José Craibas

erronet-next-muse

Can libos works with mptcp of higher versions?

I am following the manual and trying to run ns3 with mptcp kernel. And I notice that there is a branch in libos named mptcp_trunk_libos but that is a very old version of mptcp.
I am wondering if I can use a higer version of mptcp to generate the libsim_linux.so?

btw is this way here still works because I got errors when following it.

Good day ;-)

sendto from nuse process failed

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `../flowgen/flowgen -s 172.16.2.1 -d 172.16.2.2 -n 1 -l 1024 -u'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f6b24b5e6cb in memcpy (dest=0x0, src=0x603188 <flowgen+8>, count=15)
    at lib/string.c:623
623         *tmp++ = *s++;
(gdb) bt
#0  0x00007f6b24b5e6cb in memcpy (dest=0x0, src=0x603188 <flowgen+8>, count=15)
    at lib/string.c:623
#1  0x00007f6b24b27471 in sendto (fd=7, buf=0x60b1cc <flowgen+32844>, len=996, 
    flags=0, dest_addr=0x603188 <flowgen+8>, addrlen=16)
    at arch/sim/nuse-glue.c:392
#2  0x0000000000401ae5 in flowgen_udp_start () at flowgen.c:499
#3  0x0000000000402270 in main (argc=10, argv=0x7fff2617bd98) at flowgen.c:700

Fail to build mptcp_trunk_libos

Hi,

I am using ubuntu16.04 to build mptcp_trunk_libos following the wiki but fail with following error:

  CC       rump/lib/librumpuser/rumpuser_sp.o
In file included from rump/lib/librumpuser/rumpuser_port.h:70:0,
                 from rump/lib/librumpuser/rumpuser_sp.c:37:
./rump/sys/sys/cdefs.h:58:27: fatal error: machine/cdefs.h: No such file or directory
compilation terminated.
Makefile.rump:79: recipe for target 'rump/lib/librumpuser/rumpuser_sp.o' failed
make[2]: *** [rump/lib/librumpuser/rumpuser_sp.o] Error 1
Makefile:88: recipe for target 'librumpserver.so' failed
make[1]: *** [librumpserver.so] Error 2
arch/lib/Makefile:193: recipe for target 'arch/lib/tools' failed
make: *** [arch/lib/tools] Error 2

It seems that there is no such a file in my whole system. How to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.