Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2656985lqp; Mon, 25 Mar 2024 05:57:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlE03Xnz8HER6vIhmZvcSWvIlfRiFcX646UkcclD4UIvJuZZoL0Eaz+fWuAXTzBWMLj6MZKj6rBE8PVuIg5HVg/t28JqE2kVFM5UrQdA== X-Google-Smtp-Source: AGHT+IFymLpvPRZQO7T1kfmmgostwj3BHAHjnJLPHPrWG5l0D9IpZtbNfxicm6sZc3DozqLSsOd8 X-Received: by 2002:ad4:5a51:0:b0:696:7902:983a with SMTP id ej17-20020ad45a51000000b006967902983amr6163623qvb.2.1711371458882; Mon, 25 Mar 2024 05:57:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711371458; cv=pass; d=google.com; s=arc-20160816; b=Apo4NsgrigXIxabc2l7is8t1S2h0A4RZdI34Y/Q6nyL0GRgKST6DlNsto0Pf2XDNxG 1SmeZoBR5YBcIKDmudUuPyxVll9jTuyShuj0HEr+0/jJ4Yv6YOw0ac6kdwecPHTrLXUe j8GpfNN44UHQy/B52tcS54KNIQXW8hBu6liAx3MOe+rbjAogKictMBLsJz4tlxEterHV hmXjB1bAC1BPm+oa0oINhdO8nueTmzHKZdSeDeZNv7jvvGpBo4/4akLKUG65MgVLxp6X QLnSfE7TKnGzzgZLkct3jCoV9NWX60HsRl60H6qSnWnpSJydtik39t18ZuLkiAp5V8Km R6mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=7BBDsWRAfxn16V9JUrxU5fWOrMBwITmAW8YLJ5f7n/o=; fh=MT/RSjviCRXKsRieDdoIxHUKraMdXiV4IEUvDRWBC8k=; b=GAMPjIvRHXvxBeo+mikTYqqw3185ScipnMcEb4P8e089EyP1v3Rj0M3do5oUpKfnNM aVh/SUApgaDORJUsAb12864LNEXxtOm4RoC8+lP35Rzvr5F1ENTQu/7zuLQZp1WdwqwZ 3Moid2RDBn/+P19XuUTgavh/NE82iPbKUcezPRjTKZ0/zzJ8Z5MOw8wi9eeADDefBJn6 tEC4IrjUCr5HQENMiaF7E1yQXcaOlGVl47EbqpK9xVhKjVm6I6+azaq6hQ7ZaqjEmhZa V5WT0ZFytM5XpHeW1+yn7f4oxs/ycJtZuhNScnUHdSckY/vDOZb3ASSeaHrF9X0HPcI5 JoJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jm12-20020ad45ecc000000b006967e37c3a8si4279258qvb.172.2024.03.25.05.57.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 05:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8A5AF1C2A76E for ; Mon, 25 Mar 2024 12:57:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41769136999; Mon, 25 Mar 2024 07:55:20 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9808413DBBC; Mon, 25 Mar 2024 05:40:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711345251; cv=none; b=VRG4AiGGTe/wDHigZwq/OyqlkTnNCtU0T9Rr0dUbKZ6660HAKXnMZwIs+A25yivO4TTXyQzoFeJVV/u1m/6zUrmI527rP6VRSgRyOWj93jiFmpd90rjPW07V6KAEeG6/bLazlVV6jWlrj01kwpWHEomOK4Xp9Pk6RUD7XhLI81A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711345251; c=relaxed/simple; bh=o8lhs5WjRnLwEjNCgrAeZ28LTGyTTXMeBRtuzw8ajNw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Dq9mquSWtD4JnNeNh32Exrpg+4V3uSCRJYga5srqjbapzvQXXSjeZIhZHma82SRleztxOjKsDrZ9ra6moNoEYlpM9Um0R1dm0FwaXvv1DoPwEQBflaIO+VLbvaCJdfPyA6xBA+5vq4fAsGwZMNwS+azNDZyHpo7aN192gY/rKM8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-56bc5a3aeb9so5087914a12.3; Sun, 24 Mar 2024 22:40:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711345248; x=1711950048; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7BBDsWRAfxn16V9JUrxU5fWOrMBwITmAW8YLJ5f7n/o=; b=lEusBV7S6R+9b/qaXNLf5iVtfpN9oOcE2pnZwl1YkzY3TqtrIw5IiW1kIcF+O7DLfR WaYXVwlxjTFaW4/NlU1pI9ql2ry6CmpeJjFVms7Jp7VQv0k6BkLJlMU63H9hEehuXU8M Da0dKn9LdlbBkkemlcVoIJJmn6dUyTziJz0bGhNsgw0JGwGWPMjxNSLPD/pp3R3N3a81 jRUTMqYarhD0j3kGPjXdKl7JgvoWtmwLwCiyVAlz9FClNTjuc8+7+0ypUu7wmbBwHTm4 kW5+dGCwLqzcgp8m6vDLYqtHHYDAoQTRQTpl2MmMTRRPD2J9wFTZnl3Pzz5s+h5R25cJ 6YXQ== X-Forwarded-Encrypted: i=1; AJvYcCUmiW/nUbJj50wO3FRfyKDymxskSS4F1WNagqt+JHJLmZMqrL55V92QhCqdgO/MaWWQ/0F6/zDb0iZqI/f6carMXh1z/zMn2klygVi1wj9CRU9YXrvwDwe3BZDst5RCMeZj2DSk X-Gm-Message-State: AOJu0YzyPiUCpNWdoIvy1q22TGfQ/kDzZdXQV4nd7BrXKsViHPTJWcXB oNQoIDvOYpArECzlmPGsmbUt3ds2QpRhA5YKLcqkQQwk6tI+dKionHK+0aLM93Y= X-Received: by 2002:a50:d5d5:0:b0:568:d74f:bb8e with SMTP id g21-20020a50d5d5000000b00568d74fbb8emr4103611edj.3.1711345247692; Sun, 24 Mar 2024 22:40:47 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:69? ([2a0b:e7c0:0:107::aaaa:69]) by smtp.gmail.com with ESMTPSA id j26-20020aa7de9a000000b0056c08268768sm1431281edv.10.2024.03.24.22.40.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Mar 2024 22:40:47 -0700 (PDT) Message-ID: Date: Mon, 25 Mar 2024 06:40:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6.8 119/715] libbpf: Add bpf_token_create() API To: Sasha Levin , linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrii Nakryiko , Alexei Starovoitov References: <20240324223455.1342824-1-sashal@kernel.org> <20240324223455.1342824-120-sashal@kernel.org> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZ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/+dyTKL wLMJgiBzbVx8G+fCJJ9YtlNOPWhbKPlrQ8+AY52Aagi9WNhe6XfJdh5g6ptiOILm330mkR4g W6nEgZVyIyTq3ekOuruftWL99qpP5zi+eNrMmLRQx9iecDNgFr342R9bTDlb1TLuRb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240324223455.1342824-120-sashal@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 24. 03. 24, 23:24, Sasha Levin wrote: > From: Andrii Nakryiko > > [ Upstream commit 639ecd7d6247c48a0175f5b458b648f5d4b6dc34 ] > > Add low-level wrapper API for BPF_TOKEN_CREATE command in bpf() syscall. > > Signed-off-by: Andrii Nakryiko > Signed-off-by: Alexei Starovoitov > Link: https://lore.kernel.org/bpf/20240124022127.2379740-13-andrii@kernel.org > Stable-dep-of: c81a8ab196b5 ("libbpf: Add btf__new_split() API that was declared but not implemented") > Signed-off-by: Sasha Levin > --- > tools/lib/bpf/bpf.c | 17 +++++++++++++++++ > tools/lib/bpf/bpf.h | 24 ++++++++++++++++++++++++ > tools/lib/bpf/libbpf.map | 1 + > 3 files changed, 42 insertions(+) > > diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c > index 9dc9625651dcf..d4019928a8646 100644 > --- a/tools/lib/bpf/bpf.c > +++ b/tools/lib/bpf/bpf.c > @@ -1287,3 +1287,20 @@ int bpf_prog_bind_map(int prog_fd, int map_fd, > ret = sys_bpf(BPF_PROG_BIND_MAP, &attr, attr_sz); > return libbpf_err_errno(ret); > } > + > +int bpf_token_create(int bpffs_fd, struct bpf_token_create_opts *opts) > +{ > + const size_t attr_sz = offsetofend(union bpf_attr, token_create); > + union bpf_attr attr; > + int fd; > + > + if (!OPTS_VALID(opts, bpf_token_create_opts)) > + return libbpf_err(-EINVAL); > + > + memset(&attr, 0, attr_sz); > + attr.token_create.bpffs_fd = bpffs_fd; > + attr.token_create.flags = OPTS_GET(opts, flags, 0); With openSUSE config [1], I see: bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1301:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1302:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? [1] https://github.com/openSUSE/kernel-source/blob/master/config/x86_64/default > + fd = sys_bpf_fd(BPF_TOKEN_CREATE, &attr, attr_sz); And: bpf.c:1304:25: error: ‘BPF_TOKEN_CREATE’ undeclared (first use in this function); did you mean ‘BPF_ITER_CREATE’? They are added by: commit 35f96de04127d332a5c5e8a155d31f452f88c76d Author: Andrii Nakryiko Date: Tue Jan 23 18:21:00 2024 -0800 bpf: Introduce BPF token object But if you should take it or drop this all, I don't know... thanks, -- js suse labs