net/mlx5: use portable version of __builtin_ffsl
PATCH 1/1 net/mlx5: use portable version of __builtin_ffsl
Builtin __builtin_ffsl is not available with MSVC therefore a portable replacement should be used.
Function rte_ffs32 is already available in eal and should be used instead.
--- drivers/net/mlx5/mlx5_tx.c | 4 ++-- drivers/net/mlx5/mlx5_utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_tx.c +2 -2
@@ -629,8 +629,8 @@ mlx5_select_tx_function(struct rte_eth_dev *dev) }if (tmp == diff) { tmp = txoff_func[i].olx ^ txoff_func[m].olx; -if (__builtin_ffsl (txoff_func[i].olx & ~tmp) < -__builtin_ffsl (txoff_func[m].olx & ~tmp)) { +if (rte_ffs32 (txoff_func[i].olx & ~tmp) < +rte_ffs32 (txoff_func[m].olx & ~tmp)) {/* Lighter not requested offload. */ m = i; }
drivers/net/mlx5/mlx5_utils.c +1 -1
@@ -84,7 +84,7 @@ mlx5_ipool_create(struct mlx5_indexed_pool_config *cfg)if (!cfg || (!cfg->malloc ^ !cfg->free) || (cfg->per_core_cache && cfg->release_mem_en) || (cfg->trunk_size && ((cfg->trunk_size & (cfg->trunk_size -1 )) || - ((__builtin_ffs (cfg->trunk_size) +TRUNK_IDX_BITS ) >32 )))) + ((rte_ffs32 (cfg->trunk_size) +TRUNK_IDX_BITS ) >32 ))))return NULL ; pool = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*pool) + cfg->grow_trunk * sizeof(pool->grow_tbl[0]), RTE_CACHE_LINE_SIZE,
Signature · 1 line
2.49.0.vfs.0.2
Quoted 42 lines · Andre Muezerie
Builtin
__builtin_ffslis not available with MSVC therefore a portable replacement should be used.Function
rte_ffs32is already available in eal and should be used instead.Signed-off-by Andre Muezerie <[email protected]>--- drivers/net/mlx5/mlx5_tx.c | 4 ++-- drivers/net/mlx5/mlx5_utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)drivers/net/mlx5/mlx5_tx.c +2
-2@@ -629,8 +629,8 @@ mlx5_select_tx_function(struct rte_eth_dev *dev) }if (tmp == diff) { tmp = txoff_func[i].olx ^ txoff_func[m].olx; -if (__builtin_ffsl (txoff_func[i].olx & ~tmp) < -__builtin_ffsl (txoff_func[m].olx & ~tmp)) { +if (rte_ffs32 (txoff_func[i].olx & ~tmp) < +rte_ffs32 (txoff_func[m].olx & ~tmp)) {/* Lighter not requested offload. */ m = i; }drivers/net/mlx5/mlx5_utils.c +1
-1@@ -84,7 +84,7 @@ mlx5_ipool_create(struct mlx5_indexed_pool_config *cfg)if (!cfg || (!cfg->malloc ^ !cfg->free) || (cfg->per_core_cache && cfg->release_mem_en) || (cfg->trunk_size && ((cfg->trunk_size & (cfg->trunk_size -1 )) || - ((__builtin_ffs (cfg->trunk_size) +TRUNK_IDX_BITS ) >32 )))) + ((rte_ffs32 (cfg->trunk_size) +TRUNK_IDX_BITS ) >32 ))))return NULL ; pool = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*pool) + cfg->grow_trunk * sizeof(pool->grow_tbl[0]), RTE_CACHE_LINE_SIZE,Signature · 1 line
2.49.0.vfs.0.2
Would someone be able to review this patchset?
Thanks,
Andre Muezerie
Hi,
Quoted 7 lines · Andre Muezerie
Builtin
__builtin_ffslis not available with MSVC therefore a portable replacement should be used.Function
rte_ffs32is already available in eal and should be used instead.Signed-off-by Andre Muezerie <[email protected]>
Best regards,
Dariusz Sosnowski
Hi,
Quoted 7 lines · Andre Muezerie
Builtin
__builtin_ffslis not available with MSVC therefore a portable replacement should be used.Function
rte_ffs32is already available in eal and should be used instead.Signed-off-by Andre Muezerie <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh