lib/cmap.c
/* Find a node by the index of the entry of cmap. Index N means the N/CMAP_K
 * bucket and N%CMAP_K entry in that bucket.
 * Notice that it is not protected by the optimistic lock (versioning) because
 * it does not compare the hashes. Currently it is only used by the datapath
 * SMC cache.
 *
 * Return node for the entry of index or NULL if the index beyond boundary */
Find a node by the index of the entry of cmap. Index N means the N/CMAP_K
bucket and N%CMAP_K entry in that bucket.
Notice that it is not protected by the optimistic lock (versioning) because
it does not compare the hashes. Currently it is only used by the datapath
SMC cache.

Return node for the entry of index or NULL if the index beyond boundary
Find a node by the index of the entry of cmap . Index N means the N / CMAP_K bucket and N%CMAP_K entry in that bucket . Notice that it is not protected by the optimistic lock ( versioning ) because it does not compare the hashes . Currently it is only used by the datapath SMC cache . Return node for the entry of index or NULL if the index beyond boundary
const struct cmap_node *
cmap_find_by_index(const struct cmap *cmap, uint32_t index)
{
    const struct cmap_impl *impl = cmap_get_impl(cmap);
    uint32_t b = index / CMAP_K;
    uint32_t e = index % CMAP_K;
    if (b > impl->mask) {
        return NULL;
    }
    const struct cmap_bucket *bucket = &impl->buckets[b];
    return cmap_node_next(&bucket->nodes[e]);
}
const struct cmap_node * cmap_find_by_index ( const struct cmap * cmap , uint32_t index ) { const struct cmap_impl * impl = cmap_get_impl ( cmap ) ; uint32_t b = index / CMAP_K ; uint32_t e = index % CMAP_K ; if ( b > impl -> mask ) { return NULL ; } const struct cmap_bucket * bucket = & impl -> buckets [ b ] ; return cmap_node_next ( & bucket -> nodes [ e ] ) ; }
Find a node by the index of the entry of cmap.
Find a node by the index of the entry of cmap .