[ofa-general] mlx4: Allow resetting capability mask to defaults with SET_PORT

Jack Morgenstein jackm at dev.mellanox.co.il
Tue Nov 4 02:14:38 PST 2008


mlx4: Allow resetting capability mask to defaults with SET_PORT

Commit 7ff93f8b7... introduced support for different port types.
As part of that support, SET_PORT is invoked to set the port type
during driver startup.  However, as a side-effect, for IB ports
the invocation of this command also sets the port capability mask
to zero (losing the default configuration values set by FW).

This fix introduces use of the new rcm (reset capability mask) bit
in the SET_PORT command (bit 30 of first mailbox dword) which resets
the capability mask to the FW default value for that port (ignoring
the value included in the command mailbox).

The fix is to set the rcm bit when first setting the port-type to IB,
thus also restoring the capability mask to its default value (rather
than to zero).
(The fix also sets the rqk bit to reset the Qkey violations counter).

The fix requires ConnectX fw 2.5.927 or later to operate properly;
it will do no harm, however, if the driver runs over earlier FW --
the problem simply will still occur.

This patch fixes Bugzilla 1183 (which occurred because the
IsTrapSupported bit in the capability mask was zeroed).

Signed-off-by: Jack Morgenstein <jackm at dev.mellanox.co.il>

diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index e2fdab4..145d6e1 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -273,7 +273,8 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port)
 		((u8 *) mailbox->buf)[3] = 6;
 		((__be16 *) mailbox->buf)[4] = cpu_to_be16(1 << 15);
 		((__be16 *) mailbox->buf)[6] = cpu_to_be16(1 << 15);
-	}
+	} else
+		((u8 *) mailbox->buf)[3] = 3;
 	err = mlx4_cmd(dev, mailbox->dma, port, is_eth, MLX4_CMD_SET_PORT,
 		       MLX4_CMD_TIME_CLASS_B);
 



More information about the general mailing list