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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/28/21 9:57 PM, Cong Wang wrote:
On Thu, Jan 28, 2021 at 6:54 PM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:

I meant it would look like:

noinline per_elem_callback(map, key, value, ...)
{
   if (value->foo > ...)
     bpf_delete_map_elem(map, key);
}

noinline timer_callback(timer, ctx)
{
   map = ctx->map;
   bpf_for_each_map_elem(map, per_elem_callback, ...);
}

int main_bpf_prog(skb)
{
   bpf_timer_setup(my_timer, timer_callback, ...);
   bpf_mod_timer(my_timer, HZ);
}

The bpf_for_each_map_elem() work is already in progress. Expect patches to hit
mailing list soon.

We don't want a per-element timer, we want a per-map timer but that
requires a way to iterate the whole map. If you or other can provide
bpf_for_each_map_elem(), we can certainly build our timeout map
on top of it.

I am working on this. Still need a few weeks to post RFC. Will share
as soon as it is in reasonable shape. Thanks!


If you can work on patches for bpf_timer_*() it would be awesome.

Yeah, I will work on this, not only for timeout map, but also possibly for
the ebpf qdisc I plan to add soon.

Thanks.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux