Skip to content
eBPF Docs
Syscall command 'BPF_PROG_DETACH'
Initializing search
GitHub
eBPF Docs
GitHub
Home
Linux Reference
Linux Reference
Concepts
Concepts
Maps
Verifier
Functions
Concurrency
Pinning
Tail calls
Loops
Timers
Resource Limit
AF_XDP
KFuncs
dynptrs
token
Program types
Program types
Network program types
Network program types
BPF_PROG_TYPE_SOCKET_FILTER
BPF_PROG_TYPE_SCHED_CLS
BPF_PROG_TYPE_SCHED_ACT
BPF_PROG_TYPE_XDP
BPF_PROG_TYPE_SOCK_OPS
BPF_PROG_TYPE_SK_SKB
BPF_PROG_TYPE_SK_MSG
BPF_PROG_TYPE_SK_LOOKUP
BPF_PROG_TYPE_SK_REUSEPORT
BPF_PROG_TYPE_FLOW_DISSECTOR
BPF_PROG_TYPE_NETFILTER
Light weight tunnel program types
Light weight tunnel program types
BPF_PROG_TYPE_LWT_IN
BPF_PROG_TYPE_LWT_OUT
BPF_PROG_TYPE_LWT_XMIT
BPF_PROG_TYPE_LWT_SEG6LOCAL
cGroup program types
cGroup program types
BPF_PROG_TYPE_CGROUP_SKB
BPF_PROG_TYPE_CGROUP_SOCK
BPF_PROG_TYPE_CGROUP_DEVICE
BPF_PROG_TYPE_CGROUP_SOCK_ADDR
BPF_PROG_TYPE_CGROUP_SOCKOPT
BPF_PROG_TYPE_CGROUP_SYSCTL
Tracing program types
Tracing program types
BPF_PROG_TYPE_KPROBE
BPF_PROG_TYPE_TRACEPOINT
BPF_PROG_TYPE_PERF_EVENT
BPF_PROG_TYPE_RAW_TRACEPOINT
BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
BPF_PROG_TYPE_TRACING
BPF_PROG_TYPE_LIRC_MODE2
BPF_PROG_TYPE_LSM
BPF_PROG_TYPE_EXT
BPF_PROG_TYPE_STRUCT_OPS
BPF_PROG_TYPE_SYSCALL
Map types
Map types
Generic map types
Generic map types
BPF_MAP_TYPE_HASH
BPF_MAP_TYPE_ARRAY
BPF_MAP_TYPE_PERCPU_HASH
BPF_MAP_TYPE_PERCPU_ARRAY
BPF_MAP_TYPE_QUEUE
BPF_MAP_TYPE_STACK
BPF_MAP_TYPE_LRU_HASH
BPF_MAP_TYPE_LRU_PERCPU_HASH
BPF_MAP_TYPE_LPM_TRIE
BPF_MAP_TYPE_BLOOM_FILTER
BPF_MAP_TYPE_ARENA
Map in map
Map in map
BPF_MAP_TYPE_ARRAY_OF_MAPS
BPF_MAP_TYPE_HASH_OF_MAPS
Streaming
Streaming
BPF_MAP_TYPE_PERF_EVENT_ARRAY
BPF_MAP_TYPE_RINGBUF
BPF_MAP_TYPE_USER_RINGBUF
Packet redirection
Packet redirection
BPF_MAP_TYPE_DEVMAP
BPF_MAP_TYPE_SOCKMAP
BPF_MAP_TYPE_CPUMAP
BPF_MAP_TYPE_XSKMAP
BPF_MAP_TYPE_SOCKHASH
BPF_MAP_TYPE_DEVMAP_HASH
BPF_MAP_TYPE_REUSEPORT_SOCKARRAY
Flow redirection
Flow redirection
BPF_MAP_TYPE_PROG_ARRAY
Object attached storage
Object attached storage
BPF_MAP_TYPE_CGROUP_STORAGE
BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE
BPF_MAP_TYPE_SK_STORAGE
BPF_MAP_TYPE_INODE_STORAGE
BPF_MAP_TYPE_TASK_STORAGE
BPF_MAP_TYPE_CGRP_STORAGE
Misc
Misc
BPF_MAP_TYPE_CGROUP_ARRAY
BPF_MAP_TYPE_STACK_TRACE
BPF_MAP_TYPE_STRUCT_OPS
Helper functions
Helper functions
Map helpers
Map helpers
Generic map helpers
Generic map helpers
bpf_map_lookup_elem
bpf_map_update_elem
bpf_map_delete_elem
bpf_for_each_map_elem
bpf_map_lookup_percpu_elem
bpf_spin_lock
bpf_spin_unlock
Perf event array helpers
Perf event array helpers
bpf_perf_event_read
bpf_perf_event_output
bpf_perf_event_read_value
bpf_skb_output
bpf_xdp_output
Tail call helpers
Tail call helpers
bpf_tail_call
Timer helpers
Timer helpers
bpf_timer_init
bpf_timer_set_callback
bpf_timer_start
bpf_timer_cancel
Queue and stack helpers
Queue and stack helpers
bpf_map_push_elem
bpf_map_pop_elem
bpf_map_peek_elem
Ring buffer helper
Ring buffer helper
bpf_ringbuf_output
bpf_ringbuf_reserve
bpf_ringbuf_submit
bpf_ringbuf_discard
bpf_ringbuf_query
bpf_ringbuf_reserve_dynptr
bpf_ringbuf_submit_dynptr
bpf_ringbuf_discard_dynptr
Socket map helpers
Socket map helpers
bpf_sock_map_update
Socket hash helpers
Socket hash helpers
bpf_sock_hash_update
Task storage helpers
Task storage helpers
bpf_task_storage_get
bpf_task_storage_delete
Inode storage helpers
Inode storage helpers
bpf_inode_storage_get
bpf_inode_storage_delete
Socket storage helpers
Socket storage helpers
bpf_sk_storage_get
bpf_sk_storage_delete
Local cGroup storage helpers
Local cGroup storage helpers
bpf_get_local_storage
Global cGroup storage helpers
Global cGroup storage helpers
bpf_cgrp_storage_get
bpf_cgrp_storage_delete
User ring buffer
User ring buffer
bpf_user_ringbuf_drain
Probe and trace helpers
Probe and trace helpers
bpf_get_attach_cookie
Memory helpers
Memory helpers
bpf_probe_read
bpf_probe_write_user
bpf_probe_read_str
bpf_get_stack
bpf_probe_read_user
bpf_probe_read_kernel
bpf_probe_read_user_str
bpf_probe_read_kernel_str
bpf_copy_from_user
bpf_copy_from_user_task
bpf_copy_from_user_task
bpf_find_vma
Process influencing helpers
Process influencing helpers
bpf_override_return
bpf_get_retval
bpf_set_retval
bpf_send_signal
bpf_send_signal_thread
Tracing helpers
Tracing helpers
bpf_get_func_ip
bpf_get_func_arg
bpf_get_func_ret
bpf_get_func_arg_cnt
bpf_sock_from_file
Perf event program helpers
Perf event program helpers
bpf_perf_prog_read_value
Information helpers
Information helpers
Time helpers
Time helpers
bpf_ktime_get_ns
bpf_jiffies64
bpf_ktime_get_boot_ns
bpf_ktime_get_coarse_ns
bpf_ktime_get_tai_ns
Process info helpers
Process info helpers
bpf_get_current_pid_tgid
bpf_get_current_uid_gid
bpf_get_current_comm
bpf_get_cgroup_classid
bpf_get_ns_current_pid_tgid
bpf_get_current_task
bpf_get_stackid
bpf_current_task_under_cgroup
bpf_get_current_cgroup_id
bpf_get_current_ancestor_cgroup_id
bpf_get_task_stack
bpf_get_current_task_btf
bpf_task_pt_regs
CPU info helpers
CPU info helpers
bpf_get_smp_processor_id
bpf_get_numa_node_id
bpf_read_branch_records
bpf_get_branch_snapshot
bpf_per_cpu_ptr
bpf_this_cpu_ptr
Print helpers
Print helpers
bpf_trace_printk
bpf_snprintf
bpf_snprintf_btf
bpf_trace_vprintk
Iterator print helpers
Iterator print helpers
bpf_seq_printf
bpf_seq_write
bpf_seq_printf_btf
Network helpers
Network helpers
bpf_get_netns_cookie
bpf_check_mtu
bpf_get_route_realm
bpf_fib_lookup
Socket buffer helpers
Socket buffer helpers
bpf_skb_store_bytes
bpf_skb_load_bytes
bpf_skb_vlan_push
bpf_skb_vlan_pop
bpf_skb_get_tunnel_key
bpf_skb_set_tunnel_key
bpf_skb_get_tunnel_opt
bpf_skb_set_tunnel_opt
bpf_skb_change_proto
bpf_skb_change_type
bpf_skb_under_cgroup
bpf_skb_change_tail
bpf_skb_pull_data
bpf_skb_adjust_room
bpf_skb_change_head
bpf_skb_get_xfrm_state
bpf_skb_load_bytes_relative
bpf_skb_cgroup_id
bpf_skb_ancestor_cgroup_id
bpf_skb_ecn_set_ce
bpf_skb_cgroup_classid
bpf_skb_set_tstamp
bpf_set_hash
bpf_get_hash_recalc
bpf_set_hash_invalid
Checksum helpers
Checksum helpers
bpf_l3_csum_replace
bpf_l4_csum_replace
bpf_csum_diff
bpf_csum_update
bpf_csum_level
Redirect helpers
Redirect helpers
bpf_clone_redirect
bpf_redirect
bpf_redirect_map
bpf_sk_redirect_map
bpf_msg_redirect_map
bpf_redirect_peer
bpf_sk_redirect_hash
bpf_msg_redirect_hash
bpf_redirect_neigh
bpf_sk_select_reuseport
bpf_sk_assign
XDP helpers
XDP helpers
bpf_xdp_adjust_head
bpf_xdp_adjust_tail
bpf_xdp_adjust_meta
bpf_xdp_get_buff_len
bpf_xdp_load_bytes
bpf_xdp_store_bytes
Socket message helpers
Socket message helpers
bpf_msg_apply_bytes
bpf_msg_cork_bytes
bpf_msg_pull_data
bpf_msg_push_data
bpf_msg_pop_data
LWT helpers
LWT helpers
bpf_lwt_push_encap
bpf_lwt_seg6_store_bytes
bpf_lwt_seg6_adjust_srh
bpf_lwt_seg6_action
SYN Cookie helpers
SYN Cookie helpers
bpf_tcp_check_syncookie
bpf_tcp_gen_syncookie
bpf_tcp_raw_gen_syncookie_ipv4
bpf_tcp_raw_gen_syncookie_ipv6
bpf_tcp_raw_check_syncookie_ipv4
bpf_tcp_raw_check_syncookie_ipv6
Socket helpers
Socket helpers
bpf_sk_lookup_tcp
bpf_sk_lookup_udp
bpf_sk_release
bpf_sk_fullsock
bpf_sk_cgroup_id
bpf_sk_ancestor_cgroup_id
bpf_get_socket_cookie
bpf_get_socket_uid
bpf_setsockopt
bpf_getsockopt
bpf_sock_ops_cb_flags_set
bpf_tcp_sock
bpf_get_listener_sock
bpf_tcp_send_ack
bpf_skc_lookup_tcp
bpf_skc_to_tcp6_sock
bpf_skc_to_tcp_sock
bpf_skc_to_tcp_timewait_sock
bpf_skc_to_tcp_request_sock
bpf_skc_to_udp6_sock
bpf_skc_to_mptcp_sock
bpf_skc_to_unix_sock
bpf_bind
Socket ops helpers
Socket ops helpers
bpf_load_hdr_opt
bpf_store_hdr_opt
bpf_reserve_hdr_opt
Infrared related helpers
Infrared related helpers
bpf_rc_repeat
bpf_rc_keydown
bpf_rc_pointer_rel
Syscall helpers
Syscall helpers
bpf_sys_bpf
bpf_btf_find_by_name_kind
bpf_sys_close
bpf_kallsyms_lookup_name
LSM helpers
LSM helpers
bpf_bprm_opts_set
bpf_ima_inode_hash
bpf_ima_file_hash
Sysctl helpers
Sysctl helpers
bpf_sysctl_get_name
bpf_sysctl_get_current_value
bpf_sysctl_get_new_value
bpf_sysctl_set_new_value
Dynptr
Dynptr
bpf_dynptr_from_mem
bpf_dynptr_read
bpf_dynptr_write
bpf_dynptr_data
Loop helpers
Loop helpers
bpf_loop
Utility helpers
Utility helpers
bpf_get_prandom_u32
bpf_strtol
bpf_strtoul
bpf_strncmp
bpf_d_path
Misc
Misc
bpf_kptr_xchg
Syscall commands
Syscall commands
Object creation commands
Object creation commands
BPF_MAP_CREATE
BPF_PROG_LOAD
BPF_BTF_LOAD
BPF_LINK_CREATE
BPF_ITER_CREATE
BPF_RAW_TRACEPOINT_OPEN
Map commands
Map commands
BPF_MAP_CREATE
BPF_MAP_LOOKUP_ELEM
BPF_MAP_UPDATE_ELEM
BPF_MAP_DELETE_ELEM
BPF_MAP_GET_NEXT_KEY
BPF_MAP_LOOKUP_BATCH
BPF_MAP_LOOKUP_AND_DELETE_BATCH
BPF_MAP_UPDATE_BATCH
BPF_MAP_DELETE_BATCH
BPF_MAP_LOOKUP_AND_DELETE_ELEM
BPF_MAP_FREEZE
Pin commands
Pin commands
BPF_OBJ_PIN
BPF_OBJ_GET
Program commands
Program commands
BPF_PROG_LOAD
BPF_PROG_ATTACH
BPF_PROG_DETACH
BPF_PROG_TEST_RUN
BPF_PROG_TEST_RUN
BPF_PROG_BIND_MAP
Object discovery commands
Object discovery commands
BPF_PROG_GET_NEXT_ID
BPF_MAP_GET_NEXT_ID
BPF_PROG_GET_FD_BY_ID
BPF_MAP_GET_FD_BY_ID
BPF_OBJ_GET_INFO_BY_FD
BPF_PROG_QUERY
BPF_BTF_GET_FD_BY_ID
BPF_TASK_FD_QUERY
BPF_BTF_GET_NEXT_ID
BPF_LINK_GET_FD_BY_ID
BPF_LINK_GET_NEXT_ID
Link commands
Link commands
BPF_LINK_CREATE
BPF_LINK_UPDATE
BPF_LINK_DETACH
Statistics commands
Statistics commands
BPF_ENABLE_STATS
KFuncs
KFuncs
cGroup resource stats KFuncs
cGroup resource stats KFuncs
cgroup_rstat_updated
cgroup_rstat_flush
Key signature verification KFuncs
Key signature verification KFuncs
bpf_lookup_user_key
bpf_lookup_system_key
bpf_key_put
bpf_verify_pkcs7_signature
File related kfuncs
File related kfuncs
bpf_get_file_xattr
CPU mask KFuncs
CPU mask KFuncs
bpf_cpumask_create
bpf_cpumask_release
bpf_cpumask_acquire
bpf_cpumask_first
bpf_cpumask_first_zero
bpf_cpumask_first_and
bpf_cpumask_set_cpu
bpf_cpumask_clear_cpu
bpf_cpumask_test_cpu
bpf_cpumask_test_and_set_cpu
bpf_cpumask_test_and_clear_cpu
bpf_cpumask_setall
bpf_cpumask_clear
bpf_cpumask_and
bpf_cpumask_or
bpf_cpumask_xor
bpf_cpumask_equal
bpf_cpumask_intersects
bpf_cpumask_subset
bpf_cpumask_empty
bpf_cpumask_full
bpf_cpumask_copy
bpf_cpumask_any_distribute
bpf_cpumask_any_and_distribute
bpf_cpumask_weight
Generic KFuncs
Generic KFuncs
crash_kexec
bpf_throw
Object allocation KFuncs
Object allocation KFuncs
bpf_obj_new_impl
bpf_percpu_obj_new_impl
bpf_obj_drop_impl
bpf_percpu_obj_drop_impl
bpf_refcount_acquire_impl
bpf_list_push_front_impl
bpf_list_push_back_impl
bpf_list_pop_front
bpf_list_pop_back
BPF Arena KFuncs
BPF Arena KFuncs
bpf_arena_alloc_pages
bpf_arena_free_pages
BPF task KFuncs
BPF task KFuncs
bpf_task_acquire
bpf_task_release
BPF cGroup KFuncs
BPF cGroup KFuncs
bpf_rbtree_add_impl
bpf_rbtree_first
bpf_rbtree_remove
Kfuncs for acquiring and releasing cGroup references
Kfuncs for acquiring and releasing cGroup references
bpf_cgroup_acquire
bpf_cgroup_release
bpf_cgroup_ancestor
bpf_cgroup_from_id
Kfuncs for querying tasks
Kfuncs for querying tasks
bpf_task_under_cgroup
bpf_task_get_cgroup1
bpf_task_from_pid
Kfuncs for casting pointers
Kfuncs for casting pointers
bpf_cast_to_kern_ctx
bpf_rdonly_cast
Kfuncs for taking and releasing RCU read locks
Kfuncs for taking and releasing RCU read locks
bpf_rcu_read_lock
bpf_rcu_read_unlock
Kfuncs for dynamic pointer slices
Kfuncs for dynamic pointer slices
bpf_dynptr_slice
bpf_dynptr_slice_rdwr
Kfuncs for open coded numeric iterators
Kfuncs for open coded numeric iterators
bpf_iter_num_new
bpf_iter_num_next
bpf_iter_num_destroy
Kfuncs for open coded virtual memory area iterators
Kfuncs for open coded virtual memory area iterators
bpf_iter_task_vma_new
bpf_iter_task_vma_next
bpf_iter_task_vma_destroy
Kfuncs for bits
Kfuncs for bits
bpf_iter_bits_new
bpf_iter_bits_next
bpf_iter_bits_destroy
Kfuncs for open coded task cGroup iterators
Kfuncs for open coded task cGroup iterators
bpf_iter_css_task_new
bpf_iter_css_task_next
bpf_iter_css_task_destroy
Kfuncs for open coded cGroup iterators
Kfuncs for open coded cGroup iterators
bpf_iter_css_new
bpf_iter_css_next
bpf_iter_css_destroy
Kfuncs for open coded task iterators
Kfuncs for open coded task iterators
bpf_iter_task_new
bpf_iter_task_next
bpf_iter_task_destroy
Kfuncs for dynamic pointers
Kfuncs for dynamic pointers
bpf_dynptr_adjust
bpf_dynptr_is_null
bpf_dynptr_is_rdonly
bpf_dynptr_size
bpf_dynptr_clone
Misc KFuncs
Misc KFuncs
bpf_map_sum_elem_count
bpf_get_fsverity_digest
Preemption kfuncs
Preemption kfuncs
bpf_preempt_disable
bpf_preempt_enable
Work-queue KFuncs
Work-queue KFuncs
bpf_wq_init
bpf_wq_set_callback_impl
bpf_wq_start
XDP metadata kfuncs
XDP metadata kfuncs
bpf_xdp_metadata_rx_timestamp
bpf_xdp_metadata_rx_hash
bpf_xdp_metadata_rx_vlan_tag
XDP/SKB dynamic pointer kfuncs
XDP/SKB dynamic pointer kfuncs
bpf_dynptr_from_skb
bpf_dynptr_from_xdp
Socket related kfuncs
Socket related kfuncs
bpf_sock_addr_set_sun_path
bpf_sock_destroy
Network crypto kfuncs
Network crypto kfuncs
bpf_crypto_ctx_create
bpf_crypto_ctx_acquire
bpf_crypto_ctx_release
bpf_crypto_decrypt
bpf_crypto_encrypt
BBR congestion control kfuncs
BBR congestion control kfuncs
bbr_init
bbr_main
bbr_sndbuf_expand
bbr_undo_cwnd
bbr_cwnd_event
bbr_ssthresh
bbr_min_tso_segs
bbr_set_state
Cubic TCP congestion control kfuncs
Cubic TCP congestion control kfuncs
cubictcp_init
cubictcp_recalc_ssthresh
cubictcp_cong_avoid
cubictcp_state
cubictcp_cwnd_event
cubictcp_acked
DC TCP congestion control kfuncs
DC TCP congestion control kfuncs
dctcp_init
dctcp_update_alpha
dctcp_cwnd_event
dctcp_ssthresh
dctcp_cwnd_undo
dctcp_state
TCP Reno congestion control kfuncs
TCP Reno congestion control kfuncs
tcp_reno_ssthresh
tcp_reno_cong_avoid
tcp_reno_undo_cwnd
tcp_slow_start
tcp_cong_avoid_ai
Foo over UDP KFuncs
Foo over UDP KFuncs
bpf_skb_set_fou_encap
bpf_skb_get_fou_encap
SYN Cookie KFuncs
SYN Cookie KFuncs
bpf_sk_assign_tcp_reqsk
Connection tracking KFuncs
Connection tracking KFuncs
bpf_ct_set_nat_info
bpf_xdp_ct_alloc
bpf_xdp_ct_lookup
bpf_skb_ct_alloc
bpf_skb_ct_lookup
bpf_ct_insert_entry
bpf_ct_release
bpf_ct_set_timeout
bpf_ct_change_timeout
bpf_ct_set_status
bpf_ct_change_status
XDP KFuncs
XDP KFuncs
bpf_xdp_flow_lookup
XFRM KFuncs
XFRM KFuncs
bpf_skb_get_xfrm_info
bpf_skb_set_xfrm_info
bpf_xdp_get_xfrm_state
bpf_xdp_xfrm_state_release
HID Kfuncs
HID Kfuncs
hid_bpf_get_data
hid_bpf_attach_prog
hid_bpf_allocate_context
hid_bpf_release_context
hid_bpf_hw_request
hid_bpf_hw_output_report
hid_bpf_input_report
hid_bpf_try_input_report
KProbe session Kfuncs
KProbe session Kfuncs
bpf_session_cookie
bpf_session_is_return
eBPF libraries
eBPF libraries
Libbpf
Libxdp
Libxdp
Concept
Manage programs
Manage programs
Load
Load
xdp_program__from_bpf_obj
xdp_program__find_file
xdp_program__open_file
xdp_program__from_fd
xdp_program__from_id
xdp_program__from_pin
Metadata
Metadata
xdp_program__run_prio
xdp_program__set_run_prio
xdp_program__chain_call_enabled
xdp_program__set_chain_call_enabled
xdp_program__print_chain_call_actions
Dispatcher
Dispatcher
xdp_multiprog__get_from_ifindex
xdp_multiprog__next_prog
xdp_multiprog__close
xdp_multiprog__detach
xdp_multiprog__attach_mode
xdp_multiprog__main_prog
xdp_multiprog__hw_prog
xdp_multiprog__is_legacy
AF_XDP sockets
AF_XDP sockets
Control path
Control path
Umem Area
Umem Area
xsk_umem__create
xsk_umem__create_with_fd
xsk_umem__delete
xsk_umem__fd
xsk_umem__get_data
xsk_umem__extract_addr
xsk_umem__extract_offset
xsk_umem__add_offset_to_addr
Sockets
Sockets
xsk_socket__create
xsk_socket__create_shared
xsk_socket__delete
xsk_socket__fd
xsk_setup_xdp_prog
xsk_socket__update_xskmap
Data path
Data path
Producer rings
Producer rings
xsk_ring_prod__reserve
xsk_ring_prod__submit
xsk_ring_prod__fill_addr
xsk_ring_prod__tx_desc
xsk_ring_prod__needs_wakeup
Consumer rings
Consumer rings
xsk_ring_cons__peek
xsk_ring_cons__cancel
xsk_ring_cons__release
xsk_ring_cons__comp_addr
xsk_ring_cons__rx_desc
Concepts
Concepts
BPF CO-RE
BTF
ELF
FAQ
BPF Syscall
BPF_PROG_DETACH
command
v4.10
Back to top