MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_hash_count

Function rte_hash_count

dpdk/lib/hash/rte_cuckoo_hash.c:552–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552int32_t
553rte_hash_count(const struct rte_hash *h)
554{
555 uint32_t tot_ring_cnt, cached_cnt = 0;
556 uint32_t i, ret;
557
558 if (h == NULL)
559 return -EINVAL;
560
561 if (h->use_local_cache) {
562 tot_ring_cnt = h->entries + (RTE_MAX_LCORE - 1) *
563 (LCORE_CACHE_SIZE - 1);
564 for (i = 0; i < RTE_MAX_LCORE; i++)
565 cached_cnt += h->local_free_slots[i].len;
566
567 ret = tot_ring_cnt - rte_ring_count(h->free_slots) -
568 cached_cnt;
569 } else {
570 tot_ring_cnt = h->entries;
571 ret = tot_ring_cnt - rte_ring_count(h->free_slots);
572 }
573 return ret;
574}
575
576/* Read write locks implemented using rte_rwlock */
577static inline void

Callers 2

test_hash_multiwriterFunction · 0.85

Calls 1

rte_ring_countFunction · 0.85

Tested by 2

test_hash_multiwriterFunction · 0.68