diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2016-04-21 17:33:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-24 14:51:38 -0400 |
commit | 046339eaab26804f52f6604877f5674f70815b26 (patch) | |
tree | d81c5d17ab6aa1ece50ae269db925c72216ff2e2 | |
parent | 64dbbdfef245f67504ec403a5aebfcc7b92bd8c1 (diff) |
net/mlx5e: Device's mtu field is u16 and not int
For set/query MTU port firmware commands the MTU field
is 16 bits, here I changed all the "int mtu" parameters
of the functions wrapping those firmware commands to be u16.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/port.c | 10 | ||||
-rw-r--r-- | include/linux/mlx5/port.h | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 5acf346e048e..99eb1c1a3b7b 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -671,8 +671,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, | |||
671 | struct mlx5_ib_dev *dev = to_mdev(ibdev); | 671 | struct mlx5_ib_dev *dev = to_mdev(ibdev); |
672 | struct mlx5_core_dev *mdev = dev->mdev; | 672 | struct mlx5_core_dev *mdev = dev->mdev; |
673 | struct mlx5_hca_vport_context *rep; | 673 | struct mlx5_hca_vport_context *rep; |
674 | int max_mtu; | 674 | u16 max_mtu; |
675 | int oper_mtu; | 675 | u16 oper_mtu; |
676 | int err; | 676 | int err; |
677 | u8 ib_link_width_oper; | 677 | u8 ib_link_width_oper; |
678 | u8 vl_hw_cap; | 678 | u8 vl_hw_cap; |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index e0adb604f461..2fbbc625f106 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c | |||
@@ -1408,7 +1408,7 @@ static int mlx5e_set_dev_port_mtu(struct net_device *netdev) | |||
1408 | { | 1408 | { |
1409 | struct mlx5e_priv *priv = netdev_priv(netdev); | 1409 | struct mlx5e_priv *priv = netdev_priv(netdev); |
1410 | struct mlx5_core_dev *mdev = priv->mdev; | 1410 | struct mlx5_core_dev *mdev = priv->mdev; |
1411 | int hw_mtu; | 1411 | u16 hw_mtu; |
1412 | int err; | 1412 | int err; |
1413 | 1413 | ||
1414 | err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(netdev->mtu), 1); | 1414 | err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(netdev->mtu), 1); |
@@ -2004,7 +2004,7 @@ static int mlx5e_change_mtu(struct net_device *netdev, int new_mtu) | |||
2004 | struct mlx5e_priv *priv = netdev_priv(netdev); | 2004 | struct mlx5e_priv *priv = netdev_priv(netdev); |
2005 | struct mlx5_core_dev *mdev = priv->mdev; | 2005 | struct mlx5_core_dev *mdev = priv->mdev; |
2006 | bool was_opened; | 2006 | bool was_opened; |
2007 | int max_mtu; | 2007 | u16 max_mtu; |
2008 | int err = 0; | 2008 | int err = 0; |
2009 | 2009 | ||
2010 | mlx5_query_port_max_mtu(mdev, &max_mtu, 1); | 2010 | mlx5_query_port_max_mtu(mdev, &max_mtu, 1); |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c index ae378c575deb..53cc1e2c693b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c | |||
@@ -247,8 +247,8 @@ int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, | |||
247 | } | 247 | } |
248 | EXPORT_SYMBOL_GPL(mlx5_query_port_admin_status); | 248 | EXPORT_SYMBOL_GPL(mlx5_query_port_admin_status); |
249 | 249 | ||
250 | static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu, | 250 | static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, u16 *admin_mtu, |
251 | int *max_mtu, int *oper_mtu, u8 port) | 251 | u16 *max_mtu, u16 *oper_mtu, u8 port) |
252 | { | 252 | { |
253 | u32 in[MLX5_ST_SZ_DW(pmtu_reg)]; | 253 | u32 in[MLX5_ST_SZ_DW(pmtu_reg)]; |
254 | u32 out[MLX5_ST_SZ_DW(pmtu_reg)]; | 254 | u32 out[MLX5_ST_SZ_DW(pmtu_reg)]; |
@@ -268,7 +268,7 @@ static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu, | |||
268 | *admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu); | 268 | *admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu); |
269 | } | 269 | } |
270 | 270 | ||
271 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port) | 271 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port) |
272 | { | 272 | { |
273 | u32 in[MLX5_ST_SZ_DW(pmtu_reg)]; | 273 | u32 in[MLX5_ST_SZ_DW(pmtu_reg)]; |
274 | u32 out[MLX5_ST_SZ_DW(pmtu_reg)]; | 274 | u32 out[MLX5_ST_SZ_DW(pmtu_reg)]; |
@@ -283,14 +283,14 @@ int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port) | |||
283 | } | 283 | } |
284 | EXPORT_SYMBOL_GPL(mlx5_set_port_mtu); | 284 | EXPORT_SYMBOL_GPL(mlx5_set_port_mtu); |
285 | 285 | ||
286 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, | 286 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu, |
287 | u8 port) | 287 | u8 port) |
288 | { | 288 | { |
289 | mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, port); | 289 | mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, port); |
290 | } | 290 | } |
291 | EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu); | 291 | EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu); |
292 | 292 | ||
293 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu, | 293 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu, |
294 | u8 port) | 294 | u8 port) |
295 | { | 295 | { |
296 | mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, port); | 296 | mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, port); |
diff --git a/include/linux/mlx5/port.h b/include/linux/mlx5/port.h index a1d145abd4eb..b30250ab7604 100644 --- a/include/linux/mlx5/port.h +++ b/include/linux/mlx5/port.h | |||
@@ -54,9 +54,9 @@ int mlx5_set_port_admin_status(struct mlx5_core_dev *dev, | |||
54 | int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, | 54 | int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, |
55 | enum mlx5_port_status *status); | 55 | enum mlx5_port_status *status); |
56 | 56 | ||
57 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port); | 57 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port); |
58 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, u8 port); | 58 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu, u8 port); |
59 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu, | 59 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu, |
60 | u8 port); | 60 | u8 port); |
61 | 61 | ||
62 | int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev, | 62 | int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev, |