quic: enable UDP GRO

Closes #14012
This commit is contained in:
Tatsuhiro Tsujikawa 2024-06-25 18:51:03 +09:00 committed by Daniel Stenberg
parent 411af83010
commit a571afc02e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 102 additions and 11 deletions

View file

@ -35,6 +35,9 @@
#elif defined(HAVE_NETINET_TCP_H)
#include <netinet/tcp.h>
#endif
#ifdef HAVE_NETINET_UDP_H
#include <netinet/udp.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
@ -1852,6 +1855,9 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
{
struct cf_socket_ctx *ctx = cf->ctx;
int rc;
int one = 1;
(void)one;
/* QUIC needs a connected socket, nonblocking */
DEBUGASSERT(ctx->sock != CURL_SOCKET_BAD);
@ -1892,6 +1898,13 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
}
#endif
}
#if defined(UDP_GRO) && (defined(HAVE_SENDMMSG) || defined(HAVE_SENDMSG)) && \
((defined(USE_NGTCP2) && defined(USE_NGHTTP3)) || defined(USE_QUICHE))
(void)setsockopt(ctx->sock, IPPROTO_UDP, UDP_GRO, &one,
(socklen_t)sizeof(one));
#endif
return CURLE_OK;
}