On Sat, Nov 9, 2019 at 12:37 PM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> 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] https://github.com/xdp-project/xdp-tools > > Changelog: > > v4: > - Don't do any size checks on struct xdp_info, just copy (and/or zero) > whatever size the caller supplied. Applied. Thanks