Skip to content
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

OS-4525 lxbrand implement getsockopt(TCP_INFO) #459

Merged
merged 20 commits into from Jan 24, 2024

Conversation

cneira
Copy link

@cneira cneira commented Nov 22, 2023

Hi,

As discussed in the mailing list, this patch adds the TCP_INFO getsockopt to the LX brand.
Tests where done in using LX image: 0bf06d4d-b62f-4b3b-b560-3cd258df2070.
Applications tested where nginx , iperf and a simple C program exercising this TCP option.
I used as reference the notes in https://smartos.org/bugview/OS-4525

Bests

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I wasn't clear... you don't just need a new macro, you need a new TABLE as well. I showed the entirety of what I had in mind.

I'll also note there's no illumos version of Linux's NEW_SYN_RECV either.

usr/src/uts/common/brand/lx/sys/lx_socket.h Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/sys/lx_socket.h Show resolved Hide resolved
Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits left, and one thing that's probably my fault with merge hell. This is looking much better.

usr/src/uts/common/brand/lx/sys/lx_socket.h Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/sys/lx_socket.h Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more nit: Please remove the ':' from your summary. It should read:

"OS-4525 lxbrand implement getsockopt(TCP_INFO)"

This should allow our Jira to synch up with this PR.

usr/src/uts/common/brand/lx/sys/lx_socket.h Show resolved Hide resolved
@danmcd
Copy link

danmcd commented Jan 16, 2024

Oh damn, one last thing... please update your copyrights to 2024.

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some more nits. Pity LX doesn't have stricter compilation flags; some of this might've been caught. If this was caused by me pressing "update branch", I apologize.

usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
@cneira cneira changed the title OS-4525: lxbrand implement getsockopt(TCP_INFO) OS-4525 lxbrand implement getsockopt(TCP_INFO) Jan 18, 2024
@cneira
Copy link
Author

cneira commented Jan 18, 2024

Found some more nits. Pity LX doesn't have stricter compilation flags; some of this might've been caught. If this was caused by me pressing "update branch", I apologize.

Done

@cneira
Copy link
Author

cneira commented Jan 18, 2024

Copyrights updated

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're going to need to put comments on every field from our tcp_t you assign to lx_tcp_info_t in the actual function. I'm seeing enough here to make me scratch my head.

usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
@cneira
Copy link
Author

cneira commented Jan 19, 2024

You're going to need to put comments on every field from our tcp_t you assign to lx_tcp_info_t in the actual function. I'm seeing enough here to make me scratch my head.

I'll add comments on how I arrived to map those fields and remove the ones that don't have the same meaning as the ones expected by Linux conventions.

Copy link

@danmcd danmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the cstyle nits and you're good to go. git pbchk is your friend as long as /opt/onbld or some version of it in your illumos build is available.

usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
usr/src/uts/common/brand/lx/syscall/lx_socket.c Outdated Show resolved Hide resolved
@danmcd
Copy link

danmcd commented Jan 23, 2024

Please make sure you re-run your tests and update any result changes here. Between that and maybe one other reviewer I'll mark IA and pull this in. Thank you for your efforts, time, and patience here.

@cneira
Copy link
Author

cneira commented Jan 24, 2024

Please make sure you re-run your tests and update any result changes here. Between that and maybe one other reviewer I'll mark IA and pull this in. Thank you for your efforts, time, and patience here.

Here are the tests I have done after the latest changes :

Linux Branded Zone

test_connect[SUCCESS] TCP state: LX_TCP_ESTABLISHED
test_connect[SUCCESS] tcpi_rto 1125000
test_connect[SUCCESS] tcpi_last_data_recv 0
test_connect[SUCCESS] tcpi_rtt 4000000
test_connect[SUCCESS] tcpi_rttvar 500000
test_connect[SUCCESS] tcpi_snd_ssthresh 0
test_connect[SUCCESS] tcpi_snd_cwnd 16360
test_connect[SUCCESS] tcpi_snd_mss 8180
test_connect[SUCCESS] tcpi_unacked -74323462
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 0
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked -74323462
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 1056768
test_connect[SUCCESS]:SOCK_STREAM NOT_CONNECTED TCP state: LX_TCP_ESTABLISHED
test_connect[SUCCESS] tcpi_rto 1125000
test_connect[SUCCESS] tcpi_last_data_recv 0
test_connect[SUCCESS] tcpi_rtt 4000000
test_connect[SUCCESS] tcpi_rttvar 500000
test_connect[SUCCESS] tcpi_snd_ssthresh 0
test_connect[SUCCESS] tcpi_snd_cwnd 0
test_connect[SUCCESS] tcpi_snd_mss 536
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 0
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 1048576
test_connect[SUCCESS]:SOCK_STREAM CONNECTED TCP state: LX_TCP_ESTABLISHED
test_connect[SUCCESS] tcpi_rto 1125000
test_connect[SUCCESS] tcpi_last_data_recv 0
test_connect[SUCCESS] tcpi_rtt 4000000
test_connect[SUCCESS] tcpi_rttvar 500000
test_connect[SUCCESS] tcpi_snd_ssthresh 0
test_connect[SUCCESS] tcpi_snd_cwnd 16360
test_connect[SUCCESS] tcpi_snd_mss 8180
test_connect[SUCCESS] tcpi_unacked -1767823445
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 0
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked -1767823445
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 1056768
test_bound[SUCCESS] BOUND tcp state: LX_TCP_LISTEN
test_bound[SUCCESS] tcpi_rto 1125000
test_bound[SUCCESS] tcpi_last_data_recv 0
test_bound[SUCCESS] tcpi_rtt 4000000
test_bound[SUCCESS] tcpi_rttvar 500000
test_bound[SUCCESS] tcpi_snd_ssthresh 0
test_bound[SUCCESS] tcpi_snd_cwnd 0
test_bound[SUCCESS] tcpi_snd_mss 536
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_pmtu 0
test_bound[SUCCESS] tcpi_total_retrans 0
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_rcv_space 1048576
test_bound[SUCCESS] LISTEN tcp state: LX_TCP_LISTEN
test_bound[SUCCESS] tcpi_rto 1125000
test_bound[SUCCESS] tcpi_last_data_recv 0
test_bound[SUCCESS] tcpi_rtt 4000000
test_bound[SUCCESS] tcpi_rttvar 500000
test_bound[SUCCESS] tcpi_snd_ssthresh 0
test_bound[SUCCESS] tcpi_snd_cwnd 0
test_bound[SUCCESS] tcpi_snd_mss 536
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_pmtu 0
test_bound[SUCCESS] tcpi_total_retrans 0
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_rcv_space 1048576

Linux Native VM

test_connect[SUCCESS] TCP state: LX_TCP_ESTABLISHED
test_connect[SUCCESS] tcpi_rto 204000
test_connect[SUCCESS] tcpi_last_data_recv 0
test_connect[SUCCESS] tcpi_rtt 50
test_connect[SUCCESS] tcpi_rttvar 25
test_connect[SUCCESS] tcpi_snd_ssthresh 2147483647
test_connect[SUCCESS] tcpi_snd_cwnd 10
test_connect[SUCCESS] tcpi_snd_mss 32732
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 65536
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 65476
test_connect[SUCCESS]:SOCK_STREAM NOT_CONNECTED TCP state: LX_TCP_CLOSE
test_connect[SUCCESS] tcpi_rto 1000000
test_connect[SUCCESS] tcpi_last_data_recv 16758308
test_connect[SUCCESS] tcpi_rtt 0
test_connect[SUCCESS] tcpi_rttvar 250000
test_connect[SUCCESS] tcpi_snd_ssthresh 2147483647
test_connect[SUCCESS] tcpi_snd_cwnd 10
test_connect[SUCCESS] tcpi_snd_mss 536
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 0
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 0
test_connect[SUCCESS]:SOCK_STREAM CONNECTED TCP state: LX_TCP_ESTABLISHED
test_connect[SUCCESS] tcpi_rto 204000
test_connect[SUCCESS] tcpi_last_data_recv 0
test_connect[SUCCESS] tcpi_rtt 40
test_connect[SUCCESS] tcpi_rttvar 20
test_connect[SUCCESS] tcpi_snd_ssthresh 2147483647
test_connect[SUCCESS] tcpi_snd_cwnd 10
test_connect[SUCCESS] tcpi_snd_mss 32741
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_pmtu 65535
test_connect[SUCCESS] tcpi_total_retrans 0
test_connect[SUCCESS] tcpi_unacked 0
test_connect[SUCCESS] tcpi_sacked 0
test_connect[SUCCESS] tcpi_rcv_space 65495
test_bound[SUCCESS] BOUND tcp state: LX_TCP_CLOSE
test_bound[SUCCESS] tcpi_rto 1000000
test_bound[SUCCESS] tcpi_last_data_recv 16758308
test_bound[SUCCESS] tcpi_rtt 0
test_bound[SUCCESS] tcpi_rttvar 250000
test_bound[SUCCESS] tcpi_snd_ssthresh 2147483647
test_bound[SUCCESS] tcpi_snd_cwnd 10
test_bound[SUCCESS] tcpi_snd_mss 536
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_pmtu 0
test_bound[SUCCESS] tcpi_total_retrans 0
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 0
test_bound[SUCCESS] tcpi_rcv_space 0
test_bound[SUCCESS] LISTEN tcp state: LX_TCP_LISTEN
test_bound[SUCCESS] tcpi_rto 0
test_bound[SUCCESS] tcpi_last_data_recv 0
test_bound[SUCCESS] tcpi_rtt 0
test_bound[SUCCESS] tcpi_rttvar 0
test_bound[SUCCESS] tcpi_snd_ssthresh 0
test_bound[SUCCESS] tcpi_snd_cwnd 10
test_bound[SUCCESS] tcpi_snd_mss 0
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 10
test_bound[SUCCESS] tcpi_pmtu 0
test_bound[SUCCESS] tcpi_total_retrans 0
test_bound[SUCCESS] tcpi_unacked 0
test_bound[SUCCESS] tcpi_sacked 10
test_bound[SUCCESS] tcpi_rcv_space 0

There are still differences for example in tcpi_unacked we return a negative value, Linux returns 0.

@danmcd danmcd merged commit 80cb3c4 into TritonDataCenter:master Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants