-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support BESS protocol (for UML) #281
Conversation
a6527b3
to
dbf96f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with BESS but the code LGTM
Just left two minor comments
if (argc - optind < 2) { | ||
goto error; | ||
} | ||
if (argc - optind > 2) { | ||
// not an error, for preventing potential compatibility issue | ||
printf("WARNING: too many arguments\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this go to stderr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have been using stdout or printing WARNING messages (why? 😅 )
Lines 563 to 604 in f2ae176
case _DEPRECATED_NO_HOST_LOOPBACK: | |
// There was no tagged release with support for --no-host-loopback. | |
// So no one will be affected by removal of --no-host-loopback. | |
printf("WARNING: --no-host-loopback is deprecated and will be " | |
"removed in future releases, please use " | |
"--disable-host-loopback instead.\n"); | |
/* FALLTHROUGH */ | |
case DISABLE_HOST_LOOPBACK: | |
options->disable_host_loopback = true; | |
break; | |
case _DEPRECATED_CREATE_SANDBOX: | |
// There was no tagged release with support for --create-sandbox. | |
// So no one will be affected by removal of --create-sandbox. | |
printf("WARNING: --create-sandbox is deprecated and will be " | |
"removed in future releases, please use " | |
"--enable-sandbox instead.\n"); | |
/* FALLTHROUGH */ | |
case ENABLE_SANDBOX: | |
options->enable_sandbox = true; | |
break; | |
case ENABLE_SECCOMP: | |
printf("WARNING: Support for seccomp is experimental\n"); | |
options->enable_seccomp = true; | |
break; | |
case NETNS_TYPE: | |
optarg_netns_type = optarg; | |
break; | |
case USERNS_PATH: | |
optarg_userns_path = optarg; | |
if (access(optarg_userns_path, F_OK) == -1) { | |
fprintf(stderr, "userns path doesn't exist: %s\n", | |
optarg_userns_path); | |
goto error; | |
} | |
break; | |
case 'a': | |
optarg_api_socket = optarg; | |
break; | |
case '6': | |
options->enable_ipv6 = true; | |
printf("WARNING: Support for IPv6 is experimental\n"); | |
break; |
main.c
Outdated
} | ||
|
||
/* Accept a connection, and send its connection to the parent */ | ||
printf("Waiting for connection to %s\n", bess_socket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are using both stdout and stderr for diagnostic messages. Should we just stick to stderr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
BESS protocol transferrs L2 packets as AF_UNIX SOCK_SEQPACKET . BESS protocol has been used by the vector network interfaces of User Mode Linux (UML). ``` (terminal 1) $ slirp4netns --target-type=bess /tmp/bess.sock (terminal 2) $ linux.uml vec0:transport=bess,dst=/tmp/bess.sock,depth=128,gro=1 root=/dev/root rootfstype=hostfs init=/bin/bash mem=2G (terminal 2: UML)$ ip addr add 10.0.2.100/24 dev vec0 (terminal 2: UML)$ ip link set vec0 up (terminal 2: UML)$ ip route add default via 10.0.2.2 ``` More docs about the User Mode Linux with BESS socket transport: https://www.kernel.org/doc/html/latest/virt/uml/user_mode_linux_howto_v2.html#bess-socket-transport Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
😢 |
Use git://git.qemu.org/libslirp.git instead of https://gitlab.freedesktop.org/slirp/libslirp.git temporarily Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
BESS protocol transferrs L2 packets as AF_UNIX SOCK_SEQPACKET .
BESS protocol has been used by the vector network interfaces of User Mode Linux (UML).
More docs about the User Mode Linux with BESS socket transport: https://www.kernel.org/doc/html/latest/virt/uml/user_mode_linux_howto_v2.html#bess-socket-transport