NDN-DPDK
High-Speed Named Data Networking Forwarder
|
#include "pcct.h"
#include "cs.h"
#include "pit.h"
#include "../core/logger.h"
#include "../dpdk/hashtable.h"
#include "../vendor/uthash.h"
Macros | |
#define | uthash_malloc(sz) rte_malloc("PCCT.uthash", (sz), 0) |
#define | uthash_free(ptr, sz) rte_free((ptr)) |
#define | HASH_FUNCTION HASH_FUNCTION_DONOTUSE |
#define | HASH_KEYCMP(a, b, n) (!PccKey_MatchSearch((const PccKey*)(a), (const PccSearch*)(b))) |
#define | uthash_fatal(msg) rte_panic("uthash_fatal %s", msg) |
#define | HASH_INITIAL_NUM_BUCKETS (pcct->nKeyHtBuckets) |
#define | HASH_INITIAL_NUM_BUCKETS_LOG2 (rte_log2_u32(HASH_INITIAL_NUM_BUCKETS)) |
#define | HASH_BKT_CAPACITY_THRESH UINT_MAX |
#define | HASH_EXPAND_BUCKETS(hh, tbl, oomed) Pcct_KeyHt_Expand_(tbl) |
Functions | |
N_LOG_INIT (Pcct) | |
bool | Pcct_Init (Pcct *pcct, const char *id, uint32_t maxEntries, int numaSocket) |
Initialize keyHt and tokenHt. More... | |
void | Pcct_Clear (Pcct *pcct) |
Clear keyHt and tokenHt, and free cached Data. More... | |
PccEntry * | Pcct_Insert (Pcct *pcct, const PccSearch *search, bool *isNew) |
Insert or find an entry. More... | |
void | Pcct_Erase (Pcct *pcct, PccEntry *entry) |
Erase an entry. More... | |
uint64_t | Pcct_AddToken (Pcct *pcct, PccEntry *entry) |
Assign a token to an entry. More... | |
void | Pcct_RemoveToken (Pcct *pcct, PccEntry *entry) |
Clear the token on an entry. More... | |
PccEntry * | Pcct_FindByToken (const Pcct *pcct, uint64_t token) |
Find an entry by token. More... | |
void | PcctEraseBatch_EraseBurst_ (PcctEraseBatch *peb) |
#define HASH_BKT_CAPACITY_THRESH UINT_MAX |
#define HASH_EXPAND_BUCKETS | ( | hh, | |
tbl, | |||
oomed | |||
) | Pcct_KeyHt_Expand_(tbl) |
#define HASH_FUNCTION HASH_FUNCTION_DONOTUSE |
#define HASH_INITIAL_NUM_BUCKETS (pcct->nKeyHtBuckets) |
#define HASH_INITIAL_NUM_BUCKETS_LOG2 (rte_log2_u32(HASH_INITIAL_NUM_BUCKETS)) |
#define uthash_fatal | ( | msg | ) | rte_panic("uthash_fatal %s", msg) |
#define uthash_free | ( | ptr, | |
sz | |||
) | rte_free((ptr)) |
#define uthash_malloc | ( | sz | ) | rte_malloc("PCCT.uthash", (sz), 0) |
N_LOG_INIT | ( | Pcct | ) |
Assign a token to an entry.
void Pcct_Clear | ( | Pcct * | pcct | ) |
Clear keyHt and tokenHt, and free cached Data.
Find an entry by token.
token | the token, only lower 48 bits are significant. |
bool Pcct_Init | ( | Pcct * | pcct, |
const char * | id, | ||
uint32_t | maxEntries, | ||
int | numaSocket | ||
) |
Initialize keyHt and tokenHt.
id | memzone identifier, must be unique. |
maxEntries | PCCT capacity; hashtable capacity will be calculated accordingly. |
rte_errno
. Insert or find an entry.
[out] | isNew | whether the entry is new |
NULL | allocation error. |
void PcctEraseBatch_EraseBurst_ | ( | PcctEraseBatch * | peb | ) |