Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp269452pxb; Wed, 22 Sep 2021 22:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl0+VfOxR0nL+VzoXYUIuvt6TFC1myIhE/UMIYadR4BS3GBnc+d0f8zM6mkilYYyCBpAMy X-Received: by 2002:a02:710d:: with SMTP id n13mr2360368jac.31.1632375230213; Wed, 22 Sep 2021 22:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632375230; cv=none; d=google.com; s=arc-20160816; b=yXa6yAQJkAsiEEEX/oM8zyhr/ywTie/9VSt/ZBgdzi6PqYS3PWcWhWEdqzSytOryHO RUHZO2h7SKzaUWVy8p2WnnzW98HJ/9KbZyrpnhYqe0uR0bsLIxB0TgAIwK4iyoU56WYF VkZdIbLpNEZVERgDF8pMKk824aDc/QYWhcE8ICsnmRnEQ1Y7zlbdYXw4ZTGNLPIzzvjZ qiAkGXGWqu3aP1j5LOhPC/ZHC0QEFA0J1ThZxWCVaXyM8hu+R6n4lpjYUB6qYLzTziWb pZ3fLVFZkssvw9VbofWfOIePy0Hyk10vwkyp9rW0SWdzLw7vxTf0N862tYjpMMuN1lKm dyMg== 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:mime-version :dkim-signature; bh=Cdcba7SmsaBnvzAVhyxbyNWBiBUuvNKROnvhgNMsKJM=; b=AInm58woQ6s0dckBVy+hzM5tbRzQY3fJPOfjP6XMBFPu3ceO4wThgobsmlE5ge6kmB QwCAlFb90DbuM3fMCvLpMt6Q5FB5Ll5ssZ+XZq0uAfMoTEyu4NCLxuI4H/8/bh4bBX62 P/HeLPvj7aQQZnWflZj8otfZU7aAhUk4TDMMGJb7TX150Nl6D3j+kOrCTVNl7mJkjt+X G7r+rCEOhfkyhyEIXmvldHS6iwd4QU6b39ABZrSCLmCPRpZQJJlUChIKmaNFd8gn1C3L Pm/QLGcuM4kf5uqHSSB1y4+Beo7vUaN1nxaqCsEM8ZY9XSZt79nqtfLpbTahcrt1zXo7 zFNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BhmG73pT; 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 s9si6469530ilu.57.2021.09.22.22.33.37; Wed, 22 Sep 2021 22:33:50 -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=BhmG73pT; 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 S234629AbhIWFdI (ORCPT + 99 others); Thu, 23 Sep 2021 01:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbhIWFdE (ORCPT ); Thu, 23 Sep 2021 01:33:04 -0400 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E35C061574; Wed, 22 Sep 2021 22:31:33 -0700 (PDT) Received: by mail-il1-x136.google.com with SMTP id h20so5321329ilj.13; Wed, 22 Sep 2021 22:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=Cdcba7SmsaBnvzAVhyxbyNWBiBUuvNKROnvhgNMsKJM=; b=BhmG73pTzmdTi3MdptPCpIQtiYHD2b1OzG3cWhKz9rm9C3L1WakyEtzikkXaStr20r fuNqgspcBO0VBref6gI588dwEdtVSRwweVCWUvrERpwgZPNzjZPgntqHX2EfBcJDT/fW iTfimtCA5MpNwEjVOJZC4w5AkaKM69iuPEX1roE9cJxOl8fVm1dPDsMc7JQKGlfntpDv rjwq/EUwjnhdF2Ky0AgOe5fJ8Pz6LOXiOScd+jOCD3fZI7XvzoElZ4QH1HMZukZtzvys BxeLlbUdqWiKozEW44I0TkLX04BCc02dgMEgRxTrVIZO0CoUhNZXW9pLM1Nn/IUo4NRK Pgiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Cdcba7SmsaBnvzAVhyxbyNWBiBUuvNKROnvhgNMsKJM=; b=czAMVZ1LWd+E4dOlfwsJiThVWOEdVZ0k1P7Bk0+VgccihivqUHBVkl7jISTOW/WIFN dlRnV65LULr4+W8AreHSOrqoqmU4l2l6kyvZwiusiqsDVNzBKva0cHvMdw5J9kPPHg9l 3B3k/Pc086jg+rHYAmeS9bHx7DX6K3L+g3yaig+y4+ZAil4UX8jwpBIhqhshgk6DoJYS m5IpQI4PMHnMjoGlMoIcY1TaEtKm1UCrEGALljVXSgOgKFy/sE72gkA542ux5qDEyzZf aocFesr7Kipacxe5dCRkbu6LLf6BAhBZnEUPfsiFjjmNntRzc+tMsKs+A0nBErbstaJu wntw== X-Gm-Message-State: AOAM531jyZzCnt5sj9/XZ3snMxT9EvzTyoHAXy+6vJQnfCoUkjZF0KfP xPUsMVh0KzsU7PFvqfaoG659uW3iomm0cJRsKho= X-Received: by 2002:a92:8707:: with SMTP id m7mr2135116ild.177.1632375092923; Wed, 22 Sep 2021 22:31:32 -0700 (PDT) MIME-Version: 1.0 From: Zhongya Yan Date: Thu, 23 Sep 2021 13:31:21 +0800 Message-ID: Subject: Re: [PATCH] tcp: tcp_drop adds `SNMP` and `reason` parameter for tracing To: Cong Wang Cc: Eric Dumazet , Steven Rostedt , Brendan Gregg , netdev , LKML , Jakub Kicinski , Ingo Molnar , David Miller , Hideaki YOSHIFUJI , David Ahern , Yonghong Song , Zhongya Yan <2228598786@qq.com> Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Sep 2021 23:08:15 -0400 Cong Wang wrote: > I think you fail to explain why only TCP needs it? Thanks for the suggestion, I will rewrite the description document. > This should be useful for all kinds of drops, not just TCP, therefore > you should consider extending net/core/drop_monitor.c instead of > just tcp_drop(). Currently, I'll look at the code in `net/core/drop_monitor.c` later because it only extends tcp. > Also, kernel does not have to explain it in strings, those SNMP > counters are already available for user-space, so kernel could > just use SNMP enums and let user-space interpret them. In many > cases, you are just adding strings for those SNMP enums. > > Thanks. Since these drops are hardly hot path, why not simply use a string ? An ENUM will not really help grep games. --Eric Dumazet I think `Eric`s point is correct, so strings are used. SNMP is auxiliary, I can remove it if you find it unfriendly