[dpdk-dev] About the LRU Cache based DPDK?

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Mon Nov 26 22:49:42 CET 2018



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of bai bakari
> Sent: Monday, November 26, 2018 9:28 AM
> To: dev <dev at dpdk.org>
> Subject: [dpdk-dev] About the LRU Cache based DPDK?
> 
> Hi all,
> 
> 
> I'm going to implement a LRU Cache based DPDK.
> The most famous implementation of LRU is based on LinkedHashMap.
> I know that DPDK has a `rte_hash` library, but I don't know whether
> it can assist me to build a LRU Cache.
> 
> 
> Can someone give me some advice? Thanks a lot in advance.

Hai Bai,

There are already several flavors of Least Recently Used (LRU) hash table implemented in lib/librte_table.

API: Search for LRU in lib/librte_table/rte_table_hash.h.
 
Implementations:
* rte_table_hash.c: optimized for configurable size key
* rte_table_hash_key8.c: optimized for 8-byte key
* rte_table_hash_key16.c: optimized for 16-byte key
* rte_table_hash_key32.c: optimized for 32-byte key

Design documentation: http://doc.dpdk.org/guides/prog_guide/packet_framework.html#hash-table-design

Regards,
Cristian



More information about the dev mailing list