net/mlx4_core: Deprecate error message at ConnectX-2 cards startup to debug
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Tue, 30 Sep 2014 09:03:50 +0000 (12:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Sep 2014 20:27:50 +0000 (16:27 -0400)
ConnectX2 HCAs have max_mtu=4k and max_vl=8 vls. However, if you specify
a 4K mtu, the max_vl supported for 4K is 4 vls. The driver at startup
attempts to set a 4K mtu using the max_vl value obtained from QUERY_PORT.

Since the max_vl value is 8 vls (which is supported up to 2K mtu size),
the first attempt to set the mtl/vl port value will fail, generating
the following error message in the log:

  mlx4_core 0000:06:00.0: command 0xc failed: fw status = 0x40

The driver then tries again, using mtu=4k, vls=4, and this succeeds.

Since we do not want to have this error message always displayed at driver
start when there are ConnectX2 HCAs on the host, we deprecate the error
message for this specific command/input_modifier/opcode_modifier/fw-status
to be debug.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c

index 02a2e90..436c82f 100644 (file)
@@ -580,8 +580,18 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
 
        err = context->result;
        if (err) {
-               mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n",
-                        op, context->fw_status);
+               /* Since we do not want to have this error message always
+                * displayed at driver start when there are ConnectX2 HCAs
+                * on the host, we deprecate the error message for this
+                * specific command/input_mod/opcode_mod/fw-status to be debug.
+                */
+               if (op == MLX4_CMD_SET_PORT && in_modifier == 1 &&
+                   op_modifier == 0 && context->fw_status == CMD_STAT_BAD_SIZE)
+                       mlx4_dbg(dev, "command 0x%x failed: fw status = 0x%x\n",
+                                op, context->fw_status);
+               else
+                       mlx4_err(dev, "command 0x%x failed: fw status = 0x%x\n",
+                                op, context->fw_status);
                goto out;
        }