From patchwork Sat Feb 16 16:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yafang Shao X-Patchwork-Id: 1043450 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="ud7bkI9w"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 441wZ92Xkdz9s3l for ; Sun, 17 Feb 2019 03:29:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731039AbfBPQ3U (ORCPT ); Sat, 16 Feb 2019 11:29:20 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:33298 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbfBPQ3T (ORCPT ); Sat, 16 Feb 2019 11:29:19 -0500 Received: by mail-pl1-f195.google.com with SMTP id y10so6512665plp.0 for ; Sat, 16 Feb 2019 08:29:19 -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:in-reply-to:references; bh=6eqgbVzfbeostRs5zJ47WsuzZPvsQlrqs6sP0vIQU6o=; b=ud7bkI9wp6qCLNXUw9CmPR4HeiGCnlZwmq7nocO5anQ3hJrAiwBNXaLQDKA3jvmweO Ac09iYpE1qhRAdoXbOSrEcvJ/+Nnc1qGxzhJniO/sYe7g71ZQCo2bBrAtZZsZizEgo5v P2xFXZDTa8tIcNAUovqDycAHjGWhI7pIBvEsyHSSqDvDh30UggDHf74ELf29QObwZA3R gbOkz6iEGHxxsVgK2J8m5uiVBh7WbL0BUVxH7QFe27xpNuuDr96HUtP6xfG5jBZdGMU4 tsQHESPDXh0yDTM2qrliSxgAqBRYNHQhmT3peWms7EVDjg8Q3Ncrp6cp1v9pSCeznBq2 Iq6g== 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:in-reply-to :references; bh=6eqgbVzfbeostRs5zJ47WsuzZPvsQlrqs6sP0vIQU6o=; b=Ihu9rb7USZtvYNDmPA5KlWCmSWnHb5NjOuO+OAQW3Pr2JXHjShAm2orYNaP7ZN72Gh tlPlUyj4HEG0cKUErebNG9EHiR8IaISHkuXMufEuvQOkxvl+LxGvlxWRhscygIQQpQ55 SKp8mLjGw+IQuQhwAWdtQBq4zurJtDOA14VjPkaZeC4/C2NYOEX1iC64YjfrR3T9w2xj Isq0O7woSFKTE0hEH9X+gEODxcsWgMFpvirJ69CUQFFY6ad8kzyMPsGh1YDImpzSNr1B gpA0MSP9k5NMDiSKLhdGVyptrcTkTTWN4RcoNcEVRcHKYCXJYH2CqXDXYO+zILUnG0qL ayGA== X-Gm-Message-State: AHQUAuYfQJFQ7Dhgfc7KyTT/ELzPpgDzT8Mb8AV/jXitLZsSWgmZr1cm yU9Z0tJpKcVT33D5R/QEU/Y= X-Google-Smtp-Source: AHgI3Ib6xpAplMqVRhEPq3hgmDlmzknpTYFDTUqdgqD8MZNI+1RJnkqq26rWx289Cs0MZ0u1eYiE+w== X-Received: by 2002:a17:902:2ec1:: with SMTP id r59mr16394714plb.254.1550334558981; Sat, 16 Feb 2019 08:29:18 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id g87sm19179201pfe.43.2019.02.16.08.29.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 08:29:18 -0800 (PST) From: Yafang Shao To: davem@davemloft.net Cc: daniel@iogearbox.net, edumazet@google.com, joe@perches.com, xiyou.wangcong@gmail.com, netdev@vger.kernel.org, shaoyafang@didiglobal.com, Yafang Shao Subject: [PATCH v2 net-next 1/2] tcp: clean up SOCK_DEBUG() Date: Sun, 17 Feb 2019 00:28:56 +0800 Message-Id: <1550334537-380-2-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1550334537-380-1-git-send-email-laoar.shao@gmail.com> References: <1550334537-380-1-git-send-email-laoar.shao@gmail.com> 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;