Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1911018imm; Sun, 9 Sep 2018 11:29:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYpYmabGV6e1gjkybL4xuYowzlJXbjqeEI/aj2xIDRG3lj/IjMbMNFXfoScTSq7pnQcCaNB X-Received: by 2002:a62:9349:: with SMTP id b70-v6mr19770731pfe.193.1536517746631; Sun, 09 Sep 2018 11:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536517746; cv=none; d=google.com; s=arc-20160816; b=RqkNMSGAEUKJZn7udAEUFNwnVT8j2SyfxhyhVMaiCLHKI1dlKCEdUoRnpCow7DmOnv eeoc7nFuBMAKQQs6rzaN7GKvK1nJf9EZyv44cgwTZb23iuDChD1arIxbMwF3so5C46xA 68712y+v/qhZQRuSj4wMQO2eJlswgD8InPkewQVQCRtNxLVMQzpfuG1rHeV+HKZlbQfR HmtvJ/zfWeHT4G2GsUXWppPQJEp0YLm4X+QzeNHeLqY2XA3EnsTbI4pnJrrcosxBn8Sk Wp0G5/0nK2PgWZ2jyGIA0HEncegUjcI50N+AHxmGQydMG84+p7cdw3nOt4M1+iWGNKwJ 5N/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=y43LSYpZCq8Hj7FQIK4BOw1AmFi1AHv1zjETebM6JYI=; b=zbTgZIYRrqaWxB/u65Gkb2Du4QODvSy20Nv1CPnVEz5Kndj0EZIhBPHlUFb2C656OT sH5hcY8DSriOnj2QH5oHb5lnRQboaN66GPk4JoDRsqSd0elT/R2z+rWHOmHOIcKDfNrb +I7J2TT5GKwgSSt08i5m055aeW74o+eY3EdOBas05QcJHoFHnmA6mYVQSg85nVuSm54u 4mJMoSStGdb1CDpE+RCiKoHRqBRq7jU/WFrwJnwlIAnm4WAIrHWc6gXVNFZzvmNSLVba pXlk0mGYBuFj4pW4Ewfwx8ldzuuraWPIzW74xRULYeVguOOUIx8wy8VtuKardIWJU3yz pj3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="j5xgwX/6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p65-v6si15325482pga.401.2018.09.09.11.28.49; Sun, 09 Sep 2018 11:29:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="j5xgwX/6"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727441AbeIIXSF (ORCPT + 99 others); Sun, 9 Sep 2018 19:18:05 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:45255 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbeIIXSE (ORCPT ); Sun, 9 Sep 2018 19:18:04 -0400 Received: by mail-io1-f67.google.com with SMTP id e12-v6so5243784iok.12 for ; Sun, 09 Sep 2018 11:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y43LSYpZCq8Hj7FQIK4BOw1AmFi1AHv1zjETebM6JYI=; b=j5xgwX/61ilXCzwFoqMzYhHwdzZs547znAKy/BT7nIadm5L0If9WsUtxMINwdbcL2u pWfJZNGxzm1zNnbQrz3P7jw7tu3HVgolFLtyHg2kokh1HQzeh/OGnXVAf7/3welIes9X vziH7PQ3zOyHuD5NajfekmZHoO0Tef2KQLgInjNzqiUNJfszyDFHUhWBXA/mOEzwwGM/ qcTeN2k5abt9OId89okWJfTt2MIyMicihsxA3rsknkHu/uor390ovH4RqskfnDh/R12H kNxckRZfxnmrr2iiGV11jDfPNMFkmuJVercEMJscnxQtaM6cX2alHa2Wj5TXoYqqYzXf OOWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y43LSYpZCq8Hj7FQIK4BOw1AmFi1AHv1zjETebM6JYI=; b=nXIFdI8R4GQmBdfFwU3bwpNmH6XYCu44go6SE0azjOG8bwkyyNyj91YSqiPynYHWVf Vi46gNnKP+YCbBPjJzECWDFsrU8NJ/IsYlGH2Dk4QT1/PvCoIWDOVCL6vNKYMK0/K9S2 I0rXimDvAildylkAEGY2aXHJqqQt2UtZoYABUv0lq5oX+pSYAvjr+c6EPhBHppal1aTy i5iHDQqujdN3VBPTGubdViWkkoZdmdqiflxsY9RMHfKuX8hpfXLjp25FW3VCoGmXajP4 ZgSUUtEZdjkaWDV33ZJ2Z/TMpCgryfNUlLBYlbryyinhjPvkCeSyckwMN5l1nt/Eideg wZ3A== X-Gm-Message-State: APzg51BKbxpsQnDcbHPEpTCzLQpdjynLWysHnw/sR7UJjRX4YrTcLsZY aIa7Rl0IroiL0DzCHFA5NHciKPN34HySRrGIE2Bv5g== X-Received: by 2002:a6b:5a01:: with SMTP id o1-v6mr14739433iob.73.1536517653618; Sun, 09 Sep 2018 11:27:33 -0700 (PDT) MIME-Version: 1.0 References: <1536462862-11767-1-git-send-email-laoar.shao@gmail.com> In-Reply-To: <1536462862-11767-1-git-send-email-laoar.shao@gmail.com> From: Eric Dumazet Date: Sun, 9 Sep 2018 11:27:22 -0700 Message-ID: Subject: Re: [PATCH v2 net-next 1/2] tcp: show number of network segments in some SNMP counters To: Yafang Shao Cc: David Miller , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 8, 2018 at 8:14 PM Yafang Shao wrote: > > It is better to show the number of network segments in bellow SNMP > counters, because that could be more useful for the user. > For example, the user could easily figure out how mant packets are > dropped and how many packets are queued in the out-of-oder queue. > > - LINUX_MIB_TCPRCVQDROP > - LINUX_MIB_TCPZEROWINDOWDROP > - LINUX_MIB_TCPBACKLOGDROP > - LINUX_MIB_TCPMINTTLDROP > - LINUX_MIB_TCPOFODROP > - LINUX_MIB_TCPOFOQUEUE > > Signed-off-by: Yafang Shao > --- > net/ipv4/tcp_input.c | 18 ++++++++++++------ > net/ipv4/tcp_ipv4.c | 9 ++++++--- > net/ipv6/tcp_ipv6.c | 6 ++++-- > 3 files changed, 22 insertions(+), 11 deletions(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 62508a2..c2ce334 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -4496,7 +4496,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) > tcp_ecn_check_ce(sk, skb); > > if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) { > - NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP); > + NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP, > + max_t(u16, 1, skb_shinfo(skb)->gso_segs)); > I am nacking this patch. These counters are counting events really.