Re: [Patch bpf-next v5 1/3] bpf: introduce timeout hash map

2 messages, 2 authors, 2021-01-31 · open the first message on its own page

Re: [Patch bpf-next v5 1/3] bpf: introduce timeout hash map

From: Alexei Starovoitov <hidden>
Date: 2021-01-30 09:07:41

On Fri, Jan 29, 2021 at 6:14 AM Jamal Hadi Salim [off-list ref] wrote:
On 2021-01-29 9:06 a.m., Jamal Hadi Salim wrote:
quoted
Which leads to:
Why not extend the general feature so one can register for optional
callbacks not just for expire but also add/del/update on specific
entries or table?
add/del/update could be sourced from other kernel programs or user space
and the callback would be invoked before an entry is added/deleted etc.
(just like it is here for expiry).
Sorry - shouldve read the rest of the thread:
Agree with Cong that you want per-map but there are use cases where you
want it per entry (eg the add/del/update case).
That was my point as well.
bpf_timer api should be generic, so that users can do both.
The program could use bpf_timer one for each flow and bpf_timer for each map.
And timers without maps.

Re: [Patch bpf-next v5 1/3] bpf: introduce timeout hash map

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2021-01-31 20:36:32

On 2021-01-29 10:14 p.m., Alexei Starovoitov wrote:
On Fri, Jan 29, 2021 at 6:14 AM Jamal Hadi Salim [off-list ref] wrote:
quoted
On 2021-01-29 9:06 a.m., Jamal Hadi Salim wrote:
quoted
Which leads to:
Why not extend the general feature so one can register for optional
callbacks not just for expire but also add/del/update on specific
entries or table?
add/del/update could be sourced from other kernel programs or user space
and the callback would be invoked before an entry is added/deleted etc.
(just like it is here for expiry).
Sorry - shouldve read the rest of the thread:
Agree with Cong that you want per-map but there are use cases where you
want it per entry (eg the add/del/update case).
That was my point as well.
bpf_timer api should be generic, so that users can do both.
The program could use bpf_timer one for each flow and bpf_timer for each map.
And timers without maps.
I like it. Sensible to also have callback invocations for map
changes i.e entry create/update/delete (maybe map create/destroy).

cheers,
jamal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help