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

Change the CXPLAT LARGE IO BUFFER SIZE to 0xFFE3 on unix platforms. #4556

Merged
merged 4 commits into from
Sep 24, 2024

Conversation

noah-hwang
Copy link
Contributor

Description

Sendmsg always returns its length parameter, indicating success. With messages greater than 65507 (0xFFE3) bytes, it returns a Message too long error, corresponding error code EOVERFLOW.
Payload size calculate: 65535 - 8 (UDP header) - 20 (IP header) = 65507 bytes.
Therefore the size of the IO Buffer should be less than or equal to 65507 bytes.

Online discussion of related issues
https://stackoverflow.com/questions/11809727/sendto-returns-values-greater-than-mtu-on-sock-dgram-udp-socket

Describe the purpose of and changes within this Pull Request.

Testing

Do any existing tests cover this change? Are new tests needed?

Documentation

Is there any documentation impact for this change?

@noah-hwang noah-hwang requested a review from a team as a code owner September 23, 2024 12:36
@nibanks nibanks added OS: Ubuntu external Proposed by non-MSFT Bug: Platform A code bug in platform/TLS specific code. labels Sep 23, 2024
@nibanks
Copy link
Member

nibanks commented Sep 23, 2024

Thanks so much for finding/fixing this bug!

@@ -33,8 +33,9 @@ CXPLAT_STATIC_ASSERT((SIZEOF_STRUCT_MEMBER(QUIC_BUFFER, Buffer) == sizeof(void*)

//
// The maximum single buffer size for coalesced IO payloads.
// Payload size: 65535 - 8 (UDP header) - 20 (IP header) = 65507 bytes.
Copy link
Member

Choose a reason for hiding this comment

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

What happens for IPv6? Its header size is bigger. We can use this for the pool allocation size, but should we be returning a different max size to actually use when doing IPv6?

Copy link
Contributor Author

@noah-hwang noah-hwang Sep 24, 2024

Choose a reason for hiding this comment

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

Refer to this article
https://blog.cloudflare.com/virtual-networking-101-understanding-tap/
Payload size: 65507 bytes for IPv4(without options and padding field) and 65527 for IPv6(Payload length field no include IP header)
Perhaps a more rigorous modification is needed here.

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.79%. Comparing base (9c4dceb) to head (b3a7b1a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4556      +/-   ##
==========================================
- Coverage   87.20%   86.79%   -0.41%     
==========================================
  Files          56       56              
  Lines       17354    17354              
==========================================
- Hits        15134    15063      -71     
- Misses       2220     2291      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nibanks nibanks merged commit 44ff05a into microsoft:main Sep 24, 2024
469 of 471 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Platform A code bug in platform/TLS specific code. external Proposed by non-MSFT OS: Ubuntu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants