From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f66.google.com ([209.85.160.66]:42414 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbeBST5V (ORCPT ); Mon, 19 Feb 2018 14:57:21 -0500 Received: by mail-pl0-f66.google.com with SMTP id 31so6168283ple.9 for ; Mon, 19 Feb 2018 11:57:21 -0800 (PST) From: Eric Dumazet To: "David S . Miller" Cc: netdev , Neal Cardwell , Yuchung Cheng , Soheil Hassas Yeganeh , Eric Dumazet , Oleksandr Natalenko , Eric Dumazet Subject: [PATCH net-next 4/6] tcp: tcp_sendmsg() only deals with CHECKSUM_PARTIAL Date: Mon, 19 Feb 2018 11:56:50 -0800 Message-Id: <20180219195652.242663-5-edumazet@google.com> In-Reply-To: <20180219195652.242663-1-edumazet@google.com> References: <20180219195652.242663-1-edumazet@google.com> Sender: netdev-owner@vger.kernel.org List-ID: We no longer have skbs with skb->ip_summed == CHECKSUM_NONE in TCP write queues. We can remove dead code in tcp_sendmsg(). Signed-off-by: Eric Dumazet --- net/ipv4/tcp.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 7c41402718876ef8adc7dc90cd51994e6a4fded9..a33539798bf61b99760b8f5923e3df14cd7400a7 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1254,14 +1254,10 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) while (msg_data_left(msg)) { int copy = 0; - int max = size_goal; skb = tcp_write_queue_tail(sk); - if (skb) { - if (skb->ip_summed == CHECKSUM_NONE) - max = mss_now; - copy = max - skb->len; - } + if (skb) + copy = size_goal - skb->len; if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) { bool first_skb; @@ -1290,7 +1286,6 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) skb_entail(sk, skb); copy = size_goal; - max = size_goal; /* All packets are restored as if they have * already been sent. skb_mstamp isn't set to @@ -1374,7 +1369,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) goto out; } - if (skb->len < max || (flags & MSG_OOB) || unlikely(tp->repair)) + if (skb->len < size_goal || (flags & MSG_OOB) || unlikely(tp->repair)) continue; if (forced_push(tp)) { -- 2.16.1.291.g4437f3f132-goog