bpf.2: Improvements after comments from Alexei Starovoitov

Reported-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-07-23 11:56:44 +02:00
parent 46a4949bd7
commit b87d8ba6f2
1 changed files with 11 additions and 16 deletions

View File

@ -66,7 +66,7 @@ and access shared data structures such as eBPF maps.
BPF maps are a generic data structure for storage of different data types.
A user process can create multiple maps (with key/value-pairs being
opaque bytes of data) and access them via file descriptors.
Differnt eBPF programs can access the same maps in parallel.
Different eBPF programs can access the same maps in parallel.
It's up to the user process and eBPF program to decide what they store
inside maps.
.P
@ -735,11 +735,10 @@ the eBPF program and the corresponding format of
For example, programs loaded with a
.I prog_type
of
.B BPF_PROG_TYPE_SOCKET_FILTER
.B BPF_PROG_TYPE_KPROBE
may call the
.BR bpf_map_lookup_elem ()
helper,
whereas some other program types may not be able to employ this helper.
.BR bpf_probe_read ()
helper, whereas other program types can't employ this helper.
The set of functions available to eBPF programs of a given type may increase
in the future.
@ -761,20 +760,16 @@ bpf_map_delete_elem(map_fd, void *key)
.fi
.in
.\" FIXME The following paragraph needs amending. Alexei commented:
.\"
.\" Actually now in case of SOCKET_FILTER, SCHED_CLS, SCHED_ACT
.\" the program can now access skb fields.
.\" See 'struct __sk_buff' and commit 9bac3d6d548e5
.\"
.\" Do we want some text here to explain how the program access __sk_buff?
The
.I bpf_context
argument is a pointer to a
.IR "struct sk_buff" .
Programs cannot access the fields of
.I sk_buff
directly.
.IR "struct __sk_buff" .
.\" FIXME: We need some text here to explain how the program
.\" accesses __sk_buff
.\" See 'struct __sk_buff' and commit 9bac3d6d548e5
.\" Alexei commented:
.\" Actually now in case of SOCKET_FILTER, SCHED_CLS, SCHED_ACT
.\" the program can now access skb fields.
.\"
.TP
.BR BPF_PROG_TYPE_KPROBE " (since Linux 4.1)