-
Notifications
You must be signed in to change notification settings - Fork 193
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
[LibOS] Add support for SO_BROADCAST
socket option
#686
Conversation
d88c395
to
77a813d
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.
Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: ITL) (waiting on @boryspoplawski)
-- commits
line 3 at r1:
You don't make a difference between TCP (for which this option is a no-op) and UDP (for which this option is useful) in Gramine code, you just pass-through to the host and let the host decide.
Maybe add this design choice in the commit message? Because my expectation was that LibOS will do nothing if it is a TCP socket. The tradeoff in that case would be less syscalls/OCALLs but at the cost of more code lines. I can imagine we'll ask ourselves in the future why we didn't do it, and without at least a commit message (or maybe a comment in the code), our future selves be puzzled.
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.
Reviewable status: 10 of 11 files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: ITL), "fixup! " found in commit messages' one-liners (waiting on @dimakuv)
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
You don't make a difference between TCP (for which this option is a no-op) and UDP (for which this option is useful) in Gramine code, you just pass-through to the host and let the host decide.
Maybe add this design choice in the commit message? Because my expectation was that LibOS will do nothing if it is a TCP socket. The tradeoff in that case would be less syscalls/OCALLs but at the cost of more code lines. I can imagine we'll ask ourselves in the future why we didn't do it, and without at least a commit message (or maybe a comment in the code), our future selves be puzzled.
How about we add the check? :)
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), "fixup! " found in commit messages' one-liners
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.
Reviewed 10 of 11 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from maintainers (1 more required), "fixup! " found in commit messages' one-liners (waiting on @boryspoplawski)
libos/src/net/ip.c
line 320 at r2 (raw file):
case SO_BROADCAST: if (sock->type == SOCK_STREAM) { /* This option has no effect on stream oriented sockets. */
Suggestion:
stream-oriented
libos/src/sys/shim_socket.c
line 40 at r2 (raw file):
*/ struct libos_handle* get_new_socket_handle(int family, int type, int protocol,
Now we have both get_new_socket_handle()
and create_sock_handle()
, which for me are synonymous. Could you at least describe what they do in a comment, so one could notice the difference easier?
Also, sock
vs socket
in their names.
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.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from maintainers (1 more required), "fixup! " found in commit messages' one-liners (waiting on @boryspoplawski)
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.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from maintainers (1 more required), "fixup! " found in commit messages' one-liners (waiting on @mkow)
libos/src/net/ip.c
line 320 at r2 (raw file):
case SO_BROADCAST: if (sock->type == SOCK_STREAM) { /* This option has no effect on stream oriented sockets. */
Done.
libos/src/sys/shim_socket.c
line 40 at r2 (raw file):
Previously, mkow (Michał Kowalczyk) wrote…
Now we have both
get_new_socket_handle()
andcreate_sock_handle()
, which for me are synonymous. Could you at least describe what they do in a comment, so one could notice the difference easier?Also,
sock
vssocket
in their names.
I went with get_new
to match other functions we have for creating handles (which are also called get
)
I removed create_sock_handle
, it was just a simple wrapper for get_new
+ call create callback. It was not used in many places and most of them called other callbacks anyway, so I simply inlined it.
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from maintainers (1 more required), "fixup! " found in commit messages' one-liners (waiting on @mkow)
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, all discussions resolved, "fixup! " found in commit messages' one-liners
Signed-off-by: Borys Popławski <[email protected]>
f7348ca
to
1d47d50
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.
Reviewed 15 of 15 files at r4, all commit messages.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), not enough approvals from different teams (1 more required, approved so far: ITL)
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.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
Description of the changes
As in the title.
I don't think it's work adding a test for this and spam CI with UDP broadcast packets.
This change is