[bpf-next,v4,1/2] docs/bpf: Add table to describe LRU properties

Message ID 20230401200651.1022113-1-joe@isovalent.com
State New
Headers
Series [bpf-next,v4,1/2] docs/bpf: Add table to describe LRU properties |

Commit Message

Joe Stringer April 1, 2023, 8:06 p.m. UTC
  Depending on the map type and flags for LRU, different properties are
global or percpu. Add a table to describe these.

Signed-off-by: Joe Stringer <joe@isovalent.com>
---
v4: Initial posting
---
 Documentation/bpf/map_hash.rst | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
  

Comments

Bagas Sanjaya April 3, 2023, 3:49 a.m. UTC | #1
On Sat, Apr 01, 2023 at 01:06:50PM -0700, Joe Stringer wrote:
> +======================== ========================= ================================
> +Flag                     ``BPF_MAP_TYPE_LRU_HASH`` ``BPF_MAP_TYPE_LRU_PERCPU_HASH``
> +======================== ========================= ================================
> +``BPF_F_NO_COMMON_LRU``  Per-CPU LRU, global map   Per-CPU LRU, per-cpu map
> +``!BPF_F_NO_COMMON_LRU`` Global LRU, global map    Global LRU, per-cpu map
> +======================== ========================= ================================

The header column entries should also be bold (as above is two-way
table).

Thanks.
  
Joe Stringer April 3, 2023, 10:14 p.m. UTC | #2
On Sun, Apr 2, 2023 at 8:49 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On Sat, Apr 01, 2023 at 01:06:50PM -0700, Joe Stringer wrote:
> > +======================== ========================= ================================
> > +Flag                     ``BPF_MAP_TYPE_LRU_HASH`` ``BPF_MAP_TYPE_LRU_PERCPU_HASH``
> > +======================== ========================= ================================
> > +``BPF_F_NO_COMMON_LRU``  Per-CPU LRU, global map   Per-CPU LRU, per-cpu map
> > +``!BPF_F_NO_COMMON_LRU`` Global LRU, global map    Global LRU, per-cpu map
> > +======================== ========================= ================================
>
> The header column entries should also be bold (as above is two-way
> table).

They look bold to me already, do I need to take any action here?
  
Bagas Sanjaya April 4, 2023, 2:37 a.m. UTC | #3
On Mon, Apr 03, 2023 at 03:14:39PM -0700, Joe Stringer wrote:
> On Sun, Apr 2, 2023 at 8:49 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >
> > On Sat, Apr 01, 2023 at 01:06:50PM -0700, Joe Stringer wrote:
> > > +======================== ========================= ================================
> > > +Flag                     ``BPF_MAP_TYPE_LRU_HASH`` ``BPF_MAP_TYPE_LRU_PERCPU_HASH``
> > > +======================== ========================= ================================
> > > +``BPF_F_NO_COMMON_LRU``  Per-CPU LRU, global map   Per-CPU LRU, per-cpu map
> > > +``!BPF_F_NO_COMMON_LRU`` Global LRU, global map    Global LRU, per-cpu map
> > > +======================== ========================= ================================
> >
> > The header column entries should also be bold (as above is two-way
> > table).
> 
> They look bold to me already, do I need to take any action here?

Oops, I mean the "Flag" column is the header column.
  

Patch

diff --git a/Documentation/bpf/map_hash.rst b/Documentation/bpf/map_hash.rst
index 8669426264c6..45d923cd16c4 100644
--- a/Documentation/bpf/map_hash.rst
+++ b/Documentation/bpf/map_hash.rst
@@ -29,7 +29,16 @@  will automatically evict the least recently used entries when the hash
 table reaches capacity. An LRU hash maintains an internal LRU list that
 is used to select elements for eviction. This internal LRU list is
 shared across CPUs but it is possible to request a per CPU LRU list with
-the ``BPF_F_NO_COMMON_LRU`` flag when calling ``bpf_map_create``.
+the ``BPF_F_NO_COMMON_LRU`` flag when calling ``bpf_map_create``.  The
+following table outlines the properties of LRU maps depending on the a
+map type and the flags used to create the map.
+
+======================== ========================= ================================
+Flag                     ``BPF_MAP_TYPE_LRU_HASH`` ``BPF_MAP_TYPE_LRU_PERCPU_HASH``
+======================== ========================= ================================
+``BPF_F_NO_COMMON_LRU``  Per-CPU LRU, global map   Per-CPU LRU, per-cpu map
+``!BPF_F_NO_COMMON_LRU`` Global LRU, global map    Global LRU, per-cpu map
+======================== ========================= ================================
 
 Usage
 =====