]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/mlx4: adjust initial value of vl_cap in mlx4_SET_PORT
authorOr Gerlitz <ogerlitz@mellanox.com>
Tue, 20 Mar 2012 10:53:51 +0000 (12:53 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:38:09 +0000 (14:38 -0700)
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 <ogerlitz@mellanox.com>
Signed-off-by: Aviad Yehezkel <aviadye@mellanox.co.il>
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/net/ethernet/mellanox/mlx4/port.c

index c2b21313dba7f64d0e51cff8ca3c601720a848ef..f59f84e3c7fd5a8f62d62bc9b9e15342185d0f55 100644 (file)
@@ -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)  |