All of lore.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz@mellanox.com>
To: unlisted-recipients:; (no To-header on input)
Cc: roland@kernel.org, netdev@vger.kernel.org, yevgenyp@mellanox.com,
	Jack Morgenstein <jackm@dev.mellanox.co.il>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH net-next V2 2/8] net/mlx4_core: Fix init_port mask state for slaves
Date: Tue, 15 May 2012 23:34:58 +0300	[thread overview]
Message-ID: <1337114104-26094-3-git-send-email-ogerlitz@mellanox.com> (raw)
In-Reply-To: <1337114104-26094-1-git-send-email-ogerlitz@mellanox.com>

From: Jack Morgenstein <jackm@dev.mellanox.co.il>

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>
---
 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 2a02ba5..24429a9 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;
 }
-- 
1.7.1

  parent reply	other threads:[~2012-05-15 20:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 20:34 [PATCH net-next V2 0/8] batch of mlx4 driver fixes Or Gerlitz
2012-05-15 20:34 ` [PATCH net-next V2 1/8] net/mlx4: Address build warnings on set but not used variables Or Gerlitz
2012-05-15 20:34 ` Or Gerlitz [this message]
2012-05-15 20:34 ` [PATCH net-next V2 3/8] net/mlx4_core: Change SYNC_TPT to be native (not wrapped) Or Gerlitz
2012-05-15 20:35 ` [PATCH net-next V2 4/8] net/mlx4_core: Remove unused *_str functions from the resource tracker Or Gerlitz
2012-05-15 20:35 ` [PATCH net-next V2 5/8] net/mlx4_core: Do not reset module-parameter num_vfs when fail to enable sriov Or Gerlitz
2012-05-15 20:35 ` [PATCH net-next V2 6/8] net/mlx4_core: Fix potential kernel Oops in res tracker during Dom0 driver unload Or Gerlitz
2012-05-15 20:35 ` [PATCH net-next V2 7/8] net/mlx4_core: Add XRC domains and counters to resource tracker Or Gerlitz
2012-05-15 20:35 ` [PATCH net-next V2 8/8] net/mlx4_core: Fixed error flow in rem_slave_eqs Or Gerlitz
2012-05-16  4:57 ` [PATCH net-next V2 0/8] batch of mlx4 driver fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337114104-26094-3-git-send-email-ogerlitz@mellanox.com \
    --to=ogerlitz@mellanox.com \
    --cc=jackm@dev.mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=roland@kernel.org \
    --cc=yevgenyp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.