diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-05-15 10:34:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-16 00:56:58 -0400 |
commit | 8bac9ede683f0af92cb50820df138b9c1e6cabe2 (patch) | |
tree | 4a27d7851474af60e2fb11feee60707733a3d2ff | |
parent | 162344ed2c80845200845f83e310fa3058bfe001 (diff) | |
download | linux-3.10-8bac9ede683f0af92cb50820df138b9c1e6cabe2.tar.gz linux-3.10-8bac9ede683f0af92cb50820df138b9c1e6cabe2.tar.bz2 linux-3.10-8bac9ede683f0af92cb50820df138b9c1e6cabe2.zip |
net/mlx4_core: Fix init_port mask state for slaves
In function mlx4_INIT_PORT_wrapper, the port state mask for the
slave is only set if we are invoking the INIT_PORT fw command.
However, the reference count for the (initialized) port is
incremented anyway.
This creates a problem in that when we have multiple slaves,
then the CLOSE_PORT command will never be invoked. The
reason is that in the CLOSE_PORT wrapper, if the port-state
mask is zero for the slave (which it is), the wrapper returns
without doing anything. The only slave which will not return
immediately in the CLOSE_PORT wrapper is that slave for which
INIT_PORT was invoked.
The fix is to not have the port-state mask setting depend
on the logic for calling the INIT_PORT fw command.
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>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 2a02ba522e6..24429a99190 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -1164,9 +1164,8 @@ int mlx4_INIT_PORT_wrapper(struct mlx4_dev *dev, int slave, MLX4_CMD_TIME_CLASS_A, MLX4_CMD_NATIVE); if (err) return err; - priv->mfunc.master.slave_state[slave].init_port_mask |= - (1 << port); } + priv->mfunc.master.slave_state[slave].init_port_mask |= (1 << port); ++priv->mfunc.master.init_port_ref[port]; return 0; } |