netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net-next 1/7] tcp: remove dead code from tcp_sendmsg_locked()
Date: Wed, 27 Oct 2021 13:19:17 -0700	[thread overview]
Message-ID: <20211027201923.4162520-2-eric.dumazet@gmail.com> (raw)
In-Reply-To: <20211027201923.4162520-1-eric.dumazet@gmail.com>

From: Eric Dumazet <edumazet@google.com>

TCP sendmsg() no longer puts payload in skb head, we can remove
dead code.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/tcp.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index d0b848ff5c0f1f7c34cea1b178b700c264893724..4053ace0cd76fbf076e422017fa31a472f00d7ba 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1309,14 +1309,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 		if (copy > msg_data_left(msg))
 			copy = msg_data_left(msg);
 
-		/* Where to copy to? */
-		if (skb_availroom(skb) > 0 && !zc) {
-			/* We have some space in skb head. Superb! */
-			copy = min_t(int, copy, skb_availroom(skb));
-			err = skb_add_data_nocache(sk, skb, &msg->msg_iter, copy);
-			if (err)
-				goto do_fault;
-		} else if (!zc) {
+		if (!zc) {
 			bool merge = true;
 			int i = skb_shinfo(skb)->nr_frags;
 			struct page_frag *pfrag = sk_page_frag(sk);
@@ -1416,7 +1409,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 
 do_error:
 	skb = tcp_write_queue_tail(sk);
-do_fault:
 	tcp_remove_empty_skb(sk, skb);
 
 	if (copied + copied_syn)
-- 
2.33.0.1079.g6e70778dc9-goog


  reply	other threads:[~2021-10-27 20:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 20:19 [PATCH net-next 0/7] tcp: tx side cleanups Eric Dumazet
2021-10-27 20:19 ` Eric Dumazet [this message]
2021-10-27 20:19 ` [PATCH net-next 2/7] tcp: cleanup tcp_remove_empty_skb() use Eric Dumazet
2021-10-27 20:19 ` [PATCH net-next 3/7] tcp: remove dead code from tcp_collapse_retrans() Eric Dumazet
2021-10-27 20:19 ` [PATCH net-next 4/7] tcp: no longer set skb->reserved_tailroom Eric Dumazet
2021-10-27 20:19 ` [PATCH net-next 5/7] tcp: factorize ip_summed setting Eric Dumazet
2021-10-27 20:19 ` [PATCH net-next 6/7] tcp: do not clear skb->csum if already zero Eric Dumazet
2021-10-27 20:19 ` [PATCH net-next 7/7] tcp: do not clear TCP_SKB_CB(skb)->sacked " Eric Dumazet
2021-10-28 12:20 ` [PATCH net-next 0/7] tcp: tx side cleanups 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=20211027201923.4162520-2-eric.dumazet@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).