Skip to content

Limit UDP GSO number of segments in a message to the allowed value#2033

Merged
bmah888 merged 1 commit into
esnet:masterfrom
davidBar-On:issue-2032-limit-udp-gso-segments-in-message-to-maximum-allowed
May 14, 2026
Merged

Limit UDP GSO number of segments in a message to the allowed value#2033
bmah888 merged 1 commit into
esnet:masterfrom
davidBar-On:issue-2032-limit-udp-gso-segments-in-message-to-maximum-allowed

Conversation

@davidBar-On
Copy link
Copy Markdown
Contributor

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master 3.21+

  • Issues fixed (if any): GSO broken for a length value lower than 508 #2032

  • Brief description of code changes (suitable for use as a commit message):

Suggested fix to PR #1925 to limit the number of segments in UDP GSO message to 128, which is the maximum allowed. The problem was with messages length 507 or less, as 507 is the maximum length where MAX_UDP_BLOCKSIZE/length >= 129.

The limit GSO_MAX_DG_IN_BF is defined as a constant as I didn't find a reliable way to determine it dynamically. From what I found, the value is defined in Linux as UDP_MAX_SEGMENTS. Although it seems that in some (newer?) Linux distributions it is defined in udp.h, as in here, at least in WSL Linux that I use it is not defined in a header file, and probably it is defined in udpgso.c like in here.

@abajk
Copy link
Copy Markdown

abajk commented May 2, 2026

Now it works fine even with the minimum UDP packet size :D

@bmah888
Copy link
Copy Markdown
Contributor

bmah888 commented May 9, 2026

Thanks for the PR! This looks pretty reasonable (I haven't done any testing).

Copy link
Copy Markdown
Contributor

@bmah888 bmah888 left a comment

Choose a reason for hiding this comment

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

I was able to successfully reproduce the original (broken) behavior of #2032 without the patch, and verified that data actually gets sent and recorded with the patch. Looks good to me!

@bmah888 bmah888 linked an issue May 14, 2026 that may be closed by this pull request
@bmah888 bmah888 merged commit 1199ad0 into esnet:master May 14, 2026
7 checks passed
@bmah888 bmah888 self-assigned this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GSO broken for a length value lower than 508

3 participants