lkml.org 
[lkml]   [2019]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 bpf-next 05/11] bpf: add generic_batch_ops to lpm_trie map
Date


On 12/11/19 2:33 PM, Brian Vazquez wrote:
> This adds the generic batch ops functionality to bpf lpm_trie.
>
> Signed-off-by: Brian Vazquez <brianvv@google.com>
> ---
> kernel/bpf/lpm_trie.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
> index 56e6c75d354d9..92c47b4f03337 100644
> --- a/kernel/bpf/lpm_trie.c
> +++ b/kernel/bpf/lpm_trie.c
> @@ -743,4 +743,8 @@ const struct bpf_map_ops trie_map_ops = {
> .map_update_elem = trie_update_elem,
> .map_delete_elem = trie_delete_elem,
> .map_check_btf = trie_check_btf,
> + .map_lookup_batch = generic_map_lookup_batch,
> + .map_lookup_and_delete_batch = generic_map_lookup_and_delete_batch,

Not 100% sure whether trie should use generic map
lookup/lookup_and_delete or not. If the key is not available,
the get_next_key will return the 'leftmost' node which roughly
corresponding to the first node in the hash table.

> + .map_delete_batch = generic_map_delete_batch,
> + .map_update_batch = generic_map_update_batch,
> };
>
\
 
 \ /
  Last update: 2019-12-13 18:48    [W:2.013 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site