On Tue, May 25, 2021 at 12:35 PM Jamal Hadi Salim [off-list ref] wrote:
On 2021-05-25 2:21 p.m., Alexei Starovoitov wrote:
quoted
On Mon, May 24, 2021 at 9:59 PM Cong Wang [off-list ref] wrote:
[..]
quoted
In general the garbage collection in any form doesn't scale.
The conntrack logic doesn't need it. The cillium conntrack is a great
example of how to implement a conntrack without GC.
For our use case, we need to collect info on all the flows
for various reasons (one of which is accounting of every byte and
packet).
So as a consequence - built-in GC (such as imposed by LRU)
cant interfere without our consent.
The outcome of the last bpf office hours was a general agreement
that we need new hooks in map update/delete operations
(including auto-delete by LRU) that will trigger a bpf subprog.
It might look very similar to the timer callback that is part of this patch,
but instead of being called by the timer the LRU logic will call it.
This way the subprog can transfer the data stored in the
about-to-be-deleted map element into some other map or pass
to user space via ringbuf or do any other logic.