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

WSASetUdpRecvMaxCoalescedSize is not working ! #4186

Open
1 of 4 tasks
markyang59 opened this issue Mar 11, 2024 · 8 comments
Open
1 of 4 tasks

WSASetUdpRecvMaxCoalescedSize is not working ! #4186

markyang59 opened this issue Mar 11, 2024 · 8 comments
Labels
external Proposed by non-MSFT question Further information is requested
Milestone

Comments

@markyang59
Copy link

Describe the bug

Below is a sample case

  1. packet size is set at 1420 bytes. send 6 packets 6 * 1420 = 8520 bytes sent
  2. Coalescing size is set to 1420 * 10
  3. Used IOCP for completion
  4. IOCP completion returns an actual byteio of 14200 bytes in the ideal case.
    But the problem is that the actual returned byteio size fluctuates between 1420 ~ and 14200.
  5. and at other PCs (Windows Server 2022) this value dropped to 1420 ~ 4260
  6. The real problem is not receiving packets that are dropped! not in the buffer.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

For Windows 11 above symptom does not always
But for Windows Server 2022, it always happens

MsQuic version

main

Steps taken to reproduce bug

  1. packet size is set at 1420 bytes. send 6 packets 6 * 1420 = 8520 bytes sent (with WSASetUdpSendMessageSize)
  2. Coalescing size is set to 1420 * 10 (with WSASetUdpRecvMaxCoalescedSize)
  3. Used IOCP for completion
  4. IOCP completion returns an actual byteio of 14200 bytes in the ideal case.
    But the problem is that the actual returned byteio size fluctuates between 1420 ~ and 14200.
  5. and at other PCs (Windows Server 2022) this value dropped to 1420 ~ 4260
  6. The real problem is not receiving packets that are dropped! not in the buffer.

Expected behavior

IOCP completion returns coalesced buffer 14200 for all supported OSs

Actual outcome

Only works with windows 11

Additional details

No response

@nibanks nibanks added external Proposed by non-MSFT Bug: Platform A code bug in platform/TLS specific code. labels Mar 12, 2024
@nibanks nibanks added this to the Future milestone Mar 12, 2024
@nigriMSFT
Copy link
Contributor

"The real problem is not receiving packets that are dropped! not in the buffer."
Could you explain what you mean with this statement?

Have you tried collecting logs? (I think you can use logs.ps1 with Full.Verbose profile)

In general, RX packets are coalesced opportunistically. It is not a guarantee that when WSASetUdpRecvMaxCoalescedSize is called all RX packets are coalesced to the maximum size.

@markyang59
Copy link
Author

markyang59 commented Mar 12, 2024 via email

@nibanks
Copy link
Member

nibanks commented Mar 14, 2024

Have you tried WSASendMsg? Take a look at how we use this in datapath_winuser.c.

@nibanks nibanks added question Further information is requested and removed Bug: Platform A code bug in platform/TLS specific code. labels Mar 14, 2024
@markyang59
Copy link
Author

markyang59 commented Mar 17, 2024 via email

@nibanks
Copy link
Member

nibanks commented Mar 18, 2024

USO (and URO) require ancillary data to be set, so the stack understands data is to be split among different packets. That is per-send information you must pass. I'm not sure if any other API may be used. @nigriMSFT to comment on that.

@markyang59
Copy link
Author

markyang59 commented Mar 18, 2024 via email

@nibanks
Copy link
Member

nibanks commented Mar 18, 2024

You need to set the ancillary data. Please take a look at how our datapath_winuser.c does it.

@markyang59
Copy link
Author

markyang59 commented Mar 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Proposed by non-MSFT question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants