structrte_member_setsum*rte_member_find_existing(constchar*name)
Find an existing set-summary and return a pointer to it.
Parametersname Name of the set-summary.
Returns
Pointer to the set-summary or NULL if object not found with rte_errno set appropriately. Possible
rte_errno values include:
• ENOENT - value not available for return
structrte_member_setsum*rte_member_create(conststructrte_member_parameters*params)
Create set-summary (SS).
Parametersparams Parameters to initialize the setsummary.
Returns
Return the pointer to the setsummary. Return value is NULL if the creation failed.
intrte_member_lookup(conststructrte_member_setsum*setsum,constvoid*key,member_set_t*set_id)
Lookup key in set-summary (SS). Single key lookup and return as soon as the first match found
Parameterssetsum Pointer of a setsummary.
key Pointer of the key to be looked up.
set_id Output the set id matches the key.
Returns
Return 1 for found a match and 0 for not found a match.
intrte_member_lookup_bulk(conststructrte_member_setsum*setsum,constvoid**keys,uint32_tnum_keys,member_set_t*set_ids)
Lookup bulk of keys in set-summary (SS). Each key lookup returns as soon as the first match found
Parameterssetsum Pointer of a setsummary.
keys Pointer of the bulk of keys to be looked up.
num_keys Number of keys that will be lookup.
set_ids Output set ids for all the keys to this array. User should preallocate array that can contain
all results, which size is the num_keys.
Returns
The number of keys that found a match.
intrte_member_lookup_multi(conststructrte_member_setsum*setsum,constvoid*key,uint32_tmax_match_per_key,member_set_t*set_id)
Lookup a key in set-summary (SS) for multiple matches. The key lookup will find all matched entries
(multiple match). Note that for cache mode of HT, each key can have at most one match. This is because
keys with same signature that maps to same bucket will overwrite each other. So multi-match lookup should
be used for vBF and non-cache HT.
Parameterssetsum Pointer of a set-summary.
key Pointer of the key that to be looked up.
max_match_per_key User specified maximum number of matches for each key. The function returns as soon
as this number of matches found for the key.
set_id Output set ids for all the matches of the key. User needs to preallocate the array that can
contain max_match_per_key number of results.
Returns
The number of matches that found for the key. For cache mode HT set-summary, the number should be at
most 1.
intrte_member_lookup_multi_bulk(conststructrte_member_setsum*setsum,constvoid**keys,uint32_tnum_keys,uint32_tmax_match_per_key,uint32_t*match_count,member_set_t*set_ids)
Lookup a bulk of keys in set-summary (SS) for multiple matches each key. Each key lookup will find all
matched entries (multiple match). Note that for cache mode HT, each key can have at most one match. So
multi-match function is mainly used for vBF and non-cache mode HT.
Parameterssetsum Pointer of a setsummary.
keys Pointer of the keys to be looked up.
num_keys The number of keys that will be lookup.
max_match_per_key The possible maximum number of matches for each key.
match_count Output the number of matches for each key in an array.
set_ids Return set ids for all the matches of all keys. Users pass in a preallocated 2D array with
first dimension as key index and second dimension as match index. For example
set_ids[bulk_size][max_match_per_key]
Returns
The number of keys that found one or more matches in the set-summary.
intrte_member_add(conststructrte_member_setsum*setsum,constvoid*key,member_set_tset_id)
Insert key into set-summary (SS).
Parameterssetsum Pointer of a set-summary.
key Pointer of the key to be added.
set_id The set id associated with the key that needs to be added. Different mode supports different
set_id ranges. 0 cannot be used as set_id since RTE_MEMBER_NO_MATCH by default is set as 0. For HT
mode, the set_id has range as [1, 0x7FFF], MSB is reserved. For vBF mode the set id is limited by the
num_set parameter when create the set-summary. For sketch mode, this id is ignored.
Returns
HT (cache mode) and vBF should never fail unless the set_id is not in the valid range. In such case
-EINVAL is returned. For HT (non-cache mode) it could fail with -ENOSPC error code when table is
full. For success it returns different values for different modes to provide extra information for
users. Return 0 for HT (cache mode) if the add does not cause eviction, return 1 otherwise. Return 0
for non-cache mode if success, -ENOSPC for full, and 1 if cuckoo eviction happens. Always returns 0
for vBF mode and sketch.
intrte_member_add_byte_count(conststructrte_member_setsum*setsum,constvoid*key,uint32_tbyte_count)
Add the packet byte size into the sketch.
Parameterssetsum Pointer of a set-summary.
key Pointer of the key to be added.
byte_count Add the byte count of the packet into the sketch.
Returns
Return -EINVAL for invalid parameters, otherwise return 0.
intrte_member_query_count(conststructrte_member_setsum*setsum,constvoid*key,uint64_t*count)
Query packet count for a certain flow-key.
Parameterssetsum Pointer of a set-summary.
key Pointer of the key to be added.
count The output packet count or byte count.
Returns
Return -EINVAL for invalid parameters.
intrte_member_report_heavyhitter(conststructrte_member_setsum*setsum,void**keys,uint64_t*counts)
Report heavyhitter flow-keys into set-summary (SS).
Parameterssetsum Pointer of a set-summary.
keys Pointer of the output top-k key array.
counts Pointer of the output packet count or byte count array of the top-k keys.
Returns
Return -EINVAL for invalid parameters. Return a positive integer indicate how many heavy hitters are
reported.
voidrte_member_free(structrte_member_setsum*setsum)
De-allocate memory used by set-summary.
Parameterssetsum Pointer to the set summary. If setsum is NULL, no operation is performed.
voidrte_member_reset(conststructrte_member_setsum*setsum)
Reset the set-summary tables. E.g. reset bits to be 0 in BF, reset set_id in each entry to be
RTE_MEMBER_NO_MATCH in HT based SS.
Parameterssetsum Pointer to the set-summary.
intrte_member_delete(conststructrte_member_setsum*setsum,constvoid*key,member_set_tset_id)
Delete items from the set-summary. Note that vBF does not support deletion in current implementation. For
vBF, error code of -EINVAL will be returned.
Parameterssetsum Pointer to the set-summary.
key Pointer of the key to be deleted.
set_id For HT mode, we need both key and its corresponding set_id to properly delete the key. Without
set_id, we may delete other keys with the same signature.
Returns
If no entry found to delete, an error code of -ENOENT could be returned.