From: Andre Muezerie <andremue@linux.microsoft.com>
To: Dariusz Sosnowski <dsosnowski@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] net/mlx5: use portable version of __builtin_ffsl
Date: Mon, 2 Jun 2025 18:10:02 -0700 [thread overview]
Message-ID: <20250603011002.GA1658@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <1746457492-10012-1-git-send-email-andremue@linux.microsoft.com>
On Mon, May 05, 2025 at 08:04:52AM -0700, Andre Muezerie wrote:
> 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.
>
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
> drivers/net/mlx5/mlx5_tx.c | 4 ++--
> drivers/net/mlx5/mlx5_utils.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_tx.c b/drivers/net/mlx5/mlx5_tx.c
> index 39afca3d64..b2522e7170 100644
> --- a/drivers/net/mlx5/mlx5_tx.c
> +++ b/drivers/net/mlx5/mlx5_tx.c
> @@ -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;
> }
> diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
> index d882af6047..645bb118fb 100644
> --- a/drivers/net/mlx5/mlx5_utils.c
> +++ b/drivers/net/mlx5/mlx5_utils.c
> @@ -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,
> --
> 2.49.0.vfs.0.2
Would someone be able to review this patchset?
Thanks,
Andre Muezerie
next prev parent reply other threads:[~2025-06-03 1:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-05 15:04 Andre Muezerie
2025-06-03 1:10 ` Andre Muezerie [this message]
2025-06-03 15:23 ` Dariusz Sosnowski
2025-06-04 15:02 ` Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250603011002.GA1658@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
--to=andremue@linux.microsoft.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).