Skip to content

Commit

Permalink
doc: bpf doc minor adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
  • Loading branch information
netoptimizer committed Feb 7, 2017
1 parent 012b24f commit ee7344c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
6 changes: 3 additions & 3 deletions kernel/Documentation/bpf/ebpf_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ files for defining the maps, but it uses another layout. See man-page
.. _tc bpf examples:
https://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tree/examples/bpf

.. _tc-bpf(8): http://man7.org/linux/man-pages/man8/tc-bpf.8.html


Interacting with maps
=====================

Expand Down Expand Up @@ -255,6 +258,3 @@ is understood by LLVM when generating eBPF instructions.
.. _bpf(2): http://man7.org/linux/man-pages/man2/bpf.2.html

.. _bpf: http://man7.org/linux/man-pages/man2/bpf.2.html

.. _tc-bpf(8): http://man7.org/linux/man-pages/man8/tc-bpf.8.html

8 changes: 0 additions & 8 deletions kernel/Documentation/bpf/ebpf_maps_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ BPF_MAP_TYPE_ARRAY
Implementation defined in `kernel/bpf/arraymap.c`_ via struct
bpf_map_ops `array_ops`_.


As the name ``BPF_MAP_TYPE_ARRAY`` indicates, this can be seen as an
array. All array elements are pre-allocated and zero initialized at
init time. Key is an index in array and can only be 4 bytes (32-bit).
Expand All @@ -78,7 +77,6 @@ life of the eBPF program, which allows verifier+JIT to perform a wider
range of optimizations. E.g. `array_map_lookup_elem()`_ may be
'inlined' by JIT.


Small size gotcha, the ``value_size`` is rounded up to 8 bytes.

Example usage BPF_MAP_TYPE_ARRAY, based on `samples/bpf/sockex1_kern.c`_:
Expand Down Expand Up @@ -119,9 +117,3 @@ when updating the value in-place.

.. _samples/bpf/sockex1_kern.c:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/samples/bpf/sockex1_kern.c


.. Notes
git log kernel/bpf/arraymap.c|tail -33
git log kernel/bpf/hashtab.c|tail -33
will give an overview of key hash and array map principles.
2 changes: 1 addition & 1 deletion kernel/Documentation/bpf/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Introduction

The Berkeley Packet Filter (BPF) started (`article 1992`_) as a
special-purpose virtual machine (register based filter evaluator) for
filtering network packets, best known for the its in tcpdump. It is
filtering network packets, best known for its use in tcpdump. It is
documented in the kernel tree, in the first part of:
`Documentation/networking/filter.txt`_

Expand Down

0 comments on commit ee7344c

Please sign in to comment.