netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederik Deweerdt <deweerdt.lkml@gmail.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: David.Laight@ACULAB.COM, davem@davemloft.net,
	dhowells@redhat.com, edumazet@google.com, horms@kernel.org,
	jdamato@fastly.com, kuba@kernel.org,
	linux-kernel@vger.kernel.org, mhal@rbox.co,
	netdev@vger.kernel.org, pabeni@redhat.com,
	stable@vger.kernel.org, xiyou.wangcong@gmail.com
Subject: Re: [PATCH v2 net] splice: do not checksum AF_UNIX sockets
Date: Tue, 10 Dec 2024 08:10:22 -0800	[thread overview]
Message-ID: <Z1hn7p4T7_NTVbzN@xiberoa> (raw)
In-Reply-To: <20241210081721.66479-1-kuniyu@amazon.com>

On Tue, Dec 10, 2024 at 05:17:21PM +0900, Kuniyuki Iwashima wrote:
> From: Frederik Deweerdt <deweerdt.lkml@gmail.com>
> Date: Mon, 9 Dec 2024 21:06:48 -0800
> > 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: stable@vger.kernel.org
> > Signed-off-by: Frederik Deweerdt <deweerdt.lkml@gmail.com>
> > Fixes: 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")
> > ---
> 
> For the future submission, it would be nice to explain changes
> between versions and add the old patch link under '---' here.
> 
Will do, thank you.

> The patch itself looks good to me.
> 
> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
> 

Thanks!
Frederik
> >  net/unix/af_unix.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > 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) {
> > -- 
> > 2.44.1

  reply	other threads:[~2024-12-10 16:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  5:06 [PATCH v2 net] splice: do not checksum AF_UNIX sockets Frederik Deweerdt
2024-12-10  8:17 ` Kuniyuki Iwashima
2024-12-10 16:10   ` Frederik Deweerdt [this message]
2024-12-10 16:12 ` Eric Dumazet
2024-12-10 16:28 ` Joe Damato
2024-12-12  4:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1hn7p4T7_NTVbzN@xiberoa \
    --to=deweerdt.lkml@gmail.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhal@rbox.co \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).