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

Function acl_add_ptr_range

dpdk/lib/acl/acl_bld.c:308–329  ·  view source on GitHub ↗

* Add a pointer for a range of values */

Source from the content-addressed store, hash-verified

306 * Add a pointer for a range of values
307 */
308static int
309acl_add_ptr_range(struct acl_build_context *context,
310 struct rte_acl_node *root,
311 struct rte_acl_node *node,
312 uint8_t low,
313 uint8_t high)
314{
315 uint32_t n;
316 struct rte_acl_bitset bitset;
317
318 /* clear the bitset values */
319 for (n = 0; n < RTE_ACL_BIT_SET_SIZE; n++)
320 bitset.bits[n] = 0;
321
322 /* for each bit in range, add bit to set */
323 for (n = 0; n < UINT8_MAX + 1; n++)
324 if (n >= low && n <= high)
325 bitset.bits[n / (sizeof(bits_t) * 8)] |=
326 1U << (n % (sizeof(bits_t) * CHAR_BIT));
327
328 return acl_add_ptr(context, root, node, &bitset);
329}
330
331/*
332 * Generate a bitset from a byte value and mask.

Callers 5

acl_gen_full_rangeFunction · 0.85
acl_gen_range_mdlFunction · 0.85
acl_gen_range_lowFunction · 0.85
acl_gen_range_highFunction · 0.85
acl_gen_range_trieFunction · 0.85

Calls 1

acl_add_ptrFunction · 0.85

Tested by

no test coverage detected