From patchwork Mon Feb 25 10:33:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 1047662 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cUHuClym"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 447JG94Q6Kz9s6w for ; Mon, 25 Feb 2019 21:34:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbfBYKeG (ORCPT ); Mon, 25 Feb 2019 05:34:06 -0500 Received: from mail-pl1-f181.google.com ([209.85.214.181]:42704 "EHLO mail-pl1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfBYKeF (ORCPT ); Mon, 25 Feb 2019 05:34:05 -0500 Received: by mail-pl1-f181.google.com with SMTP id s1so4302439plp.9 for ; Mon, 25 Feb 2019 02:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6eqgbVzfbeostRs5zJ47WsuzZPvsQlrqs6sP0vIQU6o=; b=cUHuClymBYU0kVuY/wUr0PXLzaufHNhW3X1l/5e5b+5VQJGY9MlECz1CDG/Vdy7uZa RAV+Kf+TZWtV+vuxdJIasfO8mQ9h2INrNTsOChtaIcpIMG9y35yj0tWDtfUB/atqkJ+/ pEDtj1Xzm4mXBNbV1GSqBYkEXH8mmMb5d8OyicHRBiTWi9n/5cBcxUv2zcb3YwhVGoSx uzSAnPbGveF+xctha5t4Id3NZH713/ZOfvrN2aLFxmOnwk6EKo0IKFJmiYUlbrSaeWyR HXriDQEKYassSK8y0YPj845RGmi7xFwiuEpaXeJdI0NCKAf1VdDK7hcU3iFCHgeerPOC iPyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6eqgbVzfbeostRs5zJ47WsuzZPvsQlrqs6sP0vIQU6o=; b=LI7dYtD2JP5nGpDuPSAs1ETwgYdCHTUxNSZClKerQJz2UG8azHXyJHHtAKtQPG5BxE LSL+DUkqoe5CAs6Ew9r9PlRTnmirJHkzpo+IeB81dRjyRGnwQWvgBRAs+wqgQvcmebj+ K+UlDf8L6tejysV80oR0dN4wwtr/Xt56asIIHb2FzrzKJF5TOHAG7hqAOKneaekDaTYt 81y7CiEnlyFyWXF5VYb14Qy+KCAhgO7QgEIrYnTtVFRyDMMMUmRMv3YJAguz8Ibe1GKb 4OESjnD9rMxiGHsWQ0dpWZd1hun0SOgilIrZ7ZvlFQAO/oREsGVtf7l7Yuqcg3nuR84V rFuQ== X-Gm-Message-State: AHQUAuYf8GibAtiG5+U5h2XqNF99rr/kxgYIoPJzoMD9N5CxZXTrTecL kEjrt+pje8wRRZMgmne3QxdQ4tqx/HU= X-Google-Smtp-Source: AHgI3Ib1ipu3WchR090a0nO2jdfpKo09n3KBz2aXz/Ew0fnqr3otv1trtQRj5ZOjt/PH5Ql4PTiROw== X-Received: by 2002:a17:902:2bc7:: with SMTP id l65mr13604184plb.79.1551090844715; Mon, 25 Feb 2019 02:34:04 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id s1sm10831744pgv.30.2019.02.25.02.34.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 02:34:03 -0800 (PST) From: Yafang Shao To: davem@davemloft.net Cc: netdev@vger.kernel.org, shaoyafang@didiglobal.com, Yafang Shao Subject: [PATCH] tcp: clean up SOCK_DEBUG() Date: Mon, 25 Feb 2019 18:33:48 +0800 Message-Id: <1551090828-31988-1-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Per discussion with Daniel[1] and Eric[2], these SOCK_DEBUG() calles in TCP are not needed now. We'd better clean up it. [1] https://patchwork.ozlabs.org/patch/1035573/ [2] https://patchwork.ozlabs.org/patch/1040533/ Signed-off-by: Yafang Shao --- net/ipv4/tcp_input.c | 19 +------------------ net/ipv6/tcp_ipv6.c | 2 -- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 7a027dec..6d2750e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -3595,7 +3595,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) * this segment (RFC793 Section 3.9). */ if (after(ack, tp->snd_nxt)) - goto invalid_ack; + return -1; if (after(ack, prior_snd_una)) { flag |= FLAG_SND_UNA_ADVANCED; @@ -3714,10 +3714,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_process_tlp_ack(sk, ack, flag); return 1; -invalid_ack: - SOCK_DEBUG(sk, "Ack %u after %u:%u\n", ack, tp->snd_una, tp->snd_nxt); - return -1; - old_ack: /* If data was SACKed, tag it and see if we should send more data. * If data was DSACKed, see if we can undo a cwnd reduction. @@ -3731,7 +3727,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_xmit_recovery(sk, rexmit); } - SOCK_DEBUG(sk, "Ack %u before %u:%u\n", ack, tp->snd_una, tp->snd_nxt); return 0; } @@ -4432,13 +4427,9 @@ static void tcp_ofo_queue(struct sock *sk) rb_erase(&skb->rbnode, &tp->out_of_order_queue); if (unlikely(!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))) { - SOCK_DEBUG(sk, "ofo packet was already received\n"); tcp_drop(sk, skb); continue; } - SOCK_DEBUG(sk, "ofo requeuing : rcv_next %X seq %X - %X\n", - tp->rcv_nxt, TCP_SKB_CB(skb)->seq, - TCP_SKB_CB(skb)->end_seq); tail = skb_peek_tail(&sk->sk_receive_queue); eaten = tail && tcp_try_coalesce(sk, tail, skb, &fragstolen); @@ -4502,8 +4493,6 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFOQUEUE); seq = TCP_SKB_CB(skb)->seq; end_seq = TCP_SKB_CB(skb)->end_seq; - SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n", - tp->rcv_nxt, seq, end_seq); p = &tp->out_of_order_queue.rb_node; if (RB_EMPTY_ROOT(&tp->out_of_order_queue)) { @@ -4779,10 +4768,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) if (before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { /* Partial packet, seq < rcv_next < end_seq */ - SOCK_DEBUG(sk, "partial packet: rcv_next %X seq %X - %X\n", - tp->rcv_nxt, TCP_SKB_CB(skb)->seq, - TCP_SKB_CB(skb)->end_seq); - tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, tp->rcv_nxt); /* If window is closed, drop tail of packet. But after @@ -5061,8 +5046,6 @@ static int tcp_prune_queue(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); - SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq); - NET_INC_STATS(sock_net(sk), LINUX_MIB_PRUNECALLED); if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index e51cda7..57ef69a1 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -220,8 +220,6 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, u32 exthdrlen = icsk->icsk_ext_hdr_len; struct sockaddr_in sin; - SOCK_DEBUG(sk, "connect: ipv4 mapped\n"); - if (__ipv6_only_sock(sk)) return -ENETUNREACH;