* [PATCH net-next] net/mlx4: Use bitmap_weight_and()
@ 2023-05-23 18:17 Christophe JAILLET
2023-05-24 10:34 ` Simon Horman
2023-05-25 11:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2023-05-23 18:17 UTC (permalink / raw)
To: Tariq Toukan, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev, linux-rdma
Use bitmap_weight_and() instead of hand writing it.
This saves a few LoC and is slightly faster, should it mater.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 277738c50c56..28c435ce98d8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1374,16 +1374,13 @@ static int mlx4_mf_bond(struct mlx4_dev *dev)
int nvfs;
struct mlx4_slaves_pport slaves_port1;
struct mlx4_slaves_pport slaves_port2;
- DECLARE_BITMAP(slaves_port_1_2, MLX4_MFUNC_MAX);
slaves_port1 = mlx4_phys_to_slaves_pport(dev, 1);
slaves_port2 = mlx4_phys_to_slaves_pport(dev, 2);
- bitmap_and(slaves_port_1_2,
- slaves_port1.slaves, slaves_port2.slaves,
- dev->persist->num_vfs + 1);
/* only single port vfs are allowed */
- if (bitmap_weight(slaves_port_1_2, dev->persist->num_vfs + 1) > 1) {
+ if (bitmap_weight_and(slaves_port1.slaves, slaves_port2.slaves,
+ dev->persist->num_vfs + 1) > 1) {
mlx4_warn(dev, "HA mode unsupported for dual ported VFs\n");
return -EINVAL;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/mlx4: Use bitmap_weight_and()
2023-05-23 18:17 [PATCH net-next] net/mlx4: Use bitmap_weight_and() Christophe JAILLET
@ 2023-05-24 10:34 ` Simon Horman
2023-05-25 11:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-05-24 10:34 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Tariq Toukan, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-kernel, kernel-janitors, netdev, linux-rdma
On Tue, May 23, 2023 at 08:17:52PM +0200, Christophe JAILLET wrote:
> Use bitmap_weight_and() instead of hand writing it.
>
> This saves a few LoC and is slightly faster, should it mater.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/mlx4: Use bitmap_weight_and()
2023-05-23 18:17 [PATCH net-next] net/mlx4: Use bitmap_weight_and() Christophe JAILLET
2023-05-24 10:34 ` Simon Horman
@ 2023-05-25 11:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-25 11:40 UTC (permalink / raw)
To: Christophe JAILLET
Cc: tariqt, davem, edumazet, kuba, pabeni, linux-kernel,
kernel-janitors, netdev, linux-rdma
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 23 May 2023 20:17:52 +0200 you wrote:
> Use bitmap_weight_and() instead of hand writing it.
>
> This saves a few LoC and is slightly faster, should it mater.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/net/ethernet/mellanox/mlx4/main.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
Here is the summary with links:
- [net-next] net/mlx4: Use bitmap_weight_and()
https://git.kernel.org/netdev/net-next/c/623a71385312
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-25 11:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 18:17 [PATCH net-next] net/mlx4: Use bitmap_weight_and() Christophe JAILLET
2023-05-24 10:34 ` Simon Horman
2023-05-25 11:40 ` patchwork-bot+netdevbpf
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).