public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected], [email protected],
	[email protected], [email protected], [email protected],
	[email protected], [email protected]
Cc: Pavel Begunkov <[email protected]>
Subject: [PATCH net-next 1/2] net/tcp: don't peek at tail for io_uring zc
Date: Mon, 15 May 2023 17:06:36 +0100	[thread overview]
Message-ID: <d49262a8a39c995cd55f89d1f6fd39cd4346f528.1684166247.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Move tcp_write_queue_tail() to SOCK_ZEROCOPY specific flag as zerocopy
setup for msghdr->ubuf_info doesn't need to peek into the last request.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 net/ipv4/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4d6392c16b7a..40f591f7fce1 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1229,13 +1229,12 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 	flags = msg->msg_flags;
 
 	if ((flags & MSG_ZEROCOPY) && size) {
-		skb = tcp_write_queue_tail(sk);
-
 		if (msg->msg_ubuf) {
 			uarg = msg->msg_ubuf;
 			net_zcopy_get(uarg);
 			zc = sk->sk_route_caps & NETIF_F_SG;
 		} else if (sock_flag(sk, SOCK_ZEROCOPY)) {
+			skb = tcp_write_queue_tail(sk);
 			uarg = msg_zerocopy_realloc(sk, size, skb_zcopy(skb));
 			if (!uarg) {
 				err = -ENOBUFS;
-- 
2.40.0


  reply	other threads:[~2023-05-15 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 16:06 [PATCH net-next 0/2] minor tcp io_uring zc optimisations Pavel Begunkov
2023-05-15 16:06 ` Pavel Begunkov [this message]
2023-05-15 17:27   ` [PATCH net-next 1/2] net/tcp: don't peek at tail for io_uring zc David Ahern
2023-05-15 18:11     ` Eric Dumazet
2023-05-15 16:06 ` [PATCH net-next 2/2] net/tcp: optimise io_uring zc ubuf refcounting Pavel Begunkov
2023-05-15 17:29   ` David Ahern
2023-05-15 18:14     ` Eric Dumazet
2023-05-15 18:40       ` David Ahern
2023-05-16 12:59         ` Pavel Begunkov
2023-05-16 14:37           ` David Ahern
2023-05-16 17:46             ` Pavel Begunkov
2023-05-17  7:40 ` [PATCH net-next 0/2] minor tcp io_uring zc optimisations 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=d49262a8a39c995cd55f89d1f6fd39cd4346f528.1684166247.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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