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

Function depth_to_range

dpdk/lib/lpm/rte_lpm.c:99–112  ·  view source on GitHub ↗

* Converts given depth value to its corresponding range value. */

Source from the content-addressed store, hash-verified

97 * Converts given depth value to its corresponding range value.
98 */
99static uint32_t __attribute__((pure))
100depth_to_range(uint8_t depth)
101{
102 VERIFY_DEPTH(depth);
103
104 /*
105 * Calculate tbl24 range. (Note: 2^depth = 1 << depth)
106 */
107 if (depth <= MAX_DEPTH_TBL24)
108 return 1 << (MAX_DEPTH_TBL24 - depth);
109
110 /* Else if depth is greater than 24 */
111 return 1 << (RTE_LPM_MAX_DEPTH - depth);
112}
113
114/*
115 * Find an existing lpm table and return a pointer to it.

Callers 4

add_depth_smallFunction · 0.70
add_depth_bigFunction · 0.70
delete_depth_smallFunction · 0.70
delete_depth_bigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected