From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D811C4708C for ; Fri, 28 May 2021 20:00:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 603FE613B5 for ; Fri, 28 May 2021 20:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbhE1UCY (ORCPT ); Fri, 28 May 2021 16:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbhE1UCW (ORCPT ); Fri, 28 May 2021 16:02:22 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE40C061760; Fri, 28 May 2021 13:00:47 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id ep16-20020a17090ae650b029015d00f578a8so3142787pjb.2; Fri, 28 May 2021 13:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8W3zm3RiRStrXJZJXTCOkCwj1KgZnGiw4eoiXvnO8gE=; b=E/eJs2sjoCRMwpIwp7Y40g3yLi4E71b+EHcYTXkD2fIEV+BTu5qyhVYjZBPThTh4ct 49YxbOlIKAcNjh/udv7PtzMX35DJd7Qb+HbtOACL7MBzZu+9/Tm+MlZGd+YucAC6Nk0d bITrp7ki8EsnhIq0Rb9UhR6LIMAFxjgKs2BFBBl19VTfexQ1aoAuK/766E6YuWKMBx2K 1bATCEr10CD6p6bQBbYLJvekhmwlz5UfcxYYHhcyW7n1CevzE8JqOQgVnQkuhqNblb/v pDBjRgXZwJXeQiLcOPtdgrdvOtvBGK9YNLL0JN/QouIirpo2Nie4j+ZpHBV0frFXfnOF O6Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8W3zm3RiRStrXJZJXTCOkCwj1KgZnGiw4eoiXvnO8gE=; b=RHa9bPffIaDowxMi3PepeXXhZ22tLTU8uMpWd5tKCOjN3Rq42qvzmuJlvNlWkMSDBP 9L6QhAA0ngHgauoPqcvwkBWsqP6mJY5EYiFwgK5P0GmFVkdw4OUqoqbN1wLb9sLqOpTg YRFjFRN4D9sFR0rIJsg/8PmCDFtco74aNhpOuQrDyEa7m5mDn6rQ0YLxmrMeBXuGOfAR K+6p04iDlnmIvdcxCDluEo29qLYTzxy9Ox36gYGZbRiICn1iVA5SmRwYeDBDjS9xBJWC xEaTb+ItrP3R1awbiimWuBgDs+hrKZRFeJ3i8vElmEdxZ7AWux0wy1nKA4+UzzmhkenG Tpvw== X-Gm-Message-State: AOAM530qgYKUXHPMF6xm1hbwVcAAmUhVEYAy3xTEHDDgF79QGpcNmvg4 d67krhG5YWiJBq6gKYJ1oXlCiAC2wYE= X-Google-Smtp-Source: ABdhPJwQukKAQv7GjTb7n9L5Q7wnBH+1CUDoMqdtL1YKYzdy9A1XI8kA+vqESQ2HUSMg2880jj5WnA== X-Received: by 2002:a17:902:ecc5:b029:ff:82eb:2fb2 with SMTP id a5-20020a170902ecc5b02900ff82eb2fb2mr7162244plh.50.1622232046549; Fri, 28 May 2021 13:00:46 -0700 (PDT) Received: from localhost ([2402:3a80:11db:3aa9:ad24:a4a2:844f:6a0a]) by smtp.gmail.com with ESMTPSA id w197sm4997277pfc.5.2021.05.28.13.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 13:00:46 -0700 (PDT) From: Kumar Kartikeya Dwivedi To: bpf@vger.kernel.org Cc: Kumar Kartikeya Dwivedi , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jamal Hadi Salim , Vlad Buslov , Cong Wang , Jiri Pirko , "David S. Miller" , Jakub Kicinski , Joe Stringer , Quentin Monnet , Jesper Dangaard Brouer , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , netdev@vger.kernel.org Subject: [PATCH RFC bpf-next 2/7] bpf: export bpf_link functions for modules Date: Sat, 29 May 2021 01:29:41 +0530 Message-Id: <20210528195946.2375109-3-memxor@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210528195946.2375109-1-memxor@gmail.com> References: <20210528195946.2375109-1-memxor@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org These are required in a subsequent patch to implement the bpf_link command for cls_bpf. Since the bpf_link object is tied to the cls_bpf_prog object, it has to be initialized and managed from inside the module. Signed-off-by: Kumar Kartikeya Dwivedi --- kernel/bpf/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 50457019da27..e5934b748ced 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2338,6 +2338,7 @@ void bpf_link_init(struct bpf_link *link, enum bpf_link_type type, link->ops = ops; link->prog = prog; } +EXPORT_SYMBOL_GPL(bpf_link_init); static void bpf_link_free_id(int id) { @@ -2363,6 +2364,7 @@ void bpf_link_cleanup(struct bpf_link_primer *primer) fput(primer->file); put_unused_fd(primer->fd); } +EXPORT_SYMBOL_GPL(bpf_link_cleanup); void bpf_link_inc(struct bpf_link *link) { @@ -2510,6 +2512,7 @@ int bpf_link_prime(struct bpf_link *link, struct bpf_link_primer *primer) primer->id = id; return 0; } +EXPORT_SYMBOL_GPL(bpf_link_prime); int bpf_link_settle(struct bpf_link_primer *primer) { @@ -2522,6 +2525,7 @@ int bpf_link_settle(struct bpf_link_primer *primer) /* pass through installed FD */ return primer->fd; } +EXPORT_SYMBOL_GPL(bpf_link_settle); int bpf_link_new_fd(struct bpf_link *link) { -- 2.31.1