Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4117061imm; Mon, 30 Jul 2018 08:57:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBMW2+zszCSJEcg0IEqJIPC16JfaxbQfa7OClUlzNPBWN/2HiURyQ9CW16TzAqRcU1QM1r X-Received: by 2002:a17:902:7898:: with SMTP id q24-v6mr16517512pll.222.1532966273262; Mon, 30 Jul 2018 08:57:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532966273; cv=none; d=google.com; s=arc-20160816; b=LMID6CAUCEvscbyJ+H+pyYwABFPIv+8wYr79D4DZI6tYaZtuFi9mj2cckeJJXNmD0q qSInwpSF7mOhUZIQaNdPY4prhyjgCYHno3papGEMy/w3ZlaoTRZHN+3ABTgnZdHdINsU s/mcQ8Ij3y+yrApg15i++n75tD/cYCJk1mm1zIeP3GRdmhjCTTSrirC4nGBk91+lQ15Y RciigHCr+Tr4zxSswLQJDvqqTJzKX4jHKfOSGDJYHqgyXFj9+GglCx48Y1RZQWqFXW+A Q71vj6ob6xSDNpg/42Litz5uPlm2TNaeHgLHlps0Fx0jzBgDv70oWTTWYgTe0B67W8R2 kaDw== 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 :arc-authentication-results; bh=ElJjk5oiPMLdMkEMLgXEVW93Kmm2P8oEmyOBlRwuYvU=; b=DdodugEFtabyPeXYTDeOhKnRLjc7PVj3Rrtjnjd1zifJVLPQpKeHQ3JDP89MSStvI7 1yjfdRyOOC0Y8N2cvxpniKfTz29eA11+xOU1P4Yhqr2NtUq1a+PdxrPvX9A7kmbgjKo8 DZGJZ2im97dzjdTdGwfbtDGn2+QZ5j8uzYoBpOwqlGfngALLPLPTbx1KhTLI6PngF/13 8V1jj3Re0wjIyYSnaSE0JYhQ+ZAESiyBCWMUyGsRSxAPKbH4hCOyyGFMFkzMT8NmKU/S O0mv5Ti6xzTEorsaLt6i5gTFrHWuPz+67wjzyXSy+sYv1B/v4LswqN1E4jL+KX9JqKKq Yq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YqUtja3k; 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 x11-v6si9730815pln.130.2018.07.30.08.57.38; Mon, 30 Jul 2018 08:57:53 -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=YqUtja3k; 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 S1726916AbeG3RcY (ORCPT + 99 others); Mon, 30 Jul 2018 13:32:24 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:55007 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbeG3RcY (ORCPT ); Mon, 30 Jul 2018 13:32:24 -0400 Received: by mail-it0-f68.google.com with SMTP id s7-v6so17918002itb.4 for ; Mon, 30 Jul 2018 08:56:47 -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=ElJjk5oiPMLdMkEMLgXEVW93Kmm2P8oEmyOBlRwuYvU=; b=YqUtja3kk0/jxy+KmwM7yAko8JCH40saV3YxBw+UagVE5NqWBXPt1GwNrukyGQNeJm ipPET7zPZDZWR6eCoHWgSWFuKSYidynCYIbkdtmQPFNb2IjmwgIyrejs4cFQNNjm1j3G 1zN3F4hAwOgTQh+xCN48chJ5R8MYoiSe1qBVu3WO9hjSafuMxDHmUVhAHpuwcjtbrHSo sCM3I26a/BzMzxdNVYjsWK5fRdGWDM+KTmvEoohU94D0dOTHEMvr/DytGWTR5DILppaP mek2OlINXDXZpv8j+Yek9kpsdrknwmVugXsKnSFhWCJlru8eF4ep3oLsSEAzbDA8Rgit 4nhQ== 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=ElJjk5oiPMLdMkEMLgXEVW93Kmm2P8oEmyOBlRwuYvU=; b=DS1mC2mKA2f3leqtdWRQdEZGkkNfNn11aZnHxcxdeay3W8Y4x7CCdz3u5ahlZovBuw D+Kzbf0GLDTXOksft3LB7xe5RTq0zTb+Xzz5LHaU+gGS7/KIee1CHWbmVM0lKv6C0zpT MGB/m7MOHS6xXAM3T6c6sSjR3RKmNPOlg3Uz2kSKzU3qr3GH7ZHD0idRtjG1d3Nct4dw g/TGN7vPT9awuioCwN0HoIsiY75yw9tFdgrE6Pjw6XnyoWfjjo3BiGihDJeHV+LF5Uh3 3HKOrvCq08cIaTInndvYc7rBJyc7le5hnTrWtXs8/Oa4GiPThPUaMc6VkENnbPv4XuM0 M8/g== X-Gm-Message-State: AOUpUlE8tdERgnPdo6zhWWWTuBBu4ObU+Uruz3F99NWKh7YEt5oQ/r03 0115FQ23eWbYttKaYQRVlCcGqiKiX56OcuVxMgfXbw== X-Received: by 2002:a02:1294:: with SMTP id 20-v6mr17332008jap.141.1532966207204; Mon, 30 Jul 2018 08:56:47 -0700 (PDT) MIME-Version: 1.0 References: <1532746900-11710-1-git-send-email-laoar.shao@gmail.com> In-Reply-To: From: Eric Dumazet Date: Mon, 30 Jul 2018 08:56:35 -0700 Message-ID: Subject: Re: [PATCH net-next 1/2] tcp: call tcp_drop() in tcp collapse To: Yafang Shao , Brendan Gregg 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 Sun, Jul 29, 2018 at 10:40 PM Yafang Shao wrote: > Should we put NET_INC_STATS(sock_net(sk), mib_idx) into the funtion > tcp_drop() ? > Then we could easily relate the sk_drops with the SNMP counters. > > Something like that, > > static void tcp_drop(struct sock *sk, struct sk_buff *skb, int mib_idx) > { > int segs = max_t(u16, 1, skb_shinfo(skb)->gso_segs); > > atomic_add(segs, &sk->sk_drops); > NET_ADD_STATS(sock_net(sk), mib_idx, segs); > __kfree_skb(skb); > } We had a discussion during netconf, and Brendan Gregg was working on an idea like that, so that distinct events could be traced/reported. I prefer letting Brendan submit his patch, which not only refactors things, but add new functionality. Thanks.