Skip to content

Commit

Permalink
drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c
Browse files Browse the repository at this point in the history
Commit 109d244

    "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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Gortmaker authored and David S. Miller committed Apr 16, 2012
1 parent 56845d7 commit 43c880d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/

#include <linux/dcbnl.h>
#include <linux/math64.h>

#include "mlx4_en.h"

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 43c880d

Please sign in to comment.