From 596c5ff4b7b31e54a565b312433fc1cbaf4095cb Mon Sep 17 00:00:00 2001 From: Or Gerlitz Date: Tue, 20 Mar 2012 12:53:51 +0200 Subject: [PATCH] net/mlx4: adjust initial value of vl_cap in mlx4_SET_PORT Adjust the initial value of vl_cap in mlx4_SET_PORT such that only for CX3 devices we start with 8 VLs, in an attempt to avoid errors such as: mlx4_core 0000:06:00.0: command 0xc failed: fw status = 0x40 mlx4_core 0000:06:00.0: vhcr command:0xc slave:0 failed with error:0, status -12 to appear in the system log. Signed-off-by: Or Gerlitz Signed-off-by: Aviad Yehezkel Signed-off-by: Jack Morgenstein Signed-off-by: Vladimir Sokolovsky (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker --- drivers/net/ethernet/mellanox/mlx4/port.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index c2b21313dba7..f59f84e3c7fd 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c @@ -930,6 +930,15 @@ enum { MLX4_CHANGE_PORT_MTU_CAP = 22, }; +#define CX3_PPF_DEV_ID 0x1003 +static int vl_cap_start(struct mlx4_dev *dev) +{ + /* for non CX3 devices, start with 4 VLs to avoid errors in syslog */ + if (dev->persist->pdev->device != CX3_PPF_DEV_ID) + return 4; + return 8; +} + int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz) { struct mlx4_cmd_mailbox *mailbox; @@ -950,7 +959,7 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz) } /* IB VL CAP enum isn't used by the firmware, just numerical values */ - for (vl_cap = 8; vl_cap >= 1; vl_cap >>= 1) { + for (vl_cap = vl_cap_start(dev); vl_cap >= 1; vl_cap >>= 1) { ((__be32 *) mailbox->buf)[0] = cpu_to_be32( (1 << MLX4_CHANGE_PORT_MTU_CAP) | (1 << MLX4_CHANGE_PORT_VL_CAP) | -- 2.49.0