Skip to content

Commit 596c5ff

Browse files
ogerlitzMukesh Kacker
authored andcommitted
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 <[email protected]> Signed-off-by: Aviad Yehezkel <[email protected]> Signed-off-by: Jack Morgenstein <[email protected]> Signed-off-by: Vladimir Sokolovsky <[email protected]> (Ported from Mellanox OFED 2.4) Signed-off-by: Mukesh Kacker <[email protected]>
1 parent bd2177d commit 596c5ff

File tree

1 file changed

+10
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+10
-1
lines changed

drivers/net/ethernet/mellanox/mlx4/port.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,15 @@ enum {
930930
MLX4_CHANGE_PORT_MTU_CAP = 22,
931931
};
932932

933+
#define CX3_PPF_DEV_ID 0x1003
934+
static int vl_cap_start(struct mlx4_dev *dev)
935+
{
936+
/* for non CX3 devices, start with 4 VLs to avoid errors in syslog */
937+
if (dev->persist->pdev->device != CX3_PPF_DEV_ID)
938+
return 4;
939+
return 8;
940+
}
941+
933942
int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
934943
{
935944
struct mlx4_cmd_mailbox *mailbox;
@@ -950,7 +959,7 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
950959
}
951960

952961
/* IB VL CAP enum isn't used by the firmware, just numerical values */
953-
for (vl_cap = 8; vl_cap >= 1; vl_cap >>= 1) {
962+
for (vl_cap = vl_cap_start(dev); vl_cap >= 1; vl_cap >>= 1) {
954963
((__be32 *) mailbox->buf)[0] = cpu_to_be32(
955964
(1 << MLX4_CHANGE_PORT_MTU_CAP) |
956965
(1 << MLX4_CHANGE_PORT_VL_CAP) |

0 commit comments

Comments
 (0)