Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp171929rwb; Wed, 5 Oct 2022 16:48:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/TlvbhIyan3dH43/X2kHkMf1ecj8brUYRcO9tvKnjFN5bJRB/jPGeIcErK8mE96YTLFpH X-Received: by 2002:a17:902:cec9:b0:178:1da5:1075 with SMTP id d9-20020a170902cec900b001781da51075mr1919813plg.136.1665013704416; Wed, 05 Oct 2022 16:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665013704; cv=none; d=google.com; s=arc-20160816; b=pQs5cw8sg7KRTFE5hTX4yTZfIl5Q2esn2PyUYUiu0q2ix0s7oXPchvOpW7thG9ptQM 9IpVvg9DgXDodXbhWfvdoOH4hkRKBJEBTNocj5N8rOSU0cc6T//oXuIpQqOriFRpskKo QaGpPRpSiJyDQz+X2jUEfo7xO/iq5hOB5UEisRba+LwY4qC+BMp39PVxXRm/dbS3+tO/ OfKU9cbR/KGDbdaGw9HJ9JpndBZbEG5Kn3+iOSgnDwIKdytiJq2fFrQQ9kXtY99LzxMM 8oTBeWPAPIf0XE017XUf5n+ubUiHWHX+z8WWXaz2OgK7bg5DtmKVLOT8dmsC0rvvyGz3 8MiQ== 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=70/0VDagsCspULHomdUzncRjIyjSrHpZkWTpvU+Mdnc=; b=A/HgWyQUk8QhEje0rvpZ2rjJ+wH+J/JsNL2Osw8eFd8QzqYoIWJYbB3hneyl6SREkq UF1frIP5Je4nzG6lBHP2DfCkquqv+yAzOJbFCWgsegxhsaoDT7hIa70l+kpOQi2CccIe kMV/Qn6adNo4ekPdXYmPi6PKXagmHPpW5Rz4H4+apr6VZsC6N0Lr1+9zHoNDa/W2qQOn 12rer3YqquC7lehpdzU3OQNz6TYD3yEHR4zI5okmx2z0+7du4nlnK4XjVSvTaeu64qe6 mdOpiKdszbc0U5gjoyLG9ezQc6IOKQCF3M7+WQIaCbbc4nVwiIzWIMnMRAVYHMSbG3+O mnGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ui9PfNfd; 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 k13-20020a056a00134d00b0052b75c32fd2si17814772pfu.48.2022.10.05.16.47.51; Wed, 05 Oct 2022 16:48:24 -0700 (PDT) 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=Ui9PfNfd; 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 S229712AbiJEXOh (ORCPT + 99 others); Wed, 5 Oct 2022 19:14:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiJEXO1 (ORCPT ); Wed, 5 Oct 2022 19:14:27 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E23E85A8F; Wed, 5 Oct 2022 16:14:25 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id e62so358169yba.6; Wed, 05 Oct 2022 16:14:25 -0700 (PDT) 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=70/0VDagsCspULHomdUzncRjIyjSrHpZkWTpvU+Mdnc=; b=Ui9PfNfdZTtU6jOx6m29Brzt8qaGM1rmvPM64cfvS2965Q/AHw9kio3RsCdwhBE4lC SdnMGpgwu7DK3fS1TdSxR0n4AgYpaWu5oClNpUoIqAq++IUqYCRrrfFTnEDO7paRM2ot 22yLQxTvSE7WVpkmgLiTda1RcywO8twpU/WeErxbh7A2WP2llw7oTFpNQHWXlqpevUP+ FpDUipPw5dAMuqT9pwKB8aAgM7HD2+K86YHYvfTie+uf93e45G3EFMu9U8J6gUOaF+d/ Aj2kaff5fDGPSZd28AjteAChmma/tGu1cSr36yuvfFpoHkki6JtXYJVLdy0GQlsELyVe f2ow== 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=70/0VDagsCspULHomdUzncRjIyjSrHpZkWTpvU+Mdnc=; b=Q1qcvsIyLwO/Z7sMk11VyRwP6hh/1t4bGuRSp8wnmwOzDGGlF5Cpjl8EdKJwL1Z3WV pFWXWHsjBQ2zW4ORFq+WNDkV72IaZ7ZctE5SQXZvkN10yKMTCNEUCsyLsxVA0O03o3XI TYFHPrynZkuFSRC794d2084CCXJVI03GQdiCuEWJZlsg9YlfgiPuhV+ErhEBHDC4f0xB PzxQsERGClu0eoH8TZo4OsAySBHLDQEAGvrOSamWnatqQvTDdhS2X3cuI+Vm0Piwp4mR NRJOjRgUUplQ4P66fOB2OFBMr9uNHeVlRI6wfVJCDja/rHjs51oc1WoVyBc8OfS+sY8X 0KUA== X-Gm-Message-State: ACrzQf3jgKAW382BY9wQt/h6q1VmiaC7qAp7suRX4GgtrY4EjZgBUKKA geC2S6L1sqgd2XrHiaulQ1FGydkQHjbnYwAAUnI= X-Received: by 2002:a25:9e85:0:b0:6be:1725:91a8 with SMTP id p5-20020a259e85000000b006be172591a8mr2353790ybq.86.1665011664245; Wed, 05 Oct 2022 16:14:24 -0700 (PDT) MIME-Version: 1.0 References: <20221004131750.2306251-1-roberto.sassu@huaweicloud.com> In-Reply-To: <20221004131750.2306251-1-roberto.sassu@huaweicloud.com> From: Andrii Nakryiko Date: Wed, 5 Oct 2022 16:14:11 -0700 Message-ID: Subject: Re: [RESEND][PATCH 0/6] Add _opts variant for bpf_*_get_fd_by_id() To: Roberto Sassu Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Roberto Sassu 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 Tue, Oct 4, 2022 at 6:18 AM Roberto Sassu wrote: > > From: Roberto Sassu > > NOTE: resending with libbpf_get_fd_opts test added to deny list for s390x. it's not a resend if you change something in patches, it's a new version, please mark it appropriately with v2 instead of [RESEND] > > Add the _opts variant for bpf_*_get_fd_by_id() functions, to be able to > pass to the kernel more options, when requesting a fd of an eBPF object to > the kernel. > > Pass the options through a newly introduced structure, bpf_get_fd_opts, > which currently contains open_flags (the other two members are for > compatibility and for padding). > > open_flags allows the caller to request specific permissions to access a > map (e.g. read-only). This is useful for example in the situation where a > map is write-protected. > > Besides patches 2-6, which introduce the new variants and the data > structure, patch 1 fixes the LIBBPF_1.0.0 declaration in libbpf.map. > > Roberto Sassu (6): > libbpf: Fix LIBBPF_1.0.0 declaration in libbpf.map > libbpf: Define bpf_get_fd_opts and introduce > bpf_map_get_fd_by_id_opts() > libbpf: Introduce bpf_prog_get_fd_by_id_opts() > libbpf: Introduce bpf_btf_get_fd_by_id_opts() > libbpf: Introduce bpf_link_get_fd_by_id_opts() > selftests/bpf: Add tests for _opts variants of bpf_*_get_fd_by_id() > > tools/lib/bpf/bpf.c | 47 +++++++++- > tools/lib/bpf/bpf.h | 16 ++++ > tools/lib/bpf/libbpf.map | 6 +- > tools/testing/selftests/bpf/DENYLIST.s390x | 1 + > .../bpf/prog_tests/libbpf_get_fd_opts.c | 88 +++++++++++++++++++ > .../bpf/progs/test_libbpf_get_fd_opts.c | 36 ++++++++ > 6 files changed, 189 insertions(+), 5 deletions(-) > create mode 100644 tools/testing/selftests/bpf/prog_tests/libbpf_get_fd_opts.c > create mode 100644 tools/testing/selftests/bpf/progs/test_libbpf_get_fd_opts.c > > -- > 2.25.1 >