Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp68814iof; Sun, 5 Jun 2022 21:22:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2PlDjn/ct7Kqntx9rvgAmJ04OZtwusNA1zjrSTrrzMeqBa67iqmFrT7zQtwhb2qWNdiTQ X-Received: by 2002:a65:42cc:0:b0:3a9:f71f:33f9 with SMTP id l12-20020a6542cc000000b003a9f71f33f9mr19270918pgp.391.1654489355493; Sun, 05 Jun 2022 21:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654489355; cv=none; d=google.com; s=arc-20160816; b=frSsKAOYV6DE+PJrxWldkx5XqOYHqMNic4J40/AYKmAWAfwDVU63S7QAahs3GG5e1m PWiU10LegXz3knyDGW8UO7y/f+gkg9Ur8xjk0XinsPM03/2dxejgldyFjQSkBl/sTdUy 8z0L96I5LdvNZdnzRrp1VJKpPNTch2u1JrHpZiJvNTtCtvb3rUs/PiDsAFpVtIrXaXj6 a1F9skvnxo5IBktjhNUt8ZamI7dVey7bl0v8CrNDcmjLJSDcSMFK/bRpihwIeM5d8gel OV0tab3fyq/IZyFWOXaepG3GZyM8mcGc+pjc/qRY5GqBAgMpmdLl2z+9YcczOCfm3HEF wKdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5MRSPo2LMU2au8whrm6/ap69ATqtiqPRY+8IYbaTsN4=; b=UHRDpZFgZALa/SsOuHkj9r2lg53afU8KSyRzAOZM00jrWKrzaNvOMR8jtCB9SSm3/J c7JYhF6ZusvsyGMLLZK2MuBAQd+JkGUqyrtTgfDLpkc8YT0Z7wMCA8Ct0xjFdeMNKznQ PBPNy0efw76hpA5KiN5gvBfYuaMYOdOA+Mi2P8/QmXqHh2/TuLfmW+WReo8S9aaw3yqF 0Ew0CUmlRdysNX4/EoUhHQ+EUGDMkwq9HwI4ahgZfr7Q+SH3PYo7d5U0bwVAZElYFQcs Vc8xGCOyud7uoTR6fK1nVqgl+e1KhNTDsZz1n69RQRp94vyfgbj/F3dMMlOSZ/v9TL/3 D+dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qbnz6zlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nl13-20020a17090b384d00b001d5cd19a41esi23279117pjb.38.2022.06.05.21.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qbnz6zlc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8F9B8DDCE; Sun, 5 Jun 2022 20:55:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352139AbiFFC3W (ORCPT + 99 others); Sun, 5 Jun 2022 22:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238215AbiFFC3V (ORCPT ); Sun, 5 Jun 2022 22:29:21 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 923E1205CB; Sun, 5 Jun 2022 19:29:20 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id bo5so11639799pfb.4; Sun, 05 Jun 2022 19:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5MRSPo2LMU2au8whrm6/ap69ATqtiqPRY+8IYbaTsN4=; b=Qbnz6zlcTv8r3+4N/i7vGr87pZSaOpX9C79HwHGWLzyDBus6J7G0Wzuym/1mlynGmr rSlJqUU2Xal1+QoOx/dnymJTvQUtEs6hm74OlAb/88XKQiqH2xgrVfLx8FP2b02EHNYX QFf5/g62JKNqf7Cct0X+TBGmbPOvJKLXq7590Z2DSHIygcuYKSIh/50xtucoFa2Op4lA Nt76fKvhaJlh/ElO692toyfMfwBrTF1BOZhLfuDTPHcfL2zJJFzPbOMHVjprFBzSA/3t i3OJhO28a2oryGF1qqbhzkDOlSAl/tn71+Qkr5BFaRQDVSfN+oUAMWuGWEwIgrTMQxR6 1QdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5MRSPo2LMU2au8whrm6/ap69ATqtiqPRY+8IYbaTsN4=; b=CuLnER91C/MhJNzmiWMIraG3wcvB65VjUAyEvzlOhxDqcZMk9062ji8+kSvTHvNMbB OCv8PIuysb891KYttKKiLipuSRKMYU1jm33je3WsCYsT6ROBBARaGZy3zElyCfNs1b/G VsDuk61/U/kP0WkozvvSACIpmCA4lRnsGDBN/tdO3XfTNN9flEc0BXdHQKclBeYWk4pZ X6Kj4uJX4Of4tEEZiMBUertlVaCp4bwy2c7Q5yrPeXv6HrnzgwEAk30cJh/kl0+r6YG+ 7Vwk5pMJbQlyW4EAdmFQMk295vpRMy0yknYg0NvmTpwjR6pAyFsdVn6s5OC9B07kK/uQ JUbw== X-Gm-Message-State: AOAM531xqJrqfbB8vWGS58LiteTNHaCml2uZL1eHB8NJlxXyojfD7Gxk ZEhQERrN6xTaARElNUjw9e4= X-Received: by 2002:a65:6b8a:0:b0:3db:7dc5:fec2 with SMTP id d10-20020a656b8a000000b003db7dc5fec2mr18404105pgw.223.1654482560074; Sun, 05 Jun 2022 19:29:20 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.81]) by smtp.gmail.com with ESMTPSA id ca16-20020a056a00419000b00518d06efbc8sm651656pfb.98.2022.06.05.19.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 19:29:19 -0700 (PDT) From: menglong8.dong@gmail.com X-Google-Original-From: imagedong@tencent.com To: kuba@kernel.org Cc: rostedt@goodmis.org, mingo@redhat.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, nhorman@tuxdriver.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, imagedong@tencent.com, dsahern@kernel.org, talalahmad@google.com, keescook@chromium.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH net-next v4 0/3] reorganize the code of the enum skb_drop_reason Date: Mon, 6 Jun 2022 10:24:33 +0800 Message-Id: <20220606022436.331005-1-imagedong@tencent.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Menglong Dong The code of skb_drop_reason is a little wild, let's reorganize them. Three things and three patches: 1) Move the enum 'skb_drop_reason' and related function to the standalone header 'dropreason.h', as Jakub Kicinski suggested, as the skb drop reasons are getting more and more. 2) use auto-generation to generate the source file that convert enum skb_drop_reason to string. 3) make the comment of skb drop reasons kernel-doc style. Changes since v3: 3/3: remove some useless comment (Jakub Kicinski) Changes since v2: 2/3: - add new line in the end of .gitignore - fix awk warning by make '\;' to ';', as ';' is not need to be escaped - export 'drop_reasons' in skbuff.c Changes since v1: 1/3: move dropreason.h from include/linux/ to include/net/ (Jakub Kicinski) 2/3: generate source file instead of header file for drop reasons string array (Jakub Kicinski) 3/3: use inline comment (Jakub Kicinski) Menglong Dong (3): net: skb: move enum skb_drop_reason to standalone header file net: skb: use auto-generation to convert skb drop reason to string net: dropreason: reformat the comment fo skb drop reasons include/linux/skbuff.h | 179 +------------------------- include/net/dropreason.h | 256 +++++++++++++++++++++++++++++++++++++ include/trace/events/skb.h | 89 +------------ net/core/.gitignore | 1 + net/core/Makefile | 23 +++- net/core/drop_monitor.c | 13 -- net/core/skbuff.c | 3 + 7 files changed, 284 insertions(+), 280 deletions(-) create mode 100644 include/net/dropreason.h create mode 100644 net/core/.gitignore -- 2.36.1