BPF Features by Linux Kernel Version

eBPF support

Kernel versionCommit
3.15bd4cf0ed331a

JIT compiling

The list of supported architectures for your kernel can be retrieved with:

git grep HAVE_EBPF_JIT arch/
Feature / ArchitectureKernel versionCommit
x86_643.16622582786c9e
ARM643.18e54bcde3d69d
s3904.1054623105728
Constant blinding for JIT machines4.74f3446bb809f
PowerPC644.8156d0e290e96
Constant blinding - PowerPC644.9b7b7013cac55
Sparc644.127a12b5031c6b
MIPS4.13f381bf6d82f0
ARM324.1439c13c204bb1
x86_324.1803f5781be2c7

Main features

Several (but not all) of these main features translate to an eBPF program type. The list of such program types supported in your kernel can be found in file include/uapi/linux/bpf.h:

git grep -W 'bpf_prog_type {' include/uapi/linux/bpf.h
FeatureKernel versionCommit
AF_PACKET (libpcap/tcpdump, cls_bpf classifier, netfilter‘s xt_bpf, team driver’s load-balancing mode…)3.15bd4cf0ed331a
Kernel helpers3.15bd4cf0ed331a
bpf() syscall3.1899c55f7d47c0
Tables (a.k.a. Maps; details below)3.1899c55f7d47c0
BPF attached to sockets3.1989aa075832b0
BPF attached to kprobes4.12541517c32be
cls_bpf / act_bpf for tc4.1e2e9b6541dd4
Tail calls4.204fd61ab36ec
Non-root programs on sockets4.41be7f75d1668
Persistent maps and programs (virtual FS)4.4b2197755b263
tc's direct-action (da) mode4.4045efa82ff56
tc's clsact qdisc4.51f211a1b929c
BPF attached to tracepoints4.798b5c2c65c29
Direct packet access4.7969bf05eb3ce
XDP (see below)4.86a773a15a1e8
BPF attached to perf events4.90515e5999a46
Hardware offload for tc's cls_bpf4.9332ae8e2f6ec
Verifier exposure and internal hooks4.913a27dfc6697
BPF attached to cgroups for socket filtering4.100e33661de493
Lightweight tunnel encapsulation4.103a0af8fd61f9
eBPF support for xt_bpf module (iptables)4.102c16d6033264
BPF program tag4.107bd509e311f4
Tracepoints to debug BPF4.11 (removed in 4.18)a67edbf4fb6d 4d220ed0f814
Testing / benchmarking BPF programs4.121cf1cae963c2
BPF programs and maps IDs4.13dc4bb0e23561
BPF support for sock_ops4.1340304b2a1567
BPF support for skbs on sockets4.14b005fd189cec
bpftool utility in kernel sources4.1571bb428fe2c1
BPF attached to cgroups as device controller4.15ebc614f68736
bpf2bpf function calls4.16cc8b0b92a169
BPF used for monitoring socket RX/TX data4.174f738adba30a
BPF attached to raw tracepoints4.17c4f6699dfcb8
BPF attached to bind() system call4.174fbac77d2d09
BPF Type Format (BTF)4.1869b693f0aefa
AF_XDP4.18fbfc504a24f5
bpfilter4.18d2ba09c17a06
End.BPF action for seg6local LWT4.18004d4b274e2a
BPF attached to LIRC devices4.18f4364dcfc86d

Tables (a.k.a. Maps)

The list of map types supported in your kernel can be found in file include/uapi/linux/bpf.h:

git grep -W 'bpf_map_type {' include/uapi/linux/bpf.h
Table typeKernel versionCommit
Hash3.190f8e4bd8a1fc
Array3.1928fbcfa08d8e
Tail call (PROG_ARRAY)4.204fd61ab36ec
Perf events4.3ea317b267e9d
Per-CPU hash4.6824bd0ce6c7c
Per-CPU array4.6a10423b87a7e
Stack trace4.6d5a3b1f69186
Pre-alloc maps memory4.66c9059817432
cgroup array4.84ed8ec521ed5
LRU hash4.1029ba732acbee 3a08c2fd7634
LRU per-CPU hash4.108f8449384ec3 961578b63474
LPM trie (longest-prefix match)4.11b95a5c4db09b
Array of maps4.1256f668dfe00d
Hash of maps4.12bcc6b1b7ebf8
Netdevice references4.14546ac1ffb70d
Socket references (array)4.14174a79ff9515
CPU references4.156710e1126934
AF_XDP socket (XSK) references4.18fbfc504a24f5
Socket references (hashmap)4.1881110384441a
cgroup storage4.19de9cbbaadba5
reuseport sockarray4.195dc4c4b7d4e8
precpu cgroup storage4.20b741f1630346
queue4.20f1a2e44a3aec
stack4.20f1a2e44a3aec

XDP

An approximate list of drivers or components supporting XDP programs for your kernel can be retrieved with:

git grep -l XDP_SETUP_PROG drivers/
Feature / DriverKernel versionCommit
XDP core architecture4.86a773a15a1e8
Action: drop4.86a773a15a1e8
Action: pass on to stack4.86a773a15a1e8
Action: direct forwarding (on same port)4.86ce96ca348a9
Direct packet data write4.84acf6c0b84c9
Mellanox mlx4 driver4.847a38e155037
Mellanox mlx5 driver4.986994156c736
Netronome nfp driver4.10ecd63a0217d5
QLogic (Cavium) qed* drivers4.10496e05170958
virtio_net driver4.10f600b6905015
Broadcom bnxt_en driver4.11c6d30e8391b8
Intel ixgbe* drivers4.12924708081629
Cavium thunderx driver4.1205c773f52b96
Generic XDP4.12b5cdae3291f7
Intel i40e driver4.130c8493d90b6b
Action: redirect4.146453073987ba
Support for tap4.14761876c857cb
Support for veth4.14d445516966dc
Intel e1000 driverNot upstream yet
Intel e1000e driverNot planned for upstream at this time

Helpers

The list of helpers supported in your kernel can be found in file include/uapi/linux/bpf.h:

git grep '	FN(' include/uapi/linux/bpf.h

Alphabetical order

HelperKernel versionLicenseCommit
BPF_FUNC_bind()4.17d74bad4e74ee
BPF_FUNC_clone_redirect()4.23896d655f4d4
BPF_FUNC_csum_diff()4.67d672345ed29
BPF_FUNC_csum_update()4.936bbef52c7eb
BPF_FUNC_current_task_under_cgroup()4.960d20f9195b2
BPF_FUNC_fib_lookup()4.18GPL87f5fc7e48dd
BPF_FUNC_get_cgroup_classid()4.38d20aabe1c76
BPF_FUNC_get_current_cgroup_id()4.18bf6fa2c893c5
BPF_FUNC_get_current_comm()4.2ffeedafbf023
BPF_FUNC_get_current_pid_tgid()4.2ffeedafbf023
BPF_FUNC_get_current_task()4.8GPL606274c5abd8
BPF_FUNC_get_current_uid_gid()4.2ffeedafbf023
BPF_FUNC_get_hash_recalc()4.813c5c240f789
BPF_FUNC_get_local_storage()4.19cd3394317653
BPF_FUNC_get_numa_node_id()4.102d0e30c30f84
BPF_FUNC_get_prandom_u32()4.103e69b508b6f
BPF_FUNC_get_route_realm()4.4c46646d0484f
BPF_FUNC_get_smp_processor_id()4.1c04167ce2ca0
BPF_FUNC_get_socket_cookie()4.1291b8270f2a4d
BPF_FUNC_get_socket_uid()4.126acc5c291068
BPF_FUNC_get_stack()4.18GPLde2ff05f48af
BPF_FUNC_get_stackid()4.6GPLd5a3b1f69186
BPF_FUNC_getsockopt()4.15cd86d1fd2102
BPF_FUNC_ktime_get_ns()4.1GPLd9847d310ab4
BPF_FUNC_l3_csum_replace()4.191bc4822c3d6
BPF_FUNC_l4_csum_replace()4.191bc4822c3d6
BPF_FUNC_lwt_push_encap()4.18fe94cc290f53
BPF_FUNC_lwt_seg6_action()4.18fe94cc290f53
BPF_FUNC_lwt_seg6_adjust_srh()4.18fe94cc290f53
BPF_FUNC_lwt_seg6_store_bytes()4.18fe94cc290f53
BPF_FUNC_map_delete_elem()3.19d0003ec01c66
BPF_FUNC_map_lookup_elem()3.19d0003ec01c66
BPF_FUNC_map_peek_elem()3.20f1a2e44a3aec
BPF_FUNC_map_pop_elem()3.20f1a2e44a3aec
BPF_FUNC_map_push_elem()3.20f1a2e44a3aec
BPF_FUNC_map_update_elem()3.19d0003ec01c66
BPF_FUNC_msg_apply_bytes()4.172a100317c9eb
BPF_FUNC_msg_cork_bytes()4.1791843d540a13
BPF_FUNC_msg_pull_data()4.17015632bb30da
BPF_FUNC_msg_push_data()4.206fff607e2f14
BPF_FUNC_msg_redirect_hash()4.1881110384441a
BPF_FUNC_msg_redirect_map()4.174f738adba30a
BPF_FUNC_perf_event_output()4.4GPLa43eec304259
BPF_FUNC_perf_event_read()4.3GPL35578d798400
BPF_FUNC_perf_event_read_value()4.15GPL908432ca84fc
BPF_FUNC_perf_prog_read_value()4.15GPL4bebdc7a85aa
BPF_FUNC_probe_read()4.1GPL2541517c32be
BPF_FUNC_probe_read_str()4.11GPLa5e8c07059d0
BPF_FUNC_probe_write_user()4.8GPL96ae52279594
BPF_FUNC_rc_keydown()4.18GPLf4364dcfc86d
BPF_FUNC_rc_repeat()4.18GPLf4364dcfc86d
BPF_FUNC_redirect()4.427b29f63058d
BPF_FUNC_redirect_map()4.1497f91a7cf04f
BPF_FUNC_set_hash()4.13ded092cd73c2
BPF_FUNC_set_hash_invalid()4.97a4b28c6cc9f
BPF_FUNC_setsockopt()4.138c4b4c7e9ff0
BPF_FUNC_sk_lookup_tcp()4.206acc9b432e67
BPF_FUNC_sk_lookup_udp()4.206acc9b432e67
BPF_FUNC_sk_redirect_hash()4.1881110384441a
BPF_FUNC_sk_redirect_map()4.14174a79ff9515
BPF_FUNC_sk_release()4.206acc9b432e67
BPF_FUNC_sk_select_reuseport()4.192dbb9b9e6df6
BPF_FUNC_skb_adjust_room()4.132be7e212d541
BPF_FUNC_skb_ancestor_cgroup_id()4.197723628101aa
BPF_FUNC_skb_change_head()4.103a0af8fd61f9
BPF_FUNC_skb_change_proto()4.86578171a7ff0
BPF_FUNC_skb_change_tail()4.95293efe62df8
BPF_FUNC_skb_change_type()4.8d2485c4242a8
BPF_FUNC_skb_cgroup_id()4.18cb20b08ead40
BPF_FUNC_skb_get_tunnel_key()4.3d3aa45ce6b94
BPF_FUNC_skb_get_tunnel_opt()4.614ca0751c96f
BPF_FUNC_skb_get_xfrm_state()4.1812bed760a78d
BPF_FUNC_skb_load_bytes()4.505c74e5e53f6
BPF_FUNC_skb_load_bytes_relative()4.184e1ec56cdc59
BPF_FUNC_skb_pull_data()4.936bbef52c7eb
BPF_FUNC_skb_set_tunnel_key()4.3d3aa45ce6b94
BPF_FUNC_skb_set_tunnel_opt()4.614ca0751c96f
BPF_FUNC_skb_store_bytes()4.191bc4822c3d6
BPF_FUNC_skb_under_cgroup()4.84a482f34afcc
BPF_FUNC_skb_vlan_pop()4.34e10df9a60d9
BPF_FUNC_skb_vlan_push()4.34e10df9a60d9
BPF_FUNC_sock_hash_update()4.1881110384441a
BPF_FUNC_sock_map_update()4.14174a79ff9515
BPF_FUNC_tail_call()4.204fd61ab36ec
BPF_FUNC_trace_printk()4.1GPL9c959c863f82
BPF_FUNC_xdp_adjust_head()4.1017bedab27231
BPF_FUNC_xdp_adjust_meta()4.15de8f3a83b0a0
BPF_FUNC_xdp_adjust_tail()4.18b32cc5b9a346
BPF_FUNC_override_return()4.16GPL9802d86585db
BPF_FUNC_sock_ops_cb_flags_set()4.16b13d88072172

Note: GPL-only BPF helpers require a GPL-compatible license. The current licenses considered GPL-compatible by the kernel are:

  • GPL
  • GPL v2
  • GPL and additional rights
  • Dual BSD/GPL
  • Dual MIT/GPL
  • Dual MPL/GPL

Check the list of GPL-compatible licenses in your kernel source code.

Program Types

The list of program types and supported helper functions can be retrieved with:

git grep -W 'func_proto(enum bpf_func_id func_id' kernel/ net/ drivers/
Program TypeHelper Functions
BPF_PROG_TYPE_SOCKET_FILTERBPF_FUNC_get_current_uid_gid()
Base functions
BPF_PROG_TYPE_KPROBEBPF_FUNC_perf_event_output()
BPF_FUNC_get_stackid()
BPF_FUNC_get_stack()
BPF_FUNC_perf_event_read_value()
BPF_FUNC_override_return()
Tracing functions
BPF_PROG_TYPE_SCHED_CLS
BPF_PROG_TYPE_SCHED_ACT
BPF_FUNC_skb_store_bytes()
BPF_FUNC_skb_load_bytes()
BPF_FUNC_skb_load_bytes_relative()
BPF_FUNC_skb_pull_data()
BPF_FUNC_csum_diff()
BPF_FUNC_csum_update()
BPF_FUNC_l3_csum_replace()
BPF_FUNC_l4_csum_replace()
BPF_FUNC_clone_redirect()
BPF_FUNC_get_cgroup_classid()
BPF_FUNC_skb_vlan_push()
BPF_FUNC_skb_vlan_pop()
BPF_FUNC_skb_change_proto()
BPF_FUNC_skb_change_type()
BPF_FUNC_skb_adjust_room()
BPF_FUNC_skb_change_tail()
BPF_FUNC_skb_get_tunnel_key()
BPF_FUNC_skb_set_tunnel_key()
BPF_FUNC_skb_get_tunnel_opt()
BPF_FUNC_skb_set_tunnel_opt()
BPF_FUNC_redirect()
BPF_FUNC_get_route_realm()
BPF_FUNC_get_hash_recalc()
BPF_FUNC_set_hash_invalid()
BPF_FUNC_set_hash()
BPF_FUNC_perf_event_output()
BPF_FUNC_get_smp_processor_id()
BPF_FUNC_skb_under_cgroup()
BPF_FUNC_get_socket_cookie()
BPF_FUNC_get_socket_uid()
BPF_FUNC_fib_lookup()
BPF_FUNC_skb_get_xfrm_state()
BPF_FUNC_skb_cgroup_id()
Base functions
BPF_PROG_TYPE_TRACEPOINTBPF_FUNC_perf_event_output()
BPF_FUNC_get_stackid()
BPF_FUNC_get_stack()
Tracing functions
BPF_PROG_TYPE_XDPBPF_FUNC_perf_event_output()
BPF_FUNC_get_smp_processor_id()
BPF_FUNC_csum_diff()
BPF_FUNC_xdp_adjust_head()
BPF_FUNC_xdp_adjust_meta()
BPF_FUNC_redirect()
BPF_FUNC_redirect_map()
BPF_FUNC_xdp_adjust_tail()
BPF_FUNC_fib_lookup()
Base functions
BPF_PROG_TYPE_PERF_EVENTBPF_FUNC_perf_event_output()
BPF_FUNC_get_stackid()
BPF_FUNC_get_stack()
BPF_FUNC_perf_prog_read_value()
Tracing functions
BPF_PROG_TYPE_CGROUP_SKBBPF_FUNC_skb_load_bytes()
BPF_FUNC_skb_load_bytes_relative()
BPF_FUNC_get_socket_cookie()
BPF_FUNC_get_socket_uid()
Base functions
BPF_PROG_TYPE_CGROUP_SOCKBPF_FUNC_get_current_uid_gid()
Base functions
BPF_PROG_TYPE_LWT_INBPF_FUNC_lwt_push_encap()
LWT functions
Base functions
BPF_PROG_TYPE_LWT_OUTLWT functions
Base functions
BPF_PROG_TYPE_LWT_XMITBPF_FUNC_skb_get_tunnel_key()
BPF_FUNC_skb_set_tunnel_key()
BPF_FUNC_skb_get_tunnel_opt()
BPF_FUNC_skb_set_tunnel_opt()
BPF_FUNC_redirect()
BPF_FUNC_clone_redirect()
BPF_FUNC_skb_change_tail()
BPF_FUNC_skb_change_head()
BPF_FUNC_skb_store_bytes()
BPF_FUNC_csum_update()
BPF_FUNC_l3_csum_replace()
BPF_FUNC_l4_csum_replace()
BPF_FUNC_set_hash_invalid()
LWT functions
BPF_PROG_TYPE_SOCK_OPSBPF_FUNC_setsockopt()
BPF_FUNC_getsockopt()
BPF_FUNC_sock_ops_cb_flags_set()
BPF_FUNC_sock_map_update()
BPF_FUNC_sock_hash_update()
BPF_FUNC_get_socket_cookie()
Base functions
BPF_PROG_TYPE_SK_SKBBPF_FUNC_skb_store_bytes()
BPF_FUNC_skb_load_bytes()
BPF_FUNC_skb_pull_data()
BPF_FUNC_skb_change_tail()
BPF_FUNC_skb_change_head()
BPF_FUNC_get_socket_cookie()
BPF_FUNC_get_socket_uid()
BPF_FUNC_sk_redirect_map()
BPF_FUNC_sk_redirect_hash()
BPF_FUNC_sk_lookup_tcp()
BPF_FUNC_sk_lookup_udp()
BPF_FUNC_sk_release()
Base functions
BPF_PROG_TYPE_CGROUP_DEVICEBPF_FUNC_map_lookup_elem()
BPF_FUNC_map_update_elem()
BPF_FUNC_map_delete_elem()
BPF_FUNC_get_current_uid_gid()
BPF_FUNC_trace_printk()
BPF_PROG_TYPE_SK_MSGBPF_FUNC_msg_redirect_map()
BPF_FUNC_msg_redirect_hash()
BPF_FUNC_msg_apply_bytes()
BPF_FUNC_msg_cork_bytes()
BPF_FUNC_msg_pull_data()
BPF_FUNC_msg_push_data()
Base functions
BPF_PROG_TYPE_RAW_TRACEPOINTBPF_FUNC_perf_event_output()
BPF_FUNC_get_stackid()
BPF_FUNC_get_stack()
Tracing functions
BPF_PROG_TYPE_CGROUP_SOCK_ADDRBPF_FUNC_get_current_uid_gid()
BPF_FUNC_bind()
BPF_FUNC_get_socket_cookie()
Base functions
BPF_PROG_TYPE_LWT_SEG6LOCALBPF_FUNC_lwt_seg6_store_bytes()
BPF_FUNC_lwt_seg6_action()
BPF_FUNC_lwt_seg6_adjust_srh()
LWT functions
BPF_PROG_TYPE_LIRC_MODE2BPF_FUNC_rc_repeat()
BPF_FUNC_rc_keydown()
BPF_FUNC_map_lookup_elem()
BPF_FUNC_map_update_elem()
BPF_FUNC_map_delete_elem()
BPF_FUNC_ktime_get_ns()
BPF_FUNC_tail_call()
BPF_FUNC_get_prandom_u32()
BPF_FUNC_trace_printk()
BPF_PROG_TYPE_SK_REUSEPORTBPF_FUNC_sk_select_reuseport()
BPF_FUNC_skb_load_bytes()
BPF_FUNC_load_bytes_relative()
Base functions
BPF_PROG_TYPE_FLOW_DISSECTORBPF_FUNC_skb_load_bytes()
Base functions
Function GroupFunctions
Base functionsBPF_FUNC_map_lookup_elem()
BPF_FUNC_map_update_elem()
BPF_FUNC_map_delete_elem()
BPF_FUNC_map_peek_elem()
BPF_FUNC_map_pop_elem()
BPF_FUNC_map_push_elem()
BPF_FUNC_get_prandom_u32()
BPF_FUNC_get_smp_processor_id()
BPF_FUNC_get_numa_node_id()
BPF_FUNC_tail_call()
BPF_FUNC_ktime_get_ns()
BPF_FUNC_trace_printk()
Tracing functionsBPF_FUNC_map_lookup_elem()
BPF_FUNC_map_update_elem()
BPF_FUNC_map_delete_elem()
BPF_FUNC_probe_read()
BPF_FUNC_ktime_get_ns()
BPF_FUNC_tail_call()
BPF_FUNC_get_current_pid_tgid()
BPF_FUNC_get_current_task()
BPF_FUNC_get_current_uid_gid()
BPF_FUNC_get_current_comm()
BPF_FUNC_trace_printk()
BPF_FUNC_get_smp_processor_id()
BPF_FUNC_get_numa_node_id()
BPF_FUNC_perf_event_read()
BPF_FUNC_probe_write_user()
BPF_FUNC_current_task_under_cgroup()
BPF_FUNC_get_prandom_u32()
BPF_FUNC_probe_read_str()
BPF_FUNC_get_current_cgroup_id()
LWT functionsBPF_FUNC_skb_load_bytes()
BPF_FUNC_skb_pull_data()
BPF_FUNC_csum_diff()
BPF_FUNC_get_cgroup_classid()
BPF_FUNC_get_route_realm()
BPF_FUNC_get_hash_recalc()
BPF_FUNC_perf_event_output()
BPF_FUNC_get_smp_processor_id()
BPF_FUNC_skb_under_cgroup()