* Add a pointer for a range of values */
| 306 | * Add a pointer for a range of values |
| 307 | */ |
| 308 | static int |
| 309 | acl_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. |
no test coverage detected