Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7121345rwl; Mon, 9 Jan 2023 18:28:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtLaS0KCttVuGzzIXJGjMtRtTq+BDc4bNWrM7AAJZUqPzdi2u+Y78RLM+btQwCNZuFWwbKy X-Received: by 2002:a17:906:8601:b0:7b2:91e8:1553 with SMTP id o1-20020a170906860100b007b291e81553mr56403760ejx.20.1673317713763; Mon, 09 Jan 2023 18:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673317713; cv=none; d=google.com; s=arc-20160816; b=J9xehBWswsl52yAKqGNotC9CJ2ycaP7Edh7wQEhFuZ11wesYboLr8qrtf+bjTT8tL9 Cd7k0tP8JIT7jBP1psjReTmaVGlTcRqL1mGcxDvBHrnPtclH2eYT57pn8vmIMdYRZUx9 eC1R/bUfVVCaSz49QK66XzO6Y+OvaNM17vsFicPYLY8dvLTQBkSN8CcS5J7s6/RpcCI7 cTDiYPOVIlny8dLzftlB6T3VD+GHccTwu4zq4ZB/1zcfSVU5xBl3bxWm3lu8QZGgVtEv f9Bvm5E3OS17Jq5bniZ7MI2/QJvTcAMKWNe3XU0VvHFucptduBYkau92uH2wb4h1ntGt mbqA== 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=4HXjD1QcFQuEl9ZhtGe9n4ik0nnZg6brN6d15dV7QxU=; b=jYPep9pU7xVptfGzaovGbBXM+DyBEOrMnIJEKeAvaWQH4FwFaAIt53rjfZ/o+wa3Rk hMuLH4z1VLFCBSQWrNv+Nn9bgqd/ZekZKPQDQ/QbTEGIWrcCnpCSAFHExW+236MOdGUb 3ybHCvpY/y1Rf3gcH988/Rex1fZqFl20ld8pUCczo3PZF7KaCc8YoOEoYRl6lGgwsk7b uHyqvJFvA6zj6mpHnRnyiE/iPm4CqokN6aj39bui2p8+LaxzUzdXFc4cMZeWUvbx2Hvm D6PxBBbgFzLcUsge2OLBCpYOZjgk+g23xHAOdZJmhDo9ErcPnjZ7JQmMCD3bCpMyNhBw IU5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P9GLOi7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a20-20020a17090680d400b007a835c56b70si8210229ejx.267.2023.01.09.18.28.20; Mon, 09 Jan 2023 18:28:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P9GLOi7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230286AbjAJCWM (ORCPT + 55 others); Mon, 9 Jan 2023 21:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237219AbjAJCV7 (ORCPT ); Mon, 9 Jan 2023 21:21:59 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03186140B8; Mon, 9 Jan 2023 18:21:58 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id vm8so25012822ejc.2; Mon, 09 Jan 2023 18:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4HXjD1QcFQuEl9ZhtGe9n4ik0nnZg6brN6d15dV7QxU=; b=P9GLOi7aXdK7UsTmY95FXFvkxPqhVbxxnXGLXEmdKqqYQUBzLxzJMfm9MyUQz/uawu v2ivoVHckFAWHDH7rAs6HWPnb8EWppzdsBhreEi1zyzeh0GLAGxW8C697C7PJWlXZWmy 4KAQwjxTUgSBuGSlQ/Vg8wYRqwlR0sUhocDZwKDtDc727llGqv+AD418yyFl6ecR9XM9 XjePvRffjS5dlA/AbU158N34+1nafP3SWHEVaBVW2LCQ9ohHU526r1caK4GZGXMBDv5t 3xyX9DlpphZEZgzu3mXUNdwckV/ClaKeothwPJOC7h8OVAxzk4pYWmGNC07QIe9ebyza /AuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4HXjD1QcFQuEl9ZhtGe9n4ik0nnZg6brN6d15dV7QxU=; b=PFoB73qupBnacaw4bswNG6sp/YRJqrrss+WJV2ndiy5qOlD3kOgm7e1ayJvTVmpWfE YqUen1ST7SP/FePLXvm3eL7WqBZrsA80129MzGwrDPKV832a0BMTQSb19XshPX0tNeoY WvS4TPqqdmaaQNDGWWtBhSzCWFDAVDu+bC8c1HsGZbpZhMNr3o87zoWICwtuW5W8BhRc aYgP5Um+cNjKM8ZZ5CJ9GYbXSNDzkj/jAGZku7Jpe9se7k0c+b5e0uqRCusTk72G7x15 6Y6X/OZdIZmqwSyUoMANGbb+kE+tOfI7cpeT/+Q/BRLRVQFqY4cF+xy2BHA1fiTuWKnL 8EoA== X-Gm-Message-State: AFqh2kqdDYhC708xCVQvNJr+kgqgdsdoHj9qk117V71AD8WEEPy5BsfN L0zZe2nQRlb8V6VwxQHENvWqsaD8eBq54fFNMiU= X-Received: by 2002:a17:906:dcf:b0:7c1:6781:9c97 with SMTP id p15-20020a1709060dcf00b007c167819c97mr4771664eji.676.1673317316427; Mon, 09 Jan 2023 18:21:56 -0800 (PST) MIME-Version: 1.0 References: <20230106195130.1216841-1-void@manifault.com> <20230106195130.1216841-2-void@manifault.com> <20230109120815.zx5mif4hnee6gyvc@apollo> In-Reply-To: From: Alexei Starovoitov Date: Mon, 9 Jan 2023 18:21:45 -0800 Message-ID: Subject: Re: [PATCH bpf-next 1/3] bpf: Add __bpf_kfunc tag for marking kernel functions as kfuncs To: David Vernet Cc: Kumar Kartikeya Dwivedi , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Mon, Jan 9, 2023 at 9:05 AM David Vernet wrote: > > > Maybe 3 macroses then? > > > bpf_kfunc_start to hide __diag > > > bpf_kfunc on the proto line > > > bpf_kfunc_end to finish __diag_pop > > Ah, I see. Hmm, I guess this is better than what we have now, but is > still a lot of macros and boilerplate which IMO is a sign we're not > going in quite the right direction. I don't really have a better > suggestion at this point, though I do like Kumar's suggestion below. > > > There's also the option of doing this: > > > > #define BPF_KFUNC(proto) proto; __used noinline proto > > > > BPF_KFUNC(void kfunc(arg1, arg2)) { > > ... > > } Fine by me. Just put { on the new line.