Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp745966pxp; Fri, 11 Mar 2022 14:02:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlikNkPgQ4bTI1xQ2/i8Jzz51noIoZF0d9ukx2X/4UiZ8hdqEI4Xyz6LsHQ37wIrf8XHIo X-Received: by 2002:a17:902:d2c3:b0:151:fa59:95ab with SMTP id n3-20020a170902d2c300b00151fa5995abmr12796037plc.154.1647036170576; Fri, 11 Mar 2022 14:02:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647036170; cv=none; d=google.com; s=arc-20160816; b=OEzfBWK9yqY9mMdegmJMCy3jFsHFBe+BB2xK/lVu4dzz4CB4f68BTGEgegXGqGd8yl dBiqt2aI1GKRtpB7KfSurn9sVAe2sx3/KeLU72KLV8Yqa4OZJPuP4XtXyFhKYXMo1hpO M7k96gN+vNzMFhhg8ZPmq7qCUT1W+37d8b9/9KP7PG++hUCKXcJkZux9RU0RAQP4A188 0TrbiZNRbsRvaXY7INx3C1y7Vp4CYHQDr2ydQiz3k3BBQnUE2YPuVqutfph0qnerLVtg sa8FJwbYiPlO36mtZufDqvU88/8g9tpUuRghih7pCc+c8UcN8qDkI6mRcBQh6T1knCYj BLxw== 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=gyE9IcY/AL9lvvlSStbY/lLOPYuMFGZEROA9x6xbLGI=; b=Xx0EYrZ+/1iim9/FUqeOn+hBv+TwpAu2jq99tUeVBdG2SUxFg6BLt29GURZwvJh5f0 d672dxne1lOZoYvGK7YgTgJE6wBuWYdgilvtlf9hw5Y+W9uJZ0YrtI/IEiNk378UF0ZU Kdz0SLYG7c776j7fS8+owPwSf1f/6BQJ4piO880XX9JIoOJHb8mB2kYysl9EKVhCh3bg pJOA4CyzabcgsxsDkTlaxgxrTow7qfquKKbNOCcnESX4t8aDBX1LzT91XDxYgvK45xjw NcMf79YcOpENsaSbc6IytpYUTcdYZl6f+IEGOd13CrWn/6mOiFjjV3Tb4iDakqzFg2FF hxiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="PsuYdL/+"; 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 i12-20020a17090a4b8c00b001bd5225cf99si9098140pjh.85.2022.03.11.14.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:02:50 -0800 (PST) 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="PsuYdL/+"; 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 1B3BC207A2B; Fri, 11 Mar 2022 13:18:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240436AbiCKE7l (ORCPT + 99 others); Thu, 10 Mar 2022 23:59:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237718AbiCKE72 (ORCPT ); Thu, 10 Mar 2022 23:59:28 -0500 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B55F213D; Thu, 10 Mar 2022 20:58:25 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id r13so16699796ejd.5; Thu, 10 Mar 2022 20:58:25 -0800 (PST) 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=gyE9IcY/AL9lvvlSStbY/lLOPYuMFGZEROA9x6xbLGI=; b=PsuYdL/+Ispy6VwTl/mQFpUDlSYHVjfBN0IUuF5kQujsjD4rot6zOwROwQai0h7cXE rNp4ZrNCo+BNN7dHZl820+1VTComRjrs1dw0EK4DR/xSlMM8hOdr6QeRtf1t2G6z3NXe gC0BZnxkhFtSF4gCeQkNqfJhYe90FeD8h/loAWx7ciGfkHVU2f8Q5ZP9N7yML9broSl3 SdZ4JvkBpIvkgNi4qmxUSTobIrAYtYkARSNkIP/R9Cr8967y4lkVpyQkATULC4cAQTyu A/C37H2UGyBmUkt5Iz8SREf7yy1mymS1hMpLE68p3wmiJkbjoCqn6ES7FrBwiKPe2o16 2ANA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gyE9IcY/AL9lvvlSStbY/lLOPYuMFGZEROA9x6xbLGI=; b=lN/oWs0EPNU8VwwSlYpcZmn1n2rltaomUyOh/mLf9AXT77dNJyCO67sHcFiHu8hgHO R5XMfjI2Dw0tWTigoL3/Bb8t2vrd4eh2d9djaBRqEcuYe5mFgQf8WkGVw7WLAPbTK+8/ uqSLbv/ys4t5B4QNwL4pljk6yFQxQl8Qm9gimFZ3fQ5wwqyNm+/qLcaxgkq51YkoKwUN Mo9muHgr8opy4pS4EZL0YucUBBQeMiTdkmiDIXr6BSDC0RrJz0lr0e3B6s8wmRwuMRo/ dcZGBORAZOYvi6a6r6xWCk2eoKSOhhpJN2uflJ3BYloR3GE1t3srT1T/33P53DgpCgMl WsJQ== X-Gm-Message-State: AOAM531QNptyNg4LJT6WSPp6i57fID68jbFD6+/UnwPSzfGKaPLNWxOB dhypIGmUQUYnWZOZVSbUuwVC8lg3JvjW1bYs96s= X-Received: by 2002:a17:907:3f9b:b0:6da:6f2b:4b1c with SMTP id hr27-20020a1709073f9b00b006da6f2b4b1cmr6923862ejc.765.1646974704368; Thu, 10 Mar 2022 20:58:24 -0800 (PST) MIME-Version: 1.0 References: <20220311032828.702392-1-imagedong@tencent.com> <20220310195429.4ba93edf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20220310195429.4ba93edf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: Menglong Dong Date: Fri, 11 Mar 2022 12:58:13 +0800 Message-ID: Subject: Re: [PATCH] net: skb: move enum skb_drop_reason to uapi To: Jakub Kicinski Cc: David Ahern , Neil Horman , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , David Miller , Menglong Dong , Eric Dumazet , Talal Ahmad , Kees Cook , Alexander Lobakin , LKML , netdev , bpf , Mengen Sun , Hao Peng Content-Type: text/plain; charset="UTF-8" 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 On Fri, Mar 11, 2022 at 11:54 AM Jakub Kicinski wrote: > > On Fri, 11 Mar 2022 11:28:28 +0800 menglong8.dong@gmail.com wrote: > > From: Menglong Dong > > > > Move the definition of 'enum skb_drop_reason' in 'skbuff.h' to the uapi > > header 'net_dropmon.h', therefore some users, such as eBPF program, can > > make use of it. > > BPF does not need an enum definition to be part of the uAPI to make use > of it. BTF should encode the values, and CO-RE can protect from them > changing, AFAIU. I think we need a better example user / justification. There is something wrong with my description, it's not the eBPF, but the user program that loads eBPF. In my case, I'll pass the packet info (protocol, ip, port, etc) and drop reason to user space by eBPF that is attached on the kfree_skb() tracepoint. In the user space, I'll custom the description for drop reasons and convert them from int to string. Therefore, I need to use 'enum skb_drop_reason' in my user space code. For now, I copied the definition of 'enum skb_drop_reason' to my code, and I think it's better to make them uapi, considering someone else may use it this way too. Thanks Menglong Dong