QUIC: added support for segmentation offloading.

To improve output performance, UDP segmentation offloading is used
if available.  If there is a significant amount of data in an output
queue and path is verified, QUIC packets are not sent one-by-one,
but instead are collected in a buffer, which is then passed to kernel
in a single sendmsg call, using UDP GSO.  Such method greatly decreases
number of system calls and thus system load.
This commit is contained in:
Vladimir Homutov
2021-07-15 14:22:00 +03:00
parent 105de9762f
commit c0764bc3e9
3 changed files with 262 additions and 11 deletions

View File

@@ -281,6 +281,27 @@ if [ $ngx_found = yes ]; then
fi
# UDP_SEGMENT socket option is used for segmentation offloading
ngx_feature="UDP_SEGMENT"
ngx_feature_name="NGX_HAVE_UDP_SEGMENT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <stdint.h>
#include <netinet/udp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(int);
int val;
getsockopt(0, SOL_UDP, UDP_SEGMENT, &val, &optlen)"
. auto/feature
if [ $ngx_found = yes ]; then
UDP_SEGMENT_FOUND=YES
have=NGX_HAVE_UDP_SEGMENT . auto/have
fi
# ngx_quic_bpf module uses sockhash to select socket from reuseport group,
# support appeared in Linux-5.7:
#