[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <44c7b96c-ff9f-a0b3-7c5e-1ccdbf4bf138@fb.com>
Date: Tue, 7 Jan 2020 17:57:44 +0000
From: Yonghong Song <yhs@...com>
To: Brian Vazquez <brianvv.kernel@...il.com>
CC: Brian Vazquez <brianvv@...gle.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"David S . Miller" <davem@...emloft.net>,
Stanislav Fomichev <sdf@...gle.com>,
Petar Penkov <ppenkov@...gle.com>,
Willem de Bruijn <willemb@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: Re: [PATCH v3 bpf-next 05/11] bpf: add generic_batch_ops to lpm_trie
map
On 1/6/20 10:39 PM, Brian Vazquez wrote:
> Hi Yonghong, thanks for reviewing it and sorry for the late reply I
> had been traveling.
>
> On Fri, Dec 13, 2019 at 11:46 AM Yonghong Song <yhs@...com> wrote:
>>
>>
>>
>> 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@...gle.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.
>>
>
> I think you're right, we shouldn't use generic
> lookup/lookup_and_delete for lpm_trie. That being said, would you be
> ok, if we don't add lpm_trie support in this patch series? Also we can
> drop the generic_map_lookup_and_delete implementation in this patch
> series and add it in the future, if needed. What do you think?
Yes, we can drop generic_map_lookup_and_delete(), it probably will not
be used a lot. The normal array map, you cannot delete elements.
For fd_array maps, they tend to be small.
>
>>> + .map_delete_batch = generic_map_delete_batch,
>>> + .map_update_batch = generic_map_update_batch,with efault
>>> };
>>>
Powered by blists - more mailing lists