All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c
@ 2012-04-16  3:09 Paul Gortmaker
  2012-04-16  3:31 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2012-04-16  3:09 UTC (permalink / raw)
  To: netdev; +Cc: Paul Gortmaker, Amir Vadai, David S. Miller

Commit 109d2446052a484c58f07f71f9457bf7b71017f8

    "net/mlx4_en: Set max rate-limit for a TC"

introduced 64 bit math operations into mlx4_en_dcbnl_ieee_setmaxrate()

causing the following final link failure on an x86_32 allmodconfig

  ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko] undefined!

Convert it to use div_u64() instead.

Cc: Amir Vadai <amirv@mellanox.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[seen in linux-next: http://kisskb.ellerman.id.au/kisskb/buildresult/6091475/]

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index 0cc6c96..720cb55 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -227,9 +227,9 @@ static int mlx4_en_dcbnl_ieee_setmaxrate(struct net_device *dev,
 		/* Convert from Kbps into HW units, rounding result up.
 		 * Setting to 0, means unlimited BW.
 		 */
-		tmp[i] =
-			(maxrate->tc_maxrate[i] + MLX4_RATELIMIT_UNITS_IN_KB -
-			 1) / MLX4_RATELIMIT_UNITS_IN_KB;
+		tmp[i] = div_u64(maxrate->tc_maxrate[i] +
+				 MLX4_RATELIMIT_UNITS_IN_KB - 1,
+				 MLX4_RATELIMIT_UNITS_IN_KB);
 	}
 
 	err = mlx4_en_config_port_scheduler(priv, NULL, tmp);
-- 
1.7.9.1

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

* Re: [PATCH net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c
  2012-04-16  3:09 [PATCH net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c Paul Gortmaker
@ 2012-04-16  3:31 ` David Miller
  2012-04-16  4:17   ` [PATCH v2 " Paul Gortmaker
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2012-04-16  3:31 UTC (permalink / raw)
  To: paul.gortmaker; +Cc: netdev, amirv

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Sun, 15 Apr 2012 23:09:54 -0400

> Commit 109d2446052a484c58f07f71f9457bf7b71017f8
> 
>     "net/mlx4_en: Set max rate-limit for a TC"
> 
> introduced 64 bit math operations into mlx4_en_dcbnl_ieee_setmaxrate()
> 
> causing the following final link failure on an x86_32 allmodconfig
> 
>   ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko] undefined!
> 
> Convert it to use div_u64() instead.
> 
> Cc: Amir Vadai <amirv@mellanox.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Please add an explicit linux/math64.h include here too, thanks.

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

* [PATCH v2 net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c
  2012-04-16  3:31 ` David Miller
@ 2012-04-16  4:17   ` Paul Gortmaker
  2012-04-16  6:12     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2012-04-16  4:17 UTC (permalink / raw)
  To: netdev; +Cc: Paul Gortmaker, Amir Vadai, David S. Miller

Commit 109d2446052a484c58f07f71f9457bf7b71017f8

    "net/mlx4_en: Set max rate-limit for a TC"

introduced 64 bit math operations into mlx4_en_dcbnl_ieee_setmaxrate()

causing the following final link failure on an x86_32 allmodconfig

  ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko] undefined!

Convert it to use div_u64() instead.

Cc: Amir Vadai <amirv@mellanox.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[ v2: add an explicit linux/math64.h include as per davem req ]

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
index 0cc6c96..5d367958 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
@@ -32,6 +32,7 @@
  */
 
 #include <linux/dcbnl.h>
+#include <linux/math64.h>
 
 #include "mlx4_en.h"
 
@@ -227,9 +228,9 @@ static int mlx4_en_dcbnl_ieee_setmaxrate(struct net_device *dev,
 		/* Convert from Kbps into HW units, rounding result up.
 		 * Setting to 0, means unlimited BW.
 		 */
-		tmp[i] =
-			(maxrate->tc_maxrate[i] + MLX4_RATELIMIT_UNITS_IN_KB -
-			 1) / MLX4_RATELIMIT_UNITS_IN_KB;
+		tmp[i] = div_u64(maxrate->tc_maxrate[i] +
+				 MLX4_RATELIMIT_UNITS_IN_KB - 1,
+				 MLX4_RATELIMIT_UNITS_IN_KB);
 	}
 
 	err = mlx4_en_config_port_scheduler(priv, NULL, tmp);
-- 
1.7.9.1

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

* Re: [PATCH v2 net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c
  2012-04-16  4:17   ` [PATCH v2 " Paul Gortmaker
@ 2012-04-16  6:12     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-04-16  6:12 UTC (permalink / raw)
  To: paul.gortmaker; +Cc: netdev, amirv

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Mon, 16 Apr 2012 00:17:34 -0400

> Commit 109d2446052a484c58f07f71f9457bf7b71017f8
> 
>     "net/mlx4_en: Set max rate-limit for a TC"
> 
> introduced 64 bit math operations into mlx4_en_dcbnl_ieee_setmaxrate()
> 
> causing the following final link failure on an x86_32 allmodconfig
> 
>   ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko] undefined!
> 
> Convert it to use div_u64() instead.
> 
> Cc: Amir Vadai <amirv@mellanox.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied, thanks Paul.

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

end of thread, other threads:[~2012-04-16  6:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16  3:09 [PATCH net-next] drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c Paul Gortmaker
2012-04-16  3:31 ` David Miller
2012-04-16  4:17   ` [PATCH v2 " Paul Gortmaker
2012-04-16  6:12     ` David Miller

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.