Netdev Archive on
 help / color / Atom feed
From: Alexei Starovoitov <>
To: "Toke Høiland-Jørgensen" <>
Cc: Daniel Borkmann <>,
	Alexei Starovoitov <>,
	Martin KaFai Lau <>, Song Liu <>,
	Yonghong Song <>,
	Jesper Dangaard Brouer <>,
	Andrii Nakryiko <>,
	David Miller <>,
	Network Development <>,
	bpf <>
Subject: Re: [PATCH bpf-next v4 0/6] libbpf: Fix pinning and error message bugs and add new getters
Date: Sun, 10 Nov 2019 19:29:10 -0800
Message-ID: <> (raw)
In-Reply-To: <>

On Sat, Nov 9, 2019 at 12:37 PM Toke Høiland-Jørgensen <> wrote:
> This series fixes a few bugs in libbpf that I discovered while playing around
> with the new auto-pinning code, and writing the first utility in xdp-tools[0]:
> - If object loading fails, libbpf does not clean up the pinnings created by the
>   auto-pinning mechanism.
> - EPERM is not propagated to the caller on program load
> - Netlink functions write error messages directly to stderr
> In addition, libbpf currently only has a somewhat limited getter function for
> XDP link info, which makes it impossible to discover whether an attached program
> is in SKB mode or not. So the last patch in the series adds a new getter for XDP
> link info which returns all the information returned via netlink (and which can
> be extended later).
> Finally, add a getter for BPF program size, which can be used by the caller to
> estimate the amount of locked memory needed to load a program.
> A selftest is added for the pinning change, while the other features were tested
> in the xdp-filter tool from the xdp-tools repo. The 'new-libbpf-features' branch
> contains the commits that make use of the new XDP getter and the corrected EPERM
> error code.
> [0]
> Changelog:
> v4:
>   - Don't do any size checks on struct xdp_info, just copy (and/or zero)
>     whatever size the caller supplied.

Applied. Thanks

      parent reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 20:37 Toke Høiland-Jørgensen
2019-11-09 20:37 ` [PATCH bpf-next v4 1/6] libbpf: Unpin auto-pinned maps if loading fails Toke Høiland-Jørgensen
2019-11-09 20:37 ` [PATCH bpf-next v4 2/6] selftests/bpf: Add tests for automatic map unpinning on load failure Toke Høiland-Jørgensen
2019-11-09 20:37 ` [PATCH bpf-next v4 3/6] libbpf: Propagate EPERM to caller on program load Toke Høiland-Jørgensen
2019-11-09 20:37 ` [PATCH bpf-next v4 4/6] libbpf: Use pr_warn() when printing netlink errors Toke Høiland-Jørgensen
2019-11-09 20:37 ` [PATCH bpf-next v4 5/6] libbpf: Add bpf_get_link_xdp_info() function to get more XDP information Toke Høiland-Jørgensen
2019-11-10  6:32   ` Andrii Nakryiko
2019-11-09 20:37 ` [PATCH bpf-next v4 6/6] libbpf: Add getter for program size Toke Høiland-Jørgensen
2019-11-11  3:29 ` Alexei Starovoitov [this message]

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Netdev Archive on

Archives are clonable:
	git clone --mirror netdev/git/0.git
	git clone --mirror netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ \
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone