|
@@ -248,22 +248,18 @@ int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status)
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
-static int mlx5_query_port_mtu(struct mlx5_core_dev *dev,
|
|
|
|
- int *admin_mtu, int *max_mtu, int *oper_mtu,
|
|
|
|
- u8 local_port)
|
|
|
|
|
|
+static void mlx5_query_port_mtu(struct mlx5_core_dev *dev, int *admin_mtu,
|
|
|
|
+ int *max_mtu, int *oper_mtu, u8 port)
|
|
{
|
|
{
|
|
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
- int err;
|
|
|
|
|
|
|
|
memset(in, 0, sizeof(in));
|
|
memset(in, 0, sizeof(in));
|
|
|
|
|
|
- MLX5_SET(pmtu_reg, in, local_port, local_port);
|
|
|
|
|
|
+ MLX5_SET(pmtu_reg, in, local_port, port);
|
|
|
|
|
|
- err = mlx5_core_access_reg(dev, in, sizeof(in), out,
|
|
|
|
- sizeof(out), MLX5_REG_PMTU, 0, 0);
|
|
|
|
- if (err)
|
|
|
|
- return err;
|
|
|
|
|
|
+ mlx5_core_access_reg(dev, in, sizeof(in), out,
|
|
|
|
+ sizeof(out), MLX5_REG_PMTU, 0, 0);
|
|
|
|
|
|
if (max_mtu)
|
|
if (max_mtu)
|
|
*max_mtu = MLX5_GET(pmtu_reg, out, max_mtu);
|
|
*max_mtu = MLX5_GET(pmtu_reg, out, max_mtu);
|
|
@@ -271,11 +267,9 @@ static int mlx5_query_port_mtu(struct mlx5_core_dev *dev,
|
|
*oper_mtu = MLX5_GET(pmtu_reg, out, oper_mtu);
|
|
*oper_mtu = MLX5_GET(pmtu_reg, out, oper_mtu);
|
|
if (admin_mtu)
|
|
if (admin_mtu)
|
|
*admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu);
|
|
*admin_mtu = MLX5_GET(pmtu_reg, out, admin_mtu);
|
|
-
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu)
|
|
|
|
|
|
+int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port)
|
|
{
|
|
{
|
|
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 in[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
u32 out[MLX5_ST_SZ_DW(pmtu_reg)];
|
|
@@ -283,24 +277,24 @@ int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu)
|
|
memset(in, 0, sizeof(in));
|
|
memset(in, 0, sizeof(in));
|
|
|
|
|
|
MLX5_SET(pmtu_reg, in, admin_mtu, mtu);
|
|
MLX5_SET(pmtu_reg, in, admin_mtu, mtu);
|
|
- MLX5_SET(pmtu_reg, in, local_port, 1);
|
|
|
|
|
|
+ MLX5_SET(pmtu_reg, in, local_port, port);
|
|
|
|
|
|
- return mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out),
|
|
|
|
- MLX5_REG_PMTU, 0, 1);
|
|
|
|
|
|
+ return mlx5_core_access_reg(dev, in, sizeof(in), out,
|
|
|
|
+ sizeof(out), MLX5_REG_PMTU, 0, 1);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(mlx5_set_port_mtu);
|
|
EXPORT_SYMBOL_GPL(mlx5_set_port_mtu);
|
|
|
|
|
|
-int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu,
|
|
|
|
- u8 local_port)
|
|
|
|
|
|
+void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu,
|
|
|
|
+ u8 port)
|
|
{
|
|
{
|
|
- return mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, local_port);
|
|
|
|
|
|
+ mlx5_query_port_mtu(dev, NULL, max_mtu, NULL, port);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu);
|
|
EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu);
|
|
|
|
|
|
-int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
|
|
|
|
- u8 local_port)
|
|
|
|
|
|
+void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu,
|
|
|
|
+ u8 port)
|
|
{
|
|
{
|
|
- return mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, local_port);
|
|
|
|
|
|
+ mlx5_query_port_mtu(dev, NULL, NULL, oper_mtu, port);
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(mlx5_query_port_oper_mtu);
|
|
EXPORT_SYMBOL_GPL(mlx5_query_port_oper_mtu);
|
|
|
|
|