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

Function rte_bitmap_clear

dpdk/lib/eal/include/rte_bitmap.h:457–488  ·  view source on GitHub ↗

* Bitmap bit clear * * @param bmp * Handle to bitmap instance * @param pos * Bit position */

Source from the content-addressed store, hash-verified

455 * Bit position
456 */
457static inline void
458rte_bitmap_clear(struct rte_bitmap *bmp, uint32_t pos)
459{
460 uint64_t *slab1, *slab2;
461 uint32_t index1, index2, offset1, offset2;
462
463 /* Clear bit in array2 slab */
464 index2 = pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2;
465 offset2 = pos & RTE_BITMAP_SLAB_BIT_MASK;
466 slab2 = bmp->array2 + index2;
467
468 /* Return if array2 slab is not all-zeros */
469 *slab2 &= ~(1llu << offset2);
470 if (*slab2){
471 return;
472 }
473
474 /* Check the entire cache line of array2 for all-zeros */
475 index2 &= ~ RTE_BITMAP_CL_SLAB_MASK;
476 slab2 = bmp->array2 + index2;
477 if (__rte_bitmap_line_not_empty(slab2)) {
478 return;
479 }
480
481 /* The array2 cache line is all-zeros, so clear bit in array1 slab */
482 index1 = pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + RTE_BITMAP_CL_BIT_SIZE_LOG2);
483 offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK;
484 slab1 = bmp->array1 + index1;
485 *slab1 &= ~(1llu << offset1);
486
487 return;
488}
489
490static inline int
491__rte_bitmap_scan_search(struct rte_bitmap *bmp)

Callers 15

grinder_scheduleFunction · 0.85
cpfl_fxp_mod_idx_allocFunction · 0.85
mlx5_ipool_growFunction · 0.85
mlx5_ipool_mallocFunction · 0.85
mlx5_ipool_flush_cacheFunction · 0.85
bitmap_clear_bitFunction · 0.85

Calls 1

Tested by 3

test_bitmap_all_setFunction · 0.68