path: root/Documentation/bpf
AgeCommit message (Collapse)Author
2021-04-23bpf: Document the pahole release info related to libbpf in bpf_devel_QA.rstTiezhu Yang
pahole starts to use libbpf definitions and APIs since v1.13 after the commit 21507cd3e97b ("pahole: add libbpf as submodule under lib/bpf"). It works well with the git repository because the libbpf submodule will use "git submodule update --init --recursive" to update. Unfortunately, the default github release source code does not contain libbpf submodule source code and this will cause build issues, the tarball from is same with github, you can get the source tarball with corresponding libbpf submodule codes from This change documents the above issues to give more information so that we can get the tarball from the right place, early discussion is here: Signed-off-by: Tiezhu Yang <> Signed-off-by: Alexei Starovoitov <> Reviewed-by: Arnaldo Carvalho de Melo <> Link:
2021-04-22bpf, doc: Fix some invalid links in bpf_devel_QA.rstTiezhu Yang
There exist some errors "404 Not Found" when I click the link of "MAINTAINERS" [1], "samples/bpf/" [2] and "selftests" [3] in the documentation "HOWTO interact with BPF subsystem" [4]. As Alexei Starovoitov suggested, just remove "MAINTAINERS" and "samples/bpf/" links and use correct link of "selftests". [1] [2] [3] [4] Fixes: 542228384888 ("bpf, doc: convert bpf_devel_QA.rst to use RST formatting") Signed-off-by: Tiezhu Yang <> Signed-off-by: Daniel Borkmann <> Acked-by: Jesper Dangaard Brouer <> Link:
2021-03-30bpf: Update bpf_design_QA.rst to clarify the kfunc call is not ABIMartin KaFai Lau
This patch updates bpf_design_QA.rst to clarify that the kernel function callable by bpf program is not an ABI. Signed-off-by: Martin KaFai Lau <> Signed-off-by: Alexei Starovoitov <> Acked-by: Song Liu <> Link:
2021-03-04docs/bpf: Add bpf() syscall command referenceJoe Stringer
Generate the syscall command reference from the UAPI header file and include it in the main bpf docs page. Signed-off-by: Joe Stringer <> Signed-off-by: Alexei Starovoitov <> Reviewed-by: Quentin Monnet <> Acked-by: Toke Høiland-Jørgensen <> Link:
2021-03-04bpf: Document BTF_KIND_FLOAT in btf.rstIlya Leoshkevich
Also document the expansion of the kind bitfield. Signed-off-by: Ilya Leoshkevich <> Signed-off-by: Alexei Starovoitov <> Acked-by: Yonghong Song <> Link:
2021-01-23bpf, docs: Update build procedure for manually compiling LLVM and ClangTiezhu Yang
The current LLVM and Clang build procedure in samples/bpf/README.rst is out of date. See below that the links are not accessible any more. $ git clone Cloning into 'llvm'... fatal: unable to access '': Maximum (20) redirects followed $ git clone --depth 1 Cloning into 'clang'... fatal: unable to access '': Maximum (20) redirects followed The LLVM community has adopted new ways to build the compiler. There are different ways to build LLVM and Clang, the Clang Getting Started page [1] has one way. As Yonghong said, it is better to copy the build procedure in Documentation/bpf/bpf_devel_QA.rst to keep consistent. I verified the procedure and it is proved to be feasible, so we should update README.rst to reflect the reality. At the same time, update the related comment in Makefile. Additionally, as Fangrui said, the dir llvm-project/llvm/build/install is not used, BUILD_SHARED_LIBS=OFF is the default option [2], so also change Documentation/bpf/bpf_devel_QA.rst together. At last, we recommend that developers who want the fastest incremental builds use the Ninja build system [1], you can find it in your system's package manager, usually the package is ninja or ninja-build [3], so add ninja to build dependencies suggested by Nathan. [1] [2] [3] Signed-off-by: Tiezhu Yang <> Signed-off-by: Daniel Borkmann <> Reviewed-by: Nathan Chancellor <> Acked-by: Yonghong Song <> Cc: Fangrui Song <> Link:
2021-01-20trace: bpf: Allow bpf to attach to bare tracepointsQais Yousef
Some subsystems only have bare tracepoints (a tracepoint with no associated trace event) to avoid the problem of trace events being an ABI that can't be changed. >From bpf presepective, bare tracepoints are what it calls RAW_TRACEPOINT(). Since bpf assumed there's 1:1 mapping, it relied on hooking to DEFINE_EVENT() macro to create bpf mapping of the tracepoints. Since bare tracepoints use DECLARE_TRACE() to create the tracepoint, bpf had no knowledge about their existence. By teaching bpf_probe.h to parse DECLARE_TRACE() in a similar fashion to DEFINE_EVENT(), bpf can find and attach to the new raw tracepoints. Enabling that comes with the contract that changes to raw tracepoints don't constitute a regression if they break existing bpf programs. We need the ability to continue to morph and modify these raw tracepoints without worrying about any ABI. Update Documentation/bpf/bpf_design_QA.rst to document this contract. Signed-off-by: Qais Yousef <> Signed-off-by: Alexei Starovoitov <> Acked-by: Yonghong Song <> Link:
2020-10-11bpf: Migrate from to Starovoitov
Move the bpf/bpf-next patch processing queue to Signed-off-by: Alexei Starovoitov <> Signed-off-by: Daniel Borkmann <> Link:
2020-09-22Merge git:// S. Miller
Two minor conflicts: 1) net/ipv4/route.c, adding a new local variable while moving another local variable and removing it's initial assignment. 2) drivers/net/dsa/microchip/ksz9477.c, overlapping changes. One pretty prints the port mode differently, whilst another changes the driver to try and obtain the port mode from the port node rather than the switch node. Signed-off-by: David S. Miller <>
2020-09-14docs/bpf: Remove source code linksAndrii Nakryiko
Make path to bench_ringbufs.c just a text, not a special link. Fixes: 97abb2b39682 ("docs/bpf: Add BPF ring buffer design notes") Reported-by: Mauro Carvalho Chehab <> Signed-off-by: Andrii Nakryiko <> Signed-off-by: Alexei Starovoitov <> Link:
2020-09-10docs/bpf: Fix ringbuf documentationAndrii Nakryiko
Remove link to litmus tests that didn't make it to upstream. Fix ringbuf benchmark link. I wasn't able to test this with `make htmldocs`, unfortunately, because of Sphinx dependencies. But bench_ringbufs.c path is certainly correct now. Fixes: 97abb2b39682 ("docs/bpf: Add BPF ring buffer design notes") Reported-by: Mauro Carvalho Chehab <> Signed-off-by: Andrii Nakryiko <> Signed-off-by: Alexei Starovoitov <> Link:
2020-08-25bpf: Update .BTF_ids section in btf.rst with sets infoJiri Olsa
Updating btf.rst doc with info about BTF_SET_START/END macros. Signed-off-by: Jiri Olsa <> Signed-off-by: Alexei Starovoitov <> Acked-by: Andrii Nakryiko <> Link:
2020-08-24bpf: sk_lookup: Add user documentationJakub Sitnicki
Describe the purpose of BPF sk_lookup program, how it can be attached, when it gets invoked, and what information gets passed to it. Point the reader to examples and further documentation. Signed-off-by: Jakub Sitnicki <> Signed-off-by: Alexei Starovoitov <> Link:
2020-08-24docs: Correct subject prefix and update LLVM infoJianlin Lv
bpf_devel_QA.rst:152 The subject prefix information is not accurate, it should be 'PATCH bpf-next v2' Also update LLVM version info and add information about ‘-DLLVM_TARGETS_TO_BUILD’ to prompt the developer to build the desired target. Signed-off-by: Jianlin Lv <> Signed-off-by: Alexei Starovoitov <> Acked-by: Yonghong Song <> Link:
2020-08-13doc: Add link to bpf helpers man pageJoe Stringer
The bpf-helpers(7) man pages provide an invaluable description of the functions that an eBPF program can call at runtime. Link them here. Signed-off-by: Joe Stringer <> Signed-off-by: Daniel Borkmann <> Link:
2020-08-07bpf, doc: Remove references to warning message when using bpf_trace_printk()Alan Maguire
The BPF helper bpf_trace_printk() no longer uses trace_printk(); it is now triggers a dedicated trace event. Hence the described warning is no longer present, so remove the discussion of it as it may confuse people. Fixes: ac5a72ea5c89 ("bpf: Use dedicated bpf_trace_printk event instead of trace_printk()") Signed-off-by: Alan Maguire <> Signed-off-by: Daniel Borkmann <> Link:
2020-08-05Merge git:// Torvalds
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:// (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 ...
2020-08-04Merge tag 'docs-5.9' of git:// Torvalds
Pull documentation updates from Jonathan Corbet: "It's been a busy cycle for documentation - hopefully the busiest for a while to come. Changes include: - Some new Chinese translations - Progress on the battle against double words words and non-HTTPS URLs - Some block-mq documentation - More RST conversions from Mauro. At this point, that task is essentially complete, so we shouldn't see this kind of churn again for a while. Unless we decide to switch to asciidoc or something...:) - Lots of typo fixes, warning fixes, and more" * tag 'docs-5.9' of git:// (195 commits) scripts/kernel-doc: optionally treat warnings as errors docs: ia64: correct typo mailmap: add entry for <> doc/zh_CN: add cpu-load Chinese version Documentation/admin-guide: tainted-kernels: fix spelling mistake MAINTAINERS: adjust kprobes.rst entry to new location devices.txt: document rfkill allocation PCI: correct flag name docs: filesystems: vfs: correct flag name docs: filesystems: vfs: correct sync_mode flag names docs: path-lookup: markup fixes for emphasis docs: path-lookup: more markup fixes docs: path-lookup: fix HTML entity mojibake CREDITS: Replace HTTP links with HTTPS ones docs: process: Add an example for creating a fixes tag doc/zh_CN: add Chinese translation prefer section doc/zh_CN: add clearing-warn-once Chinese version doc/zh_CN: add admin-guide index doc:it_IT: process: coding-style.rst: Correct __maybe_unused compiler label futex: MAINTAINERS: Re-add selftests directory ...
2020-07-31Documentation/bpf: Use valid and new links in index.rstTiezhu Yang
There exists an error "404 Not Found" when I click the html link of "Documentation/networking/filter.rst" in the BPF documentation [1], fix it. Additionally, use the new links about "BPF and XDP Reference Guide" and "bpf(2)" to avoid redirects. [1] Fixes: d9b9170a2653 ("docs: bpf: Rename README.rst to index.rst") Fixes: cb3f0d56e153 ("docs: networking: convert filter.txt to ReST") Signed-off-by: Tiezhu Yang <> Signed-off-by: Daniel Borkmann <> Link:
2020-07-25Documentation/bpf: Document CGROUP_STORAGE map typeYiFei Zhu
The machanics and usage are not very straightforward. Given the changes it's better to document how it works and how to use it, rather than having to rely on the examples and implementation to infer what is going on. Signed-off-by: YiFei Zhu <> Signed-off-by: Alexei Starovoitov <> Link:
2020-07-23docs: bpf/bpf_devel_QA.rst: fix reference to nonexistent documentDaniel W. S. Almeida
Fix the following sphinx warning: bpf_devel_QA.rst:444: WARNING: Unknown target name: "documentation/bpf/btf.rst" No target was defined for 'btf.rst' in the document. Fix it. Signed-off-by: Daniel W. S. Almeida <> Link: Signed-off-by: Jonathan Corbet <>
2020-07-23docs: bpf/index.rst: Add ringbuf.rstDaniel W. S. Almeida
Fix the following warning Documentation/bpf/ringbuf.rst: WARNING: document isn't included in any toctree By adding it to the index. Signed-off-by: Daniel W. S. Almeida <> Link: Signed-off-by: Jonathan Corbet <>
2020-07-13bpf: Add info about .BTF_ids section to btf.rstJiri Olsa
Updating btf.rst doc with info about .BTF_ids section Signed-off-by: Jiri Olsa <> Signed-off-by: Alexei Starovoitov <> Tested-by: Andrii Nakryiko <> Acked-by: Andrii Nakryiko <> Link:
2020-06-17bpf: Document optval > PAGE_SIZE behavior for sockopt hooksStanislav Fomichev
Extend existing doc with more details about requiring ctx->optlen = 0 for handling optval > PAGE_SIZE. Signed-off-by: Stanislav Fomichev <> Signed-off-by: Alexei Starovoitov <> Link:
2020-06-01docs/bpf: Add BPF ring buffer design notesAndrii Nakryiko
Add commit description from patch #1 as a stand-alone documentation under Documentation/bpf, as it might be more convenient format, in long term perspective. Suggested-by: Stanislav Fomichev <> Signed-off-by: Andrii Nakryiko <> Signed-off-by: Daniel Borkmann <> Link: Signed-off-by: Alexei Starovoitov <>
2020-05-23selftests/bpf: Add general instructions for test executionAlan Maguire
Getting a clean BPF selftests run involves ensuring latest trunk LLVM/clang are used, pahole is recent (>=1.16) and config matches the specified config file as closely as possible. Add to bpf_devel_QA.rst and point tools/testing/selftests/bpf/README.rst to it. Signed-off-by: Alan Maguire <> Signed-off-by: Daniel Borkmann <> Acked-by: Andrii Nakryiko <> Link:
2020-04-28docs: networking: convert filter.txt to ReSTMauro Carvalho Chehab
- add SPDX header; - adjust title markup; - mark code blocks and literals as such; - use footnote markup; - mark tables as such; - adjust identation, whitespaces and blank lines; - add to networking/index.rst. Signed-off-by: Mauro Carvalho Chehab <> Signed-off-by: David S. Miller <>
2020-03-30bpf: lsm: Add DocumentationKP Singh
Document how eBPF programs (BPF_PROG_TYPE_LSM) can be loaded and attached (BPF_LSM_MAC) to the LSM hooks. Signed-off-by: KP Singh <> Signed-off-by: Daniel Borkmann <> Reviewed-by: Brendan Jackman <> Reviewed-by: Florent Revest <> Reviewed-by: Thomas Garnier <> Reviewed-by: James Morris <> Link:
2020-03-26bpf: Document bpf_inspect drgn toolAndrey Ignatov
It's a follow-up for discussion in [1]. drgn tool was merged to drgn repo in [2]. Document it in kernel tree to make BPF developers aware that the tool exists and can help with getting BPF state unavailable via UAPI. For now it's just one tool but the doc is written in a way that allows to cover more tools in the future if needed. Please refer to the doc itself for more details. The patch was tested by `make htmldocs` and sanity-checking that resulting html looks good. v2 -> v3: - two sections: "Description" and "Getting started" (Daniel); - add examples in "Getting started" section (Daniel); - add "Customization" section to show how tool can be customized. v1 -> v2: - better "BPF drgn tools" section (Alexei) [1] [2] Signed-off-by: Andrey Ignatov <> Signed-off-by: Daniel Borkmann <> Link:
2020-02-20docs/bpf: Update bpf development Q/A fileYonghong Song
bpf now has its own mailing list Update the bpf_devel_QA.rst file to reflect this. Also llvm has switch to github with llvm and clang in the same repo Update the QA file with newer build instructions. Signed-off-by: Yonghong Song <> Signed-off-by: Alexei Starovoitov <> Acked-by: Song Liu <> Link:
2019-10-30bpf: Add s390 testing documentationIlya Leoshkevich
This commits adds a document that explains how to test BPF in an s390 QEMU guest. Signed-off-by: Ilya Leoshkevich <> Signed-off-by: Daniel Borkmann <> Link:
2019-10-07bpf/flow_dissector: add mode to enforce global BPF flow dissectorStanislav Fomichev
Always use init_net flow dissector BPF program if it's attached and fall back to the per-net namespace one. Also, deny installing new programs if there is already one attached to the root namespace. Users can still detach their BPF programs, but can't attach any new ones (-EEXIST). Cc: Petar Penkov <> Acked-by: Andrii Nakryiko <> Acked-by: Song Liu <> Signed-off-by: Stanislav Fomichev <> Signed-off-by: Alexei Starovoitov <>
2019-07-25bpf/flow_dissector: document flagsStanislav Fomichev
Describe what each input flag does and who uses it. Acked-by: Petar Penkov <> Acked-by: Willem de Bruijn <> Acked-by: Song Liu <> Cc: Song Liu <> Cc: Willem de Bruijn <> Cc: Petar Penkov <> Signed-off-by: Stanislav Fomichev <> Signed-off-by: Alexei Starovoitov <>
2019-07-11Merge git:// Torvalds
Pull networking updates from David Miller: "Some highlights from this development cycle: 1) Big refactoring of ipv6 route and neigh handling to support nexthop objects configurable as units from userspace. From David Ahern. 2) Convert explored_states in BPF verifier into a hash table, significantly decreased state held for programs with bpf2bpf calls, from Alexei Starovoitov. 3) Implement bpf_send_signal() helper, from Yonghong Song. 4) Various classifier enhancements to mvpp2 driver, from Maxime Chevallier. 5) Add aRFS support to hns3 driver, from Jian Shen. 6) Fix use after free in inet frags by allocating fqdirs dynamically and reworking how rhashtable dismantle occurs, from Eric Dumazet. 7) Add act_ctinfo packet classifier action, from Kevin Darbyshire-Bryant. 8) Add TFO key backup infrastructure, from Jason Baron. 9) Remove several old and unused ISDN drivers, from Arnd Bergmann. 10) Add devlink notifications for flash update status to mlxsw driver, from Jiri Pirko. 11) Lots of kTLS offload infrastructure fixes, from Jakub Kicinski. 12) Add support for mv88e6250 DSA chips, from Rasmus Villemoes. 13) Various enhancements to ipv6 flow label handling, from Eric Dumazet and Willem de Bruijn. 14) Support TLS offload in nfp driver, from Jakub Kicinski, Dirk van der Merwe, and others. 15) Various improvements to axienet driver including converting it to phylink, from Robert Hancock. 16) Add PTP support to sja1105 DSA driver, from Vladimir Oltean. 17) Add mqprio qdisc offload support to dpaa2-eth, from Ioana Radulescu. 18) Add devlink health reporting to mlx5, from Moshe Shemesh. 19) Convert stmmac over to phylink, from Jose Abreu. 20) Add PTP PHC (Physical Hardware Clock) support to mlxsw, from Shalom Toledo. 21) Add nftables SYNPROXY support, from Fernando Fernandez Mancera. 22) Convert tcp_fastopen over to use SipHash, from Ard Biesheuvel. 23) Track spill/fill of constants in BPF verifier, from Alexei Starovoitov. 24) Support bounded loops in BPF, from Alexei Starovoitov. 25) Various page_pool API fixes and improvements, from Jesper Dangaard Brouer. 26) Just like ipv4, support ref-countless ipv6 route handling. From Wei Wang. 27) Support VLAN offloading in aquantia driver, from Igor Russkikh. 28) Add AF_XDP zero-copy support to mlx5, from Maxim Mikityanskiy. 29) Add flower GRE encap/decap support to nfp driver, from Pieter Jansen van Vuuren. 30) Protect against stack overflow when using act_mirred, from John Hurley. 31) Allow devmap map lookups from eBPF, from Toke Høiland-Jørgensen. 32) Use page_pool API in netsec driver, Ilias Apalodimas. 33) Add Google gve network driver, from Catherine Sullivan. 34) More indirect call avoidance, from Paolo Abeni. 35) Add kTLS TX HW offload support to mlx5, from Tariq Toukan. 36) Add XDP_REDIRECT support to bnxt_en, from Andy Gospodarek. 37) Add MPLS manipulation actions to TC, from John Hurley. 38) Add sending a packet to connection tracking from TC actions, and then allow flower classifier matching on conntrack state. From Paul Blakey. 39) Netfilter hw offload support, from Pablo Neira Ayuso" * git:// (2080 commits) net/mlx5e: Return in default case statement in tx_post_resync_params mlx5: Return -EINVAL when WARN_ON_ONCE triggers in mlx5e_tls_resync(). net: dsa: add support for BRIDGE_MROUTER attribute pkt_sched: Include const.h net: netsec: remove static declaration for netsec_set_tx_de() net: netsec: remove superfluous if statement netfilter: nf_tables: add hardware offload support net: flow_offload: rename tc_cls_flower_offload to flow_cls_offload net: flow_offload: add flow_block_cb_is_busy() and use it net: sched: remove tcf block API drivers: net: use flow block API net: sched: use flow block API net: flow_offload: add flow_block_cb_{priv, incref, decref}() net: flow_offload: add list handling functions net: flow_offload: add flow_block_cb_alloc() and flow_block_cb_free() net: flow_offload: rename TCF_BLOCK_BINDER_TYPE_* to FLOW_BLOCK_BINDER_TYPE_* net: flow_offload: rename TC_BLOCK_{UN}BIND to FLOW_BLOCK_{UN}BIND net: flow_offload: add flow_block_cb_setup_simple() net: hisilicon: Add an tx_desc to adapt HI13X1_GMAC net: hisilicon: Add an rx_desc to adapt HI13X1_GMAC ...
2019-06-27bpf: add sockopt documentationStanislav Fomichev
Provide user documentation about sockopt prog type and cgroup hooks. v9: * add details about setsockopt context and inheritance v7: * add description for retval=0 and optlen=-1 v6: * describe cgroup chaining, add example v2: * use return code 2 for kernel bypass Cc: Andrii Nakryiko <> Cc: Martin Lau <> Signed-off-by: Stanislav Fomichev <> Signed-off-by: Alexei Starovoitov <>
2019-06-14Merge tag 'v5.2-rc4' into mauroJonathan Corbet
We need to pick up post-rc1 changes to various document files so they don't get lost in Mauro's massive RST conversion push.
2019-06-08docs: bpf: get rid of two warningsMauro Carvalho Chehab
Documentation/bpf/btf.rst:154: WARNING: Unexpected indentation. Documentation/bpf/btf.rst:163: WARNING: Unexpected indentation. Signed-off-by: Mauro Carvalho Chehab <> Acked-by: Song Liu <> Signed-off-by: Jonathan Corbet <>
2019-05-31bpf: doc: update answer for 32-bit subregister questionJiong Wang
There has been quite a few progress around the two steps mentioned in the answer to the following question: Q: BPF 32-bit subregister requirements This patch updates the answer to reflect what has been done. v2: - Add missing full stop. (Song Liu) - Minor tweak on one sentence. (Song Liu) v1: - Integrated rephrase from Quentin and Jakub Reviewed-by: Quentin Monnet <> Reviewed-by: Jakub Kicinski <> Signed-off-by: Jiong Wang <> Acked-by: Song Liu <> Signed-off-by: Alexei Starovoitov <>
2019-05-14bpf: btf: fix the brackets of BTF_INT_OFFSET()Gary Lin
'VAL' should be protected by the brackets. v2: * Squash the fix for Documentation/bpf/btf.rst Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") Signed-off-by: Gary Lin <> Signed-off-by: Daniel Borkmann <>
2019-05-09docs/btf: fix the missing section marksGary Lin
The section titles of 3.4 and 3.5 are not marked correctly. Signed-off-by: Gary Lin <> Signed-off-by: Alexei Starovoitov <>
2019-04-23bpf: document the verifier limitsAlexei Starovoitov
Document the verifier limits. Signed-off-by: Alexei Starovoitov <> Acked-by: Yonghong Song <> Signed-off-by: Daniel Borkmann <>
2019-04-18bpf: move BPF_PROG_TYPE_FLOW_DISSECTOR documentation to a new common placeStanislav Fomichev
In commit da7031491786 ("bpf: Document BPF_PROG_TYPE_CGROUP_SYSCTL") Andrey proposes to put per-prog type docs under Documentation/bpf/ Let's move flow dissector documentation there as well. Signed-off-by: Stanislav Fomichev <> Signed-off-by: Alexei Starovoitov <>
2019-04-18bpf: Document BPF_PROG_TYPE_CGROUP_SYSCTLAndrey Ignatov
Add documentation for BPF_PROG_TYPE_CGROUP_SYSCTL, including general info, attach type, context, return code, helpers, example and usage considerations. A separate file prog_cgroup_sysctl.rst is added to Documentation/bpf/. In the future more program types can be documented in their own prog_<name>.rst files. Another way to place program type specific documentation would be to group program types somehow (e.g. cgroup.rst for all cgroup-bpf programs), but it may not scale well since some program types may belong to different groups, e.g. BPF_PROG_TYPE_CGROUP_SKB can be documented together with either cgroup-bpf programs or programs that access skb. The new file is added to the index and verified by `make htmldocs` / sanity-check by lynx. Signed-off-by: Andrey Ignatov <> Acked-by: Yonghong Song <> Signed-off-by: Alexei Starovoitov <>
2019-04-11Merge git:// S. Miller
Daniel Borkmann says: ==================== pull-request: bpf-next 2019-04-12 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Improve BPF verifier scalability for large programs through two optimizations: i) remove verifier states that are not useful in pruning, ii) stop walking parentage chain once first LIVE_READ is seen. Combined gives approx 20x speedup. Increase limits for accepting large programs under root, and add various stress tests, from Alexei. 2) Implement global data support in BPF. This enables static global variables for .data, .rodata and .bss sections to be properly handled which allows for more natural program development. This also opens up the possibility to optimize program workflow by compiling ELFs only once and later only rewriting section data before reload, from Daniel and with test cases and libbpf refactoring from Joe. 3) Add config option to generate BTF type info for vmlinux as part of the kernel build process. DWARF debug info is converted via pahole to BTF. Latter relies on libbpf and makes use of BTF deduplication algorithm which results in 100x savings compared to DWARF data. Resulting .BTF section is typically about 2MB in size, from Andrii. 4) Add BPF verifier support for stack access with variable offset from helpers and add various test cases along with it, from Andrey. 5) Extend bpf_skb_adjust_room() growth BPF helper to mark inner MAC header so that L2 encapsulation can be used for tc tunnels, from Alan. 6) Add support for input __sk_buff context in BPF_PROG_TEST_RUN so that users can define a subset of allowed __sk_buff fields that get fed into the test program, from Stanislav. 7) Add bpf fs multi-dimensional array tests for BTF test suite and fix up various UBSAN warnings in bpftool, from Yonghong. 8) Generate a pkg-config file for libbpf, from Luca. 9) Dump program's BTF id in bpftool, from Prashant. 10) libbpf fix to use smaller BPF log buffer size for AF_XDP's XDP program, from Magnus. 11) kallsyms related fixes for the case when symbols are not present in BPF selftests and samples, from Daniel ==================== Signed-off-by: David S. Miller <>
2019-04-09bpf: add specification for BTF Var and DataSec kindsDaniel Borkmann
This adds the BTF specification and UAPI bits for supporting BTF Var and DataSec kinds. This is following LLVM upstream commit ac4082b77e07 ("[BPF] Add BTF Var and DataSec Support") which has been merged recently. Var itself is for describing a global variable and DataSec to describe ELF sections e.g. data/bss/rodata sections that hold one or multiple global variables. Signed-off-by: Daniel Borkmann <> Acked-by: Martin KaFai Lau <> Signed-off-by: Alexei Starovoitov <>
2019-03-26bpf, doc: fix BTF docs reflow of bullet listJesper Dangaard Brouer
Section 2.2.1 BTF_KIND_INT a bullet list was collapsed due to text reflow in commit 9ab5305dbe3f ("docs/btf: reflow text to fill up to 78 characters"). This patch correct the mistake. Also adjust next bullet list, which is used for comparison, to get rendered the same way. Fixes: 9ab5305dbe3f ("docs/btf: reflow text to fill up to 78 characters") Link: Signed-off-by: Jesper Dangaard Brouer <> Acked-by: Andrii Nakryiko <> Signed-off-by: Alexei Starovoitov <>
2019-03-02docs/bpf: minor casing/punctuation fixesAndrii Nakryiko
Fix few casing and punctuation glitches. Signed-off-by: Andrii Nakryiko <> Signed-off-by: Daniel Borkmann <>
2019-03-02docs/btf: reflow text to fill up to 78 charactersAndrii Nakryiko
Reflow paragraphs to more fully and evenly fill 78 character lines. Signed-off-by: Andrii Nakryiko <> Acked-by: Yonghong Song <> Signed-off-by: Daniel Borkmann <>
2019-03-02docs/btf: fix typos, improve wordingAndrii Nakryiko
Fix various typos, some of the formatting and wording for Documentation/btf.rst. Signed-off-by: Andrii Nakryiko <> Acked-by: Yonghong Song <> Signed-off-by: Daniel Borkmann <>
2019-01-22bpf: btf: add btf documentationYonghong Song
This patch added documentation for BTF (BPF Debug Format). The document is placed under linux:Documentation/bpf directory. Signed-off-by: Yonghong Song <> Signed-off-by: Alexei Starovoitov <>