Skip to content

Commit 718195d

Browse files
ogerlitzSomasundaram Krishnasamy
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]> Orabug: 27510505 (cherry picked from commit 596c5ff) cherry-pick-repo=linux-uek.git Signed-off-by: Qing Huang <[email protected]> Signed-off-by: Aron Silverton <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent bcdd823 commit 718195d

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
@@ -1565,6 +1565,15 @@ enum {
15651565
MLX4_CHANGE_PORT_MTU_CAP = 22,
15661566
};
15671567

1568+
#define CX3_PPF_DEV_ID 0x1003
1569+
static int vl_cap_start(struct mlx4_dev *dev)
1570+
{
1571+
/* for non CX3 devices, start with 4 VLs to avoid errors in syslog */
1572+
if (dev->persist->pdev->device != CX3_PPF_DEV_ID)
1573+
return 4;
1574+
return 8;
1575+
}
1576+
15681577
int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
15691578
{
15701579
struct mlx4_cmd_mailbox *mailbox;
@@ -1585,7 +1594,7 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port, int pkey_tbl_sz)
15851594
}
15861595

15871596
/* IB VL CAP enum isn't used by the firmware, just numerical values */
1588-
for (vl_cap = 8; vl_cap >= 1; vl_cap >>= 1) {
1597+
for (vl_cap = vl_cap_start(dev); vl_cap >= 1; vl_cap >>= 1) {
15891598
((__be32 *) mailbox->buf)[0] = cpu_to_be32(
15901599
(1 << MLX4_CHANGE_PORT_MTU_CAP) |
15911600
(1 << MLX4_CHANGE_PORT_VL_CAP) |

0 commit comments

Comments
 (0)