Flow table entry eviction

Hi there! Please help me to find a piece of C code, where the eviction of entries in the flow table is implemented. I found different options: idle_timeout_auto_delete, support_timeout. But I couldn’t find their implementation.

For the implementation in behavioral-model, search the code in repo GitHub - p4lang/behavioral-model: The reference P4 software switch for the strings support_timeout and with_ageing. Note that this implementation does not automatically delete the table entries when they have not been matched for too long. Instead, it generates notification messages to the control plane. That is what the support_timeout feature in the v1model architecture is defined to do.

The P4 DPDK implementation does support deletion of entries when they have not been matched for the configured idle timeout, but in a way that I’m not sure is a very good way, because it does not actually delete the entries until potentially much later. The implementer was trying to avoid performing a periodic background sweep of all of the entries. I cannot think of any way to fully implement this feature without periodically performing a background sweep of all entries, personally. See some notes here: p4-guide/ipdk/docs/note-on-timeout-durations-in-p4-dpdk.md at master · jafingerhut/p4-guide · GitHub

I assume that the C implementation of this feature of P4 DPDK is somewhere in the open source DPDK code, but I have not looked for exactly where: GitHub - DPDK/dpdk: Data Plane Development Kit

If you have questions on how these features ought to behave (at least, from my understanding), feel free to ask more detailed questions in a reply on this forum.

1 Like

Thank you so much for your reply and recommendations!

I have implemented flow table based on rte_hash with fixed size. Now I’m trying to implement an eviction mechanism by idle timeout and hash table size. The first implementation was LRU, however I don’t like that with each cache hit I update 4-6 pointers. After seeing Cristian Dumitrescu’s talk at DPDK Userspace Summit 2022, I was curious about the implementation of entry eviction in “Connection Table”. So I started to search in code and documentation for details of the eviction implementation.