]> git.droids-corp.org - dpdk.git/blobdiff - drivers/net/mlx5/mlx5_utils.c
net/mlx5: use indexed pool as id generator
[dpdk.git] / drivers / net / mlx5 / mlx5_utils.c
index 3a1f87a361712cde34bb9adccfe6af69e559ec45..7a6b0c69ed237a1838da3fb25c7607dd366ac04a 100644 (file)
@@ -362,6 +362,11 @@ mlx5_ipool_malloc(struct mlx5_indexed_pool *pool, uint32_t *idx)
        MLX5_ASSERT(iidx < mlx5_trunk_size_get(pool, trunk->idx));
        rte_bitmap_clear(trunk->bmp, iidx);
        p = &trunk->data[iidx * pool->cfg.size];
+       /*
+        * The ipool index should grow continually from small to big,
+        * some features as metering only accept limited bits of index.
+        * Random index with MSB set may be rejected.
+        */
        iidx += mlx5_trunk_idx_offset_get(pool, trunk->idx);
        iidx += 1; /* non-zero index. */
        trunk->free--;