From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuchung Cheng Subject: [PATCH net 2/3] tcp: fix SNMP under-estimation on failed retransmission Date: Wed, 28 Nov 2018 16:06:44 -0800 Message-ID: <20181129000645.163425-3-ycheng@google.com> References: <20181129000645.163425-1-ycheng@google.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org, edumazet@google.com, ncardwell@google.com, Yuchung Cheng To: davem@davemloft.net Return-path: Received: from mail-pf1-f195.google.com ([209.85.210.195]:43688 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbeK2LKt (ORCPT ); Thu, 29 Nov 2018 06:10:49 -0500 Received: by mail-pf1-f195.google.com with SMTP id w73so53703pfk.10 for ; Wed, 28 Nov 2018 16:07:25 -0800 (PST) In-Reply-To: <20181129000645.163425-1-ycheng@google.com> Sender: netdev-owner@vger.kernel.org List-ID: Previously the SNMP counter LINUX_MIB_TCPRETRANSFAIL is not counting the TSO/GSO properly on failed retransmission. This patch fixes that. Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Signed-off-by: Neal Cardwell --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index c5dc4c4fdadd..87bd1c61f4bf 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2929,7 +2929,7 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs) TCP_SKB_CB(skb)->sacked |= TCPCB_EVER_RETRANS; trace_tcp_retransmit_skb(sk, skb); } else if (err != -EBUSY) { - NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL); + NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPRETRANSFAIL, segs); } return err; } -- 2.20.0.rc0.387.gc7a69e6b6c-goog