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

2021-01-18 Thread Cong Wang
On Sat, Jan 16, 2021 at 8:22 PM Cong Wang wrote: > +static void htab_gc(struct work_struct *work) > +{ > + struct htab_elem *e, *tmp; > + struct llist_node *lhead; > + struct bpf_htab *htab; > + int i, count; > + > + htab = container_of(work, struct bpf_htab, gc_work.

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

2021-01-16 Thread Cong Wang
From: Cong Wang This borrows the idea from conntrack and will be used for conntrack in ebpf too. Each element in a timeout map has a user-specified timeout in msecs, after it expires it will be automatically removed from the map. Cilium already does the same thing, it uses a regular map or LRU ma