All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx5: fix 32bit build
@ 2022-07-05  7:17 Paolo Abeni
  2022-07-05  7:39 ` Saeed Mahameed
  2022-07-05 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Paolo Abeni @ 2022-07-05  7:17 UTC (permalink / raw)
  To: netdev
  Cc: Saeed Mahameed, Leon Romanovsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Jianbo Liu, Roi Dayan, Ariel Levkovich

We can't use the division operator on 64 bits integers, that breaks
32 bits build. Instead use the relevant helper.

Fixes: 6ddac26cf763 ("net/mlx5e: Add support to modify hardware flow meter parameters")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c
index 28962b2134c7..ca33f673396f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 // Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 
+#include <linux/math64.h>
 #include "lib/aso.h"
 #include "en/tc/post_act.h"
 #include "meter.h"
@@ -61,7 +62,7 @@ mlx5e_flow_meter_cir_calc(u64 cir, u8 *man, u8 *exp)
 		m = cir << e;
 		if ((s64)m < 0) /* overflow */
 			break;
-		m /= MLX5_CONST_CIR;
+		m = div64_u64(m, MLX5_CONST_CIR);
 		if (m > 0xFF) /* man width 8 bit */
 			continue;
 		_cir = MLX5_CALC_CIR(m, e);
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx5: fix 32bit build
  2022-07-05  7:17 [PATCH net-next] net/mlx5: fix 32bit build Paolo Abeni
@ 2022-07-05  7:39 ` Saeed Mahameed
  2022-07-05  7:57   ` Paolo Abeni
  2022-07-05 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Saeed Mahameed @ 2022-07-05  7:39 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, Saeed Mahameed, Leon Romanovsky, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Jianbo Liu, Roi Dayan,
	Ariel Levkovich

On 05 Jul 09:17, Paolo Abeni wrote:
>We can't use the division operator on 64 bits integers, that breaks
>32 bits build. Instead use the relevant helper.
>
>Fixes: 6ddac26cf763 ("net/mlx5e: Add support to modify hardware flow meter parameters")
>Signed-off-by: Paolo Abeni <pabeni@redhat.com>

Acked-by: Saeed Mahameed <saeedm@nvidia.com>

sorry for the mess. I sent v2 too soon, forgot to squash the 2nd fix to it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx5: fix 32bit build
  2022-07-05  7:39 ` Saeed Mahameed
@ 2022-07-05  7:57   ` Paolo Abeni
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2022-07-05  7:57 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: netdev, Saeed Mahameed, Leon Romanovsky, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Jianbo Liu, Roi Dayan,
	Ariel Levkovich

On Tue, 2022-07-05 at 00:39 -0700, Saeed Mahameed wrote:
> On 05 Jul 09:17, Paolo Abeni wrote:
> > We can't use the division operator on 64 bits integers, that breaks
> > 32 bits build. Instead use the relevant helper.
> > 
> > Fixes: 6ddac26cf763 ("net/mlx5e: Add support to modify hardware flow meter parameters")
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> 
> Acked-by: Saeed Mahameed <saeedm@nvidia.com>
> 
> sorry for the mess. I sent v2 too soon, forgot to squash the 2nd fix to it.

No problems, it happens. 

Unless someone raises some concerns soon, I'm going to merge this one
well before the usual 24h staging time, to keep PW and the tree okish.

Cheers,

Paolo


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx5: fix 32bit build
  2022-07-05  7:17 [PATCH net-next] net/mlx5: fix 32bit build Paolo Abeni
  2022-07-05  7:39 ` Saeed Mahameed
@ 2022-07-05 10:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-05 10:20 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, saeedm, leon, davem, edumazet, kuba, jianbol, roid, lariel

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  5 Jul 2022 09:17:04 +0200 you wrote:
> We can't use the division operator on 64 bits integers, that breaks
> 32 bits build. Instead use the relevant helper.
> 
> Fixes: 6ddac26cf763 ("net/mlx5e: Add support to modify hardware flow meter parameters")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net/mlx5: fix 32bit build
    https://git.kernel.org/netdev/net-next/c/55ae465222d0

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] 4+ messages in thread

end of thread, other threads:[~2022-07-05 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05  7:17 [PATCH net-next] net/mlx5: fix 32bit build Paolo Abeni
2022-07-05  7:39 ` Saeed Mahameed
2022-07-05  7:57   ` Paolo Abeni
2022-07-05 10:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.