Skip to content

Conversation

@devnexen
Copy link
Member

UDP segmentation offload is an optimisation attempt by sending multiple large enough datagrams over UDP which reduces syscalls as by default, they have to be broke down in small UDP packets, it is better if the hardware supports it, other handed down to the software implementation.

devnexen added 2 commits April 2, 2025 19:16
UDP segmentation offload is an optimisation attempt by sending multiple large enough datagrams over UDP which reduces syscalls as by default, they have to be broke down in small UDP packets, it is better if the hardware supports it, other handed down to the software implementation.
@devnexen devnexen force-pushed the socket_udp_segment branch from 6edeb94 to 0d040dd Compare April 2, 2025 18:51
@devnexen devnexen marked this pull request as ready for review April 2, 2025 20:24
@devnexen devnexen requested a review from kocsismate as a code owner April 2, 2025 20:24
@devnexen devnexen marked this pull request as draft April 2, 2025 20:44
@devnexen devnexen marked this pull request as ready for review April 3, 2025 22:30
}
#endif

#if defined(UDP_SEGMENT)
Copy link
Member

Choose a reason for hiding this comment

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

This option is only valid for level==SOL_UDP, right? If so, don't we need to check that in this case too?

Copy link
Member Author

Choose a reason for hiding this comment

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

errno is set in this case.

$src = socket_create(AF_UNIX, SOCK_DGRAM, 0); var_dump(socket_setopt($src, SOL_TCP, UDP_SEGMENT, 2)); var_dump(socket_strerror(socket_last_error()));
Warning: socket_setopt(): Unable to set socket option [95]: Operation not supported in /home/dcarlier/Contribs/php-src/a.php on line 3 bool(false) string(23) "Operation not supported"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment