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

mptcp: sockopt: add coverage for TCP_CORK and TCP_NODELAY #75

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

darkwrat
Copy link

@darkwrat darkwrat commented Nov 25, 2021

Add coverage for new socket options that allow changing behavior of
Nagle's algorithm on MPTCP sockets.

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Closes: multipath-tcp/mptcp_net-next#243
Signed-off-by: Maxim Galaganov max@internet.ru

@darkwrat darkwrat force-pushed the mptcp-nagle branch 2 times, most recently from dc5a1c5 to 596a544 Compare November 25, 2021 11:53
@darkwrat
Copy link
Author

Sorry for the force-push, fixed wrong email in signoff and commit author.

Copy link
Member

@matttbe matttbe left a comment

Choose a reason for hiding this comment

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

Hi Maxim,

Sorry for the delay!

Thank you for looking at that, it looks really good!

Here I have a couple of questions but the main one is: do we need the test with multiple paths to validate the modifications you did on the kernel side?

gtests/net/mptcp/sockopts/sockopt_cork_nodelay.pkt Outdated Show resolved Hide resolved
+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0

+0.0 < addr[caddr0] > addr[saddr0] S 0:0(0) win 65535 <mss 1460, sackOK, TS val 4074410674 ecr 0, nop, wscale 8, mpcapable v1 flags[flag_h] nokey>
Copy link
Member

Choose a reason for hiding this comment

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

if you don't need to use multiple subflows, you can remove addr[caddr0] > addr[saddr0] (and spaces below), that will be easier to read :)

+0.0 > . 1:1(0) ack 3 <nop, nop, TS val 4074418293 ecr 4074418292, dss dack8=3 dll=0 nocs>
+0.0 read(4, ..., 2) = 2

// more inbound data and MP_PRIO to flip active -> backup
Copy link
Member

Choose a reason for hiding this comment

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

why do you need this?

Copy link
Author

Choose a reason for hiding this comment

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

Will be removed, part of C&P from mptcp/mp_prio/mp_prio_server.pkt after I tried flipping active->backup myself and failed. :) Wanted to see setsockopt affecting multiple subflows.

+0.0 read(4, ..., 10) = 10

// check that TCP_CORK was cloned from listener
+0.0 getsockopt(4, SOL_TCP, TCP_CORK, [1], [4]) = 0
Copy link
Member

Choose a reason for hiding this comment

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

if you move this getsockopt() call to the test with a single flow, do you think we still need this "multi" test?

I mean: that's good to check with multiple subflows but I'm not sure we are covering more code with it. Or do we?

Copy link
Author

Choose a reason for hiding this comment

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

I really wanted for the subflow loop in setsockopt to spin a couple of times, just to double-check that I have correct locking and change the right sockets. I also was toying a bit with packetdrill to gain some understanding. Now I agree that this doesn't add any meaningful coverage, thank you for pointing this out. WIll remove the multi test.

Copy link
Member

Choose a reason for hiding this comment

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

👍 Good idea to play a bit with Packetdrill. This is a nice tool but not always easy to use :)

+0.05 write(4, ..., 40) = 40

// clearing TCP_CORK should push pending bytes out
+0.01 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
Copy link
Member

Choose a reason for hiding this comment

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

detail about the call side: may you add one more space after each time to have at least two spaces between the time and the next column?
While at it, the two <nop, below are not aligned with all the others :)

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review!
Could you tell me if the commit adressing all the changes should be force-pushed, or just it will be squashed on merge?

Copy link
Member

Choose a reason for hiding this comment

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

Please force-push your new version to keep only "good commits". Even if it is not as good as with Gerrit, we can easily see the differences between two force-pushed versions on Github so that side is not an issue :)

darkwrat added a commit to darkwrat/packetdrill that referenced this pull request Nov 29, 2021
Remove mptcp/sockopts/sockopt_cork_multi.pkt
Move getsockopt check to mptcp/sockopts/sockopt_cork_nodelay.pkt
Make whitespace more consistent
Add comment about the original tcp script

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Link: multipath-tcp#75
Signed-off-by: Maxim Galaganov <max@internet.ru>
darkwrat added a commit to darkwrat/packetdrill that referenced this pull request Nov 29, 2021
Add coverage for new socket options that allow changing behavior of
Nagle's algorithm on MPTCP sockets.

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Link: multipath-tcp#75
Signed-off-by: Maxim Galaganov <max@internet.ru>
matttbe pushed a commit to darkwrat/packetdrill that referenced this pull request Nov 29, 2021
Add coverage for new socket options that allow changing behavior of
Nagle's algorithm on MPTCP sockets.

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Link: multipath-tcp#75
Signed-off-by: Maxim Galaganov <max@internet.ru>
darkwrat added a commit to darkwrat/packetdrill that referenced this pull request Nov 29, 2021
Add coverage for new socket options that allow changing behavior of
Nagle's algorithm on MPTCP sockets.

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Link: multipath-tcp#75
Signed-off-by: Maxim Galaganov <max@internet.ru>
@matttbe
Copy link
Member

matttbe commented Nov 29, 2021

I just did a very small modification related to the code style, nothing important ;-)

https://github.com/multipath-tcp/packetdrill/compare/942f5c80692f39f34d17413b453341e8563e3d5b..59748675db076726c7c94179fd2cbe13b02cf537

I hope you don't mind!

Everything OK on my side. We can merge this once the kernel side has been modified as well.

Add coverage for new socket options that allow changing behavior of
Nagle's algorithm on MPTCP sockets.

Link: https://lore.kernel.org/mptcp/20211123070708.2897469-1-max@internet.ru/T/
Link: multipath-tcp#75
Signed-off-by: Maxim Galaganov <max@internet.ru>
@matttbe
Copy link
Member

matttbe commented Nov 29, 2021

(good catch for the setsockopt(), I missed this one, I just updated my version with your fix ;-) )

@matttbe matttbe self-requested a review November 29, 2021 16:21
@matttbe
Copy link
Member

matttbe commented Nov 29, 2021

I'm applying the linked patches in mptcp_net-next repo, we can then merge this new test!

Thank you for your work!

@matttbe matttbe merged commit 93e2c3a into multipath-tcp:mptcp-net-next Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants