aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/port.c
diff options
context:
space:
mode:
authorMajd Dibbiny <majd@mellanox.com>2015-06-04 19:30:43 +0300
committerDavid S. Miller <davem@davemloft.net>2015-06-04 16:41:01 -0700
commite760152d08da78aa160e68ac90bf8f3f10aff462 (patch)
tree677d7691c175a8fe684c30e3392b8d0513a8f062 /drivers/net/ethernet/mellanox/mlx5/core/port.c
parentnet/mlx5_core: Get vendor-id using the query adapter command (diff)
downloadlinux-dev-e760152d08da78aa160e68ac90bf8f3f10aff462.tar.xz
linux-dev-e760152d08da78aa160e68ac90bf8f3f10aff462.zip
net/mlx5_core: Use port number in the query port mtu helpers
Extend the function prototypes for max and operational mtu to take the local port number. In the Ethernet driver is this hard coded to one, since ConnectX4 Ethernet devices are always function-per-port. The IB driver also serves older devices (ConnectIB) which isn't such, and hence the part can vary. Signed-off-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/port.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/port.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c
index 7d3d0f9f328d..d9498aae5ab5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/port.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c
@@ -213,7 +213,8 @@ int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status)
}
static int mlx5_query_port_mtu(struct mlx5_core_dev *dev,
- int *admin_mtu, int *max_mtu, int *oper_mtu)
+ int *admin_mtu, int *max_mtu, int *oper_mtu,
+ u8 local_port)
{
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
@@ -221,7 +222,7 @@ static int mlx5_query_port_mtu(struct mlx5_core_dev *dev,
memset(in, 0, sizeof(in));
- MLX5_SET(pmtu_reg, in, local_port, 1);
+ MLX5_SET(pmtu_reg, in, local_port, local_port);
err = mlx5_core_access_reg(dev, in, sizeof(in), out,
sizeof(out), MLX5_REG_PMTU, 0, 0);
@@ -253,14 +254,16 @@ int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu)
}
EXPORT_SYMBOL_GPL(mlx5_set_port_mtu);
-int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu)
+int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu,
+ u8 local_port)
{
- return mlx5_query_port_mtu(dev, NULL, max_mtu, NULL);
+ return mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, local_port);
}
EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu);
-int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu)
+int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
+ u8 local_port)
{
- return mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu);
+ return mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, local_port);
}
EXPORT_SYMBOL_GPL(mlx5_query_port_oper_mtu);