02 Sep, 2020

1 commit

  • The new resolve_btfids tool did not clean up the feature detection folder
    on 'make clean', and also was not called properly from the clean rule in
    tools/make/ folder on its 'make clean'. This lead to stale objects being
    left around, which could cause feature detection to fail on subsequent
    builds.

    Fixes: fbbb68de80a4 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
    Signed-off-by: Toke Høiland-Jørgensen
    Signed-off-by: Daniel Borkmann
    Acked-by: Jiri Olsa
    Link: https://lore.kernel.org/bpf/20200901144343.179552-1-toke@redhat.com

    Toke Høiland-Jørgensen
     

06 Aug, 2020

1 commit

  • Pull networking updates from David Miller:

    1) Support 6Ghz band in ath11k driver, from Rajkumar Manoharan.

    2) Support UDP segmentation in code TSO code, from Eric Dumazet.

    3) Allow flashing different flash images in cxgb4 driver, from Vishal
    Kulkarni.

    4) Add drop frames counter and flow status to tc flower offloading,
    from Po Liu.

    5) Support n-tuple filters in cxgb4, from Vishal Kulkarni.

    6) Various new indirect call avoidance, from Eric Dumazet and Brian
    Vazquez.

    7) Fix BPF verifier failures on 32-bit pointer arithmetic, from
    Yonghong Song.

    8) Support querying and setting hardware address of a port function via
    devlink, use this in mlx5, from Parav Pandit.

    9) Support hw ipsec offload on bonding slaves, from Jarod Wilson.

    10) Switch qca8k driver over to phylink, from Jonathan McDowell.

    11) In bpftool, show list of processes holding BPF FD references to
    maps, programs, links, and btf objects. From Andrii Nakryiko.

    12) Several conversions over to generic power management, from Vaibhav
    Gupta.

    13) Add support for SO_KEEPALIVE et al. to bpf_setsockopt(), from Dmitry
    Yakunin.

    14) Various https url conversions, from Alexander A. Klimov.

    15) Timestamping and PHC support for mscc PHY driver, from Antoine
    Tenart.

    16) Support bpf iterating over tcp and udp sockets, from Yonghong Song.

    17) Support 5GBASE-T i40e NICs, from Aleksandr Loktionov.

    18) Add kTLS RX HW offload support to mlx5e, from Tariq Toukan.

    19) Fix the ->ndo_start_xmit() return type to be netdev_tx_t in several
    drivers. From Luc Van Oostenryck.

    20) XDP support for xen-netfront, from Denis Kirjanov.

    21) Support receive buffer autotuning in MPTCP, from Florian Westphal.

    22) Support EF100 chip in sfc driver, from Edward Cree.

    23) Add XDP support to mvpp2 driver, from Matteo Croce.

    24) Support MPTCP in sock_diag, from Paolo Abeni.

    25) Commonize UDP tunnel offloading code by creating udp_tunnel_nic
    infrastructure, from Jakub Kicinski.

    26) Several pci_ --> dma_ API conversions, from Christophe JAILLET.

    27) Add FLOW_ACTION_POLICE support to mlxsw, from Ido Schimmel.

    28) Add SK_LOOKUP bpf program type, from Jakub Sitnicki.

    29) Refactor a lot of networking socket option handling code in order to
    avoid set_fs() calls, from Christoph Hellwig.

    30) Add rfc4884 support to icmp code, from Willem de Bruijn.

    31) Support TBF offload in dpaa2-eth driver, from Ioana Ciornei.

    32) Support XDP_REDIRECT in qede driver, from Alexander Lobakin.

    33) Support PCI relaxed ordering in mlx5 driver, from Aya Levin.

    34) Support TCP syncookies in MPTCP, from Flowian Westphal.

    35) Fix several tricky cases of PMTU handling wrt. briding, from Stefano
    Brivio.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2056 commits)
    net: thunderx: initialize VF's mailbox mutex before first usage
    usb: hso: remove bogus check for EINPROGRESS
    usb: hso: no complaint about kmalloc failure
    hso: fix bailout in error case of probe
    ip_tunnel_core: Fix build for archs without _HAVE_ARCH_IPV6_CSUM
    selftests/net: relax cpu affinity requirement in msg_zerocopy test
    mptcp: be careful on subflow creation
    selftests: rtnetlink: make kci_test_encap() return sub-test result
    selftests: rtnetlink: correct the final return value for the test
    net: dsa: sja1105: use detected device id instead of DT one on mismatch
    tipc: set ub->ifindex for local ipv6 address
    ipv6: add ipv6_dev_find()
    net: openvswitch: silence suspicious RCU usage warning
    Revert "vxlan: fix tos value before xmit"
    ptp: only allow phase values lower than 1 period
    farsync: switch from 'pci_' to 'dma_' API
    wan: wanxl: switch from 'pci_' to 'dma_' API
    hv_netvsc: do not use VF device if link is down
    dpaa2-eth: Fix passing zero to 'PTR_ERR' warning
    net: macb: Properly handle phylink on at91sam9x
    ...

    Linus Torvalds
     

21 Jul, 2020

1 commit

  • Pulling header files directly out of the kernel sources for inclusion in
    userspace programs is highly error prone, not least because it bypasses
    the kbuild infrastructure entirely and so may end up referencing other
    header files that have not been generated.

    Subsequent patches will cause compiler.h to pull in the ungenerated
    asm/rwonce.h file via filter.h, breaking the build for tools/bpf:

    | $ make -C tools/bpf
    | make: Entering directory '/linux/tools/bpf'
    | CC bpf_jit_disasm.o
    | LINK bpf_jit_disasm
    | CC bpf_dbg.o
    | In file included from /linux/include/uapi/linux/filter.h:9,
    | from /linux/tools/bpf/bpf_dbg.c:41:
    | /linux/include/linux/compiler.h:247:10: fatal error: asm/rwonce.h: No such file or directory
    | #include
    | ^~~~~~~~~~~~~~
    | compilation terminated.
    | make: *** [Makefile:61: bpf_dbg.o] Error 1
    | make: Leaving directory '/linux/tools/bpf'

    Take a copy of the installed version of linux/filter.h (i.e. the one
    created by the 'headers_install' target) into tools/include/uapi/linux/
    and adjust the BPF tool Makefile to reference the local include
    directories instead of those in the main source tree.

    Cc: Masahiro Yamada
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Alexei Starovoitov
    Suggested-by: Daniel Borkmann
    Reported-by: Xiao Yang
    Signed-off-by: Will Deacon

    Will Deacon
     

14 Jul, 2020

1 commit


10 Jun, 2020

1 commit

  • This allows transparent cross-compilation with CROSS_COMPILE by
    relying on 7ed1c1901fe5 ("tools: fix cross-compile var clobbering").

    Same change was applied to tools/bpf/bpftool/Makefile in
    9e88b9312acb ("tools: bpftool: do not force gcc as CC").

    Signed-off-by: Brett Mastbergen
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20200609213506.3299-1-brett.mastbergen@gmail.com

    Brett Mastbergen
     

03 Jun, 2020

1 commit

  • When using make kselftest TARGETS=bpf, tools/bpf is built with
    MAKEFLAGS=rR, which causes $(COMPILE.c) to be undefined, which in turn
    causes the build to fail with

    CC kselftest/bpf/tools/build/bpftool/map_perf_ring.o
    /bin/sh: 1: -MMD: not found

    Fix by using $(CC) $(CFLAGS) -c instead of $(COMPILE.c).

    Signed-off-by: Ilya Leoshkevich
    Signed-off-by: Daniel Borkmann
    Link: https://lore.kernel.org/bpf/20200602175649.2501580-2-iii@linux.ibm.com

    Ilya Leoshkevich
     

14 Jan, 2020

1 commit

  • Convert one of BCC tools (runqslower [0]) to BPF CO-RE + libbpf. It matches
    its BCC-based counterpart 1-to-1, supporting all the same parameters and
    functionality.

    runqslower tool utilizes BPF skeleton, auto-generated from BPF object file,
    as well as memory-mapped interface to global (read-only, in this case) data.
    Its Makefile also ensures auto-generation of "relocatable" vmlinux.h, which is
    necessary for BTF-typed raw tracepoints with direct memory access.

    [0] https://github.com/iovisor/bcc/blob/11bf5d02c895df9646c117c713082eb192825293/tools/runqslower.py

    Signed-off-by: Andrii Nakryiko
    Signed-off-by: Alexei Starovoitov
    Link: https://lore.kernel.org/bpf/20200113073143.1779940-6-andriin@fb.com

    Andrii Nakryiko
     

25 Nov, 2019

1 commit

  • Building selftests with 'make TARGETS=bpf kselftest' was fixed in commit
    55d554f5d140 ("tools: bpf: Use !building_out_of_srctree to determine
    srctree"). However, by updating $(srctree) in tools/bpf/Makefile for
    in-tree builds only, we leave out the case where we pass an output
    directory to build BPF tools, but $(srctree) is not set. This
    typically happens for:

    $ make -s tools/bpf O=/tmp/foo
    Makefile:40: /tools/build/Makefile.feature: No such file or directory

    Fix it by updating $(srctree) in the Makefile not only for out-of-tree
    builds, but also if $(srctree) is empty.

    Detected with test_bpftool_build.sh.

    Fixes: 55d554f5d140 ("tools: bpf: Use !building_out_of_srctree to determine srctree")
    Signed-off-by: Quentin Monnet
    Signed-off-by: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Link: https://lore.kernel.org/bpf/20191119105626.21453-1-quentin.monnet@netronome.com

    Quentin Monnet
     

30 Sep, 2019

1 commit

  • make TARGETS=bpf kselftest fails with:

    Makefile:127: tools/build/Makefile.include: No such file or directory

    When the bpf tool make is invoked from tools Makefile, srctree is
    cleared and the current logic check for srctree equals to empty
    string to determine srctree location from CURDIR.

    When the build in invoked from selftests/bpf Makefile, the srctree
    is set to "." and the same logic used for srctree equals to empty is
    needed to determine srctree.

    Check building_out_of_srctree undefined as the condition for both
    cases to fix "make TARGETS=bpf kselftest" build failure.

    Signed-off-by: Shuah Khan
    Signed-off-by: Daniel Borkmann
    Acked-by: Song Liu
    Link: https://lore.kernel.org/bpf/20190927011344.4695-1-skhan@linuxfoundation.org

    Shuah Khan
     

31 Aug, 2019

1 commit

  • When building "tools/bpf" from the top of the Linux repository, the
    build system passes a value for the $(OUTPUT) Makefile variable to
    tools/bpf/Makefile and tools/bpf/bpftool/Makefile, which results in
    generating "libbpf/" (for bpftool) and "feature/" (bpf and bpftool)
    directories inside the tree.

    This commit adds such directories to the relevant .gitignore files, and
    edits the Makefiles to ensure they are removed on "make clean". The use
    of "rm" is also made consistent throughout those Makefiles (relies on
    the $(RM) variable, use "--" to prevent interpreting
    $(OUTPUT)/$(DESTDIR) as options.

    v2:
    - New patch.

    Signed-off-by: Quentin Monnet
    Signed-off-by: Daniel Borkmann

    Quentin Monnet
     

26 Apr, 2018

1 commit

  • Fix build error found with Ubuntu shipped gcc-5

    ~/git/bpf/tools/bpf$ make all

    Auto-detecting system features:
    ... libbfd: [ OFF ]
    ... disassembler-four-args: [ OFF ]

    CC bpf_jit_disasm.o
    LINK bpf_jit_disasm
    CC bpf_dbg.o
    /home/john/git/bpf/tools/bpf/bpf_dbg.c: In function ‘cmd_load’:
    /home/john/git/bpf/tools/bpf/bpf_dbg.c:1077:13: warning: ‘cont’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    } else if (matches(subcmd, "pcap") == 0) {
    ^
    LINK bpf_dbg
    CC bpf_asm.o
    make: *** No rule to make target `bpf_exp.yacc.o', needed by `bpf_asm'. Stop.

    Fixes: 5a8997f20715 ("tools: bpf: respect output directory during build")
    Signed-off-by: John Fastabend
    Signed-off-by: Daniel Borkmann

    John Fastabend
     

16 Mar, 2018

2 commits


09 Mar, 2018

6 commits


30 Dec, 2017

1 commit

  • Bpftool build is broken with binutils version 2.29 and later.
    The cause is commit 003ca0fd2286 ("Refactor disassembler selection")
    in the binutils repo, which changed the disassembler() function
    signature.

    Fix this by adding a new "feature" to the tools/build/features
    infrastructure and make it responsible for decision which
    disassembler() function signature to use.

    Signed-off-by: Roman Gushchin
    Cc: Jakub Kicinski
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Acked-by: Jakub Kicinski
    Signed-off-by: Daniel Borkmann

    Roman Gushchin
     

04 Nov, 2017

1 commit


05 Oct, 2017

2 commits

  • Add a simple tool for querying and updating BPF objects on the system.

    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Acked-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Jakub Kicinski
     
  • We currently only have BPF tools in the tools/net directory.
    We are about to add more BPF tools there, not necessarily
    networking related, rename the directory and related Makefile
    targets to bpf.

    Suggested-by: Daniel Borkmann
    Signed-off-by: Jakub Kicinski
    Reviewed-by: Simon Horman
    Acked-by: Daniel Borkmann
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Jakub Kicinski