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

Function get_idx

dpdk/lib/fib/trie.c:229–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227
228#define BYTE_SIZE 8
229static inline uint32_t
230get_idx(const uint8_t *ip, uint32_t prev_idx, int bytes, int first_byte)
231{
232 int i;
233 uint32_t idx = 0;
234 uint8_t bitshift;
235
236 for (i = first_byte; i < (first_byte + bytes); i++) {
237 bitshift = (int8_t)(((first_byte + bytes - 1) - i)*BYTE_SIZE);
238 idx |= ip[i] << bitshift;
239 }
240 return (prev_idx * TRIE_TBL8_GRP_NUM_ENT) + idx;
241}
242
243static inline uint64_t
244get_val_by_p(void *p, uint8_t nh_sz)

Callers 2

build_common_rootFunction · 0.85
install_to_dpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected