Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1537362pxb; Sat, 4 Sep 2021 13:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9UnzVfBr+sx7kY5a/JXckornvm1VI5mDnkWFmcnU0R6GyDPw2TlFpX/hMbQEcZJsh8vD7 X-Received: by 2002:a05:6602:2c0f:: with SMTP id w15mr4267291iov.106.1630785783659; Sat, 04 Sep 2021 13:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630785783; cv=none; d=google.com; s=arc-20160816; b=wfpUyI6DsD6PJ0L5hWwIcwVLib4FaioHnVNfU0VZnnMcNkICEjX0gHXvc3cboDsVF2 poL/85gJHMJ/i71Zrm/o1Izz0X65KlOhPOhWAVdm1lRdcduYjDHBivacD2NHrerS6KIE 9yiWQNqltOV9u8axzTV2vnnYLYt5LnfQNwtFEzP0Get65IiX4nz6yZnygUGnv3h4Vd29 NyU9IMT00TejyQOBTpICO2dnWp39XKBC+rHqrbVbyzfdI4w6GRfLLAa40t2tp0mHENUC nLZyJwbTIkh49h3a3tswtR+ahZt5DobmgvbAnDH0EfoOiktezPdN3lSYGJBLasLF8NRj ZSpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AXbeTtMqMo/aTKvuZLDXQ5FW3yxo+iy3ryaN538FkdU=; b=y7VLzQryjilVGbPvtnmoAYLMTWMSMMAw0ml3E5RhEGVA+YeEwZtuQEhmc+RC4bkjhK tV3Lmb5M1sL1PIwP5J/3xZhIb7BnhqDKEBONbeNJx5gRKaAHM50zNkbMw4fvtYVZPoP9 +RBShYDbbijKg1M7slIDhsuhv7NUracoUdBlmnwoRBhGK3O2NkMGhXtGJm10RqCLQ/9A KEP974l8Xk44/787cYQmxL/XsmAggx+ZyW1Gxv8tgRqv3jOvwzLUfLz4CctRmhzVxMa3 SymqJ5A7YCLAP7fLSx8TUaKzgPx7/5iBKBxGf1WrxfYNaxNXN7meQN1qJIQlO2q4up51 vs2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y33EIXrx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id y12si3751106ilu.84.2021.09.04.13.02.51; Sat, 04 Sep 2021 13:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y33EIXrx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230346AbhIDTFT (ORCPT + 99 others); Sat, 4 Sep 2021 15:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237371AbhIDTFS (ORCPT ); Sat, 4 Sep 2021 15:05:18 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30944C061575; Sat, 4 Sep 2021 12:04:16 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so1751601pjc.3; Sat, 04 Sep 2021 12:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AXbeTtMqMo/aTKvuZLDXQ5FW3yxo+iy3ryaN538FkdU=; b=Y33EIXrxjIWeT4h/+5Rjxa9BzxRmMJCuUJldNJIwe5HPlLs7Dn8ci/hHdqRqpA4Jrp WlVs5T9CSr3ls0p+BtC+8XNkHHAGRg45XWaQfNVSdQHwcdQe0yRE8Dv3bdH3EYx1NxFf nkFFskT9xPc/vT3S7wAI5OC+Pa4kgGxWrsYrCBSth4PxQLYCFCIfneFvz0wTyyuyKZKa yuj4uUy4gGVE+gNAJ50kOJ4lBMLtO+0fm2c9iesuRy/OBEatz67Q+f4TX8a7xdIFXHHQ r2B2LbWUDmnOIYh7mQCDcskln+NyHdBr0fLcSnrzoq37I03Ph7zTmY8PVW6zZAhzMMD2 nnKg== 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=AXbeTtMqMo/aTKvuZLDXQ5FW3yxo+iy3ryaN538FkdU=; b=Z/bgSRuqkwt8MWw4dOSeoelQbQOZUwwbHFSHL4zTKpX8dDJGmWo87e8eDfI/Doe9dH zTEvD/nNpkt64/mdJzIk44mOVxhVP+NqNB26Bxw2KPBremDIebJ59HmmxCBcj9lseqrD Rsp4sQuBfFGf2In/BH+4vPu+O+YmDtkLBtw8LP596sNY0A3XZ6gvWfCv7gdvujvLd7YI Jl4gQ4RGAjzicKqgGf23elICCbF94ho9VBmUzXm6tYUNcZs1wvt5hwz0IG5gjz+VUbx2 dVYF+Q7UrNVukgvBRiUetX3YBXO409cralEnqYJgrAbAXotuMJW5Kr2PbxTo3+czb3nW Gd/g== X-Gm-Message-State: AOAM530eN4O6E+yLiEFzrGnwHIFeZRh8efCqyeVsc/jI/fUpkiAfkROl fsf1Qlu2f3l8dSP6SNBKR1xOOiKQAYPpEEp0sXo= X-Received: by 2002:a17:902:c408:b0:138:e3df:e999 with SMTP id k8-20020a170902c40800b00138e3dfe999mr4030391plk.30.1630782255546; Sat, 04 Sep 2021 12:04:15 -0700 (PDT) MIME-Version: 1.0 References: <20210904064044.125549-1-yan2228598786@gmail.com> In-Reply-To: <20210904064044.125549-1-yan2228598786@gmail.com> From: Cong Wang Date: Sat, 4 Sep 2021 12:04:04 -0700 Message-ID: Subject: Re: [PATCH] net: tcp_drop adds `reason` and SNMP parameters for tracing v4 To: Zhongya Yan Cc: Eric Dumazet , Linux Kernel Network Developers , LKML , Jakub Kicinski , Steven Rostedt , Ingo Molnar , David Miller , Hideaki YOSHIFUJI , dsahern@kernel.org, hengqi.chen@gmail.com, Yonghong Song , Brendan Gregg , 2228598786@qq.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 3, 2021 at 11:43 PM Zhongya Yan wrote: > > I used the suggestion from `Brendan Gregg`. In addition to the > `reason` parameter there is also the `field` parameter pointing > to `SNMP` to distinguish the `tcp_drop` cause. I know what I > submitted is not accurate, so I am submitting the current > patch to get comments and criticism from everyone so that I > can submit better code and solutions.And of course to make me > more familiar and understand the `linux` kernel network code. Any reason why only limit this to TCP? I am pretty sure we are interested in packet drops across the entire stack. You can take a look at net/core/drop_monitor.c, it actually has a big advantage over your solution, which is sending entire dropped packets to user-space for inspection. If you can have a solution for all packet drops, not just TCP, it would make your patch much more useful. Therefore, I'd suggest you to consider extending the drop monitor. Thanks.