Skip to content

Commit f1063cb

Browse files
committed
Increase GRO segments to 64
Unless the sender and the receiver agree on the exact size of the datagrams they're going to exchange, there's no way to know the GRO segment size before calling recvmmsg(). This makes it impossible to calculate how big the receive buffer should be before calling recvmmsg(), potentially leading to truncated segments if it isn't a multiple of the GRO segment size. Bumping gro::gro_segments() to the max allowed by the kernel (UDP_GRO_CNT_MAX = 64), and assuming that get_max_udp_payload_size() is a valid upper bound for incoming datagrams, ensures that the receive window we allocate is always large enough.
1 parent 29d3932 commit f1063cb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

quinn-udp/src/unix.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ mod gro {
645645
};
646646

647647
if rc != -1 {
648-
10
648+
// As defined in net/ipv4/udp_offload.c
649+
// #define UDP_GRO_CNT_MAX 64
650+
64
649651
} else {
650652
1
651653
}

0 commit comments

Comments
 (0)