Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4566433imm; Mon, 30 Jul 2018 17:50:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGwbfv8kBddQJfHoBJizWPJ7GBaXhJPmxalHuwd1/8qKKztjDXz9ZnCSJksLlCpuOpn1ml X-Received: by 2002:a17:902:a508:: with SMTP id s8-v6mr18647714plq.223.1532998232210; Mon, 30 Jul 2018 17:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532998232; cv=none; d=google.com; s=arc-20160816; b=roWLKdtntqFyUDBKi8X/Xg92gVE0zJkuhcZF7JfcC8wqPuaaQRsnt2JKjXQAg5GiEi EX3fpXXvCyl025xtvdGkVVTqo+kDRJdl64Amq+olgyKsv/+rSeW9n+RuH23ZUisbNfIU SzBlrauR7XfLubSxeWkszNP5o+wEkpgbWt/feGJ30nTgsBS27pPOK8jQ7tQv9O6zOthp Q04a3IZWHLI5VLDR1a9BNyq0vRzrb9gxgCRSYm+X/NxNSOVIW0+NMdknkPzvCiwMPqFV EGhBy0woEjCWKObPlekkTTNmN+jkPnqaEmqc24OQi+1eC06t4qkJKCKxWmRdAEgzzYtv ViAQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=TqnAdbkQDuh+Ktioemj6ij3zWXgjk6n72gJxc8WN4vI=; b=Aw6vBYF2aAUKD8BHC467kF4dVM1j3GSkVdS7hKDt36h3I5l3q+Pbl/ilnA2y0LM4kc yAqVJsAG390x0lvQ4UcsdMM8B30+0be1fMYvuLzK82SHgLRIKHfudBc0lAODPh0KgWsx A/+Rt+BbZQd50ZSFVL/Z9UfTOiicpsrtIBdR4lKMJwiJLFDPrkWnkRsrgKXttrYRIuqS RyhLTG5CdMjBLHpKnmbuFZX2j+sX4Rk9f4fPoiGzh2f6AWfhWhehws8IOfpharjDlNcp gxQkGmP0beGosyZaVx3rEcLJNWUfIz+uZEq4rkZttbupGYLZxlwcsZqoY5l2qjJqyME0 YXZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QY92Mm0U; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19-v6si10689268plq.236.2018.07.30.17.50.17; Mon, 30 Jul 2018 17:50:32 -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=@gmail.com header.s=20161025 header.b=QY92Mm0U; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729441AbeGaC1G (ORCPT + 99 others); Mon, 30 Jul 2018 22:27:06 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:38078 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbeGaC1G (ORCPT ); Mon, 30 Jul 2018 22:27:06 -0400 Received: by mail-io0-f194.google.com with SMTP id v26-v6so11516174iog.5; Mon, 30 Jul 2018 17:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TqnAdbkQDuh+Ktioemj6ij3zWXgjk6n72gJxc8WN4vI=; b=QY92Mm0U4VX9r3Va57V+UOYpdulFGMRNfA+W640IX/+C5s+gZ1CAYRZUMNet5Y84hJ gn46y6eXcgltMlRKB7S+6sgAFDCQ6HffP/80cLPMv2vlU/VOlsiRDbJHmr3hMWiQAMnQ lXYybSYfM9gEdXVWWRn3nni99hf4UvlNCs6OZEF0+9ByAcxESHcs0MC9znNmAd3RXZtr lG/kJ9DGbc3QNJJSbgznXv+jAQeYst1OPXbrXPtTKLYkITiQOhA0wvP94CufOEQLbTH/ q2Y2u/2zwb8eE7BY51xQ89aR58AW0Z1p5Ss7Tfcd+dIWeYGiRA59Fz0q3LYzUykqITPP bDLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TqnAdbkQDuh+Ktioemj6ij3zWXgjk6n72gJxc8WN4vI=; b=rZa/lySapM+IKDC4hA14odsaT5MbkfOQpiZh/W+LNrt1qqhgmU9K9WkDIEM1m8MakI 4RArMXuAbmJcd2MVeD2mJQ7FmbpzAtG1irjoh3xpeZF+8Wb99aNSr4POx89NFs44jwSp RtDTeh5/G0cpLJPoij32Z5ZnLf4c/nkANn9lICSjo9jFMjhPy/L9nB5u07zMwEVQCZyu xWIyDFYifmuXZ0xSVT3TC5sTfVC1zdNO/ept7t/AeZG6xtwZFg88b3UCQxko8U94RGpL E6MZNgY1pVAhLzGutkBllmBUqWYNsLQGvKCQYrh//2DA1fhHrSS4X0EJaLJId9vxPFZr DmCA== X-Gm-Message-State: AOUpUlGChTeBdMB7jDhUPdG3Ah023WYCJRNPw9vJv67cOKtEiQVuZBEY /tdNCY3rHAij/IBUHJdoe44J14b4Dij+8CRW3Ug= X-Received: by 2002:a6b:c8c8:: with SMTP id y191-v6mr15365437iof.295.1532998170089; Mon, 30 Jul 2018 17:49:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:7a47:0:0:0:0:0 with HTTP; Mon, 30 Jul 2018 17:48:49 -0700 (PDT) In-Reply-To: References: <1532746900-11710-1-git-send-email-laoar.shao@gmail.com> From: Yafang Shao Date: Tue, 31 Jul 2018 08:48:49 +0800 Message-ID: Subject: Re: [PATCH net-next 1/2] tcp: call tcp_drop() in tcp collapse To: Eric Dumazet Cc: Brendan Gregg , 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 Mon, Jul 30, 2018 at 11:56 PM, Eric Dumazet wrote: > 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. > Oh yes, introducing a new tracepoint for it should be better. trace_tcp_probe(sk, skb, mib_idx); > I prefer letting Brendan submit his patch, which not only refactors > things, but add new functionality. > OK.