diff options
| author | Frederik Deweerdt <[email protected]> | 2024-12-10 05:06:48 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-12-12 04:22:41 +0000 |
| commit | 6bd8614fc2d076fc21b7488c9f279853960964e2 (patch) | |
| tree | f126577c3b9200fd3e0af219229e0828ffaa2a16 /net/unix/af_unix.c | |
| parent | net: usb: qmi_wwan: add Telit FE910C04 compositions (diff) | |
| download | kernel-6bd8614fc2d076fc21b7488c9f279853960964e2.tar.gz kernel-6bd8614fc2d076fc21b7488c9f279853960964e2.zip | |
splice: do not checksum AF_UNIX sockets
When `skb_splice_from_iter` was introduced, it inadvertently added
checksumming for AF_UNIX sockets. This resulted in significant
slowdowns, for example when using sendfile over unix sockets.
Using the test code in [1] in my test setup (2G single core qemu),
the client receives a 1000M file in:
- without the patch: 1482ms (+/- 36ms)
- with the patch: 652.5ms (+/- 22.9ms)
This commit addresses the issue by marking checksumming as unnecessary in
`unix_stream_sendmsg`
Cc: [email protected]
Signed-off-by: Frederik Deweerdt <[email protected]>
Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Reviewed-by: Joe Damato <[email protected]>
Link: https://patch.msgid.link/Z1fMaHkRf8cfubuE@xiberoa
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
| -rw-r--r-- | net/unix/af_unix.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 001ccc55ef0f..6b1762300443 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2313,6 +2313,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, fds_sent = true; if (unlikely(msg->msg_flags & MSG_SPLICE_PAGES)) { + skb->ip_summed = CHECKSUM_UNNECESSARY; err = skb_splice_from_iter(skb, &msg->msg_iter, size, sk->sk_allocation); if (err < 0) { |
