All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Yafang Shao <laoar.shao@gmail.com>,
	ast@kernel.org, andrii@kernel.org, kafai@fb.com,
	songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com,
	kpsingh@kernel.org
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next 1/4] libbpf: Define DEFAULT_BPFFS
Date: Mon, 25 Apr 2022 15:47:42 +0200	[thread overview]
Message-ID: <bdc0c787-fcca-551e-3ff5-2d2e21940fdb@iogearbox.net> (raw)
In-Reply-To: <20220423140058.54414-2-laoar.shao@gmail.com>

On 4/23/22 4:00 PM, Yafang Shao wrote:
> Let's use a macro DEFAULT_BPFFS instead of the hard-coded "/sys/fs/bpf".
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
[...]
> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> index cdbfee60ea3e..3784867811a4 100644
> --- a/tools/lib/bpf/libbpf.h
> +++ b/tools/lib/bpf/libbpf.h
> @@ -28,6 +28,8 @@ LIBBPF_API __u32 libbpf_major_version(void);
>   LIBBPF_API __u32 libbpf_minor_version(void);
>   LIBBPF_API const char *libbpf_version_string(void);
>   
> +#define DEFAULT_BPFFS "/sys/fs/bpf"

Small nit, but given this is included in a lot of places potentially, it should
have a LIBBPF_ prefix to avoid collisions. Maybe: LIBBPF_BPFFS_DEFAULT_MNT

>   enum libbpf_errno {
>   	__LIBBPF_ERRNO__START = 4000,
>   
> @@ -91,7 +93,7 @@ struct bpf_object_open_opts {
>   	bool relaxed_core_relocs;
>   	/* maps that set the 'pinning' attribute in their definition will have
>   	 * their pin_path attribute set to a file in this directory, and be
> -	 * auto-pinned to that path on load; defaults to "/sys/fs/bpf".
> +	 * auto-pinned to that path on load; defaults to DEFAULT_BPFFS.
>   	 */
>   	const char *pin_root_path;
>   
> @@ -190,7 +192,7 @@ bpf_object__open_xattr(struct bpf_object_open_attr *attr);
>   
>   enum libbpf_pin_type {
>   	LIBBPF_PIN_NONE,
> -	/* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
> +	/* PIN_BY_NAME: pin maps by name (in DEFAULT_BPFFS by default) */
>   	LIBBPF_PIN_BY_NAME,
>   };
>   
> 


  reply	other threads:[~2022-04-25 13:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 14:00 [PATCH bpf-next 0/4] bpf: Generate helpers for pinning through bpf object skeleton Yafang Shao
2022-04-23 14:00 ` [PATCH bpf-next 1/4] libbpf: Define DEFAULT_BPFFS Yafang Shao
2022-04-25 13:47   ` Daniel Borkmann [this message]
2022-04-26  6:45   ` Andrii Nakryiko
2022-04-26 16:12     ` Yafang Shao
2022-04-23 14:00 ` [PATCH bpf-next 2/4] libbpf: Add helpers for pinning bpf prog through bpf object skeleton Yafang Shao
2022-04-25 13:57   ` Daniel Borkmann
2022-04-26 15:58     ` Yafang Shao
2022-04-26 23:15       ` Andrii Nakryiko
2022-04-27 14:45         ` Yafang Shao
2022-04-27 15:47           ` Yafang Shao
2022-04-27 18:51             ` Andrii Nakryiko
2022-04-23 14:00 ` [PATCH bpf-next 3/4] bpftool: Fix incorrect return in generated detach helper Yafang Shao
2022-04-26  6:47   ` Andrii Nakryiko
2022-04-26 16:14     ` Yafang Shao
2022-04-23 14:00 ` [PATCH bpf-next 4/4] bpftool: Generate helpers for pinning prog through bpf object skeleton Yafang Shao
2022-04-25 14:03   ` Daniel Borkmann
2022-04-26 16:00     ` Yafang Shao
2022-04-26  6:45 ` [PATCH bpf-next 0/4] bpf: Generate helpers for pinning " Andrii Nakryiko
2022-04-26 16:09   ` Yafang Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdc0c787-fcca-551e-3ff5-2d2e21940fdb@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=laoar.shao@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.