netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/6] bnx2x: Bug fixes patch series
@ 2013-09-23  7:12 Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 1/6] bnx2x: Prevent mistaken hangup between driver & FW Yuval Mintz
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong

Hi Dave,

This patch contains various bug fixes, half of which are SR-IOV related
(some fixing issues in the recently added VF RSS support), while the other fix
a wide assortments of issues in the driver.

Please consider applying these patches to `net'.

Thanks,
Yuval Mintz

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 1/6] bnx2x: Prevent mistaken hangup between driver & FW
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 2/6] bnx2x: Fix support for VFs on some PFs Yuval Mintz
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

From: Eilon Greenstein <eilong@broadcom.com>

When system CPU is stressed it's possible that the driver will not be able
to pulse the FW every second, which will cause the log to be filled with
error messages.

Increasing the threshold to 5 seconds seems to be enough to eliminate the
issue.

Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index a6704b5..f403c6b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -5447,26 +5447,24 @@ static void bnx2x_timer(unsigned long data)
 	if (IS_PF(bp) &&
 	    !BP_NOMCP(bp)) {
 		int mb_idx = BP_FW_MB_IDX(bp);
-		u32 drv_pulse;
-		u32 mcp_pulse;
+		u16 drv_pulse;
+		u16 mcp_pulse;
 
 		++bp->fw_drv_pulse_wr_seq;
 		bp->fw_drv_pulse_wr_seq &= DRV_PULSE_SEQ_MASK;
-		/* TBD - add SYSTEM_TIME */
 		drv_pulse = bp->fw_drv_pulse_wr_seq;
 		bnx2x_drv_pulse(bp);
 
 		mcp_pulse = (SHMEM_RD(bp, func_mb[mb_idx].mcp_pulse_mb) &
 			     MCP_PULSE_SEQ_MASK);
 		/* The delta between driver pulse and mcp response
-		 * should be 1 (before mcp response) or 0 (after mcp response)
+		 * should not get too big. If the MFW is more than 5 pulses
+		 * behind, we should worry about it enough to generate an error
+		 * log.
 		 */
-		if ((drv_pulse != mcp_pulse) &&
-		    (drv_pulse != ((mcp_pulse + 1) & MCP_PULSE_SEQ_MASK))) {
-			/* someone lost a heartbeat... */
-			BNX2X_ERR("drv_pulse (0x%x) != mcp_pulse (0x%x)\n",
+		if (((drv_pulse - mcp_pulse) & MCP_PULSE_SEQ_MASK) > 5)
+			BNX2X_ERR("MFW seems hanged: drv_pulse (0x%x) != mcp_pulse (0x%x)\n",
 				  drv_pulse, mcp_pulse);
-		}
 	}
 
 	if (bp->state == BNX2X_STATE_OPEN)
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 2/6] bnx2x: Fix support for VFs on some PFs
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 1/6] bnx2x: Prevent mistaken hangup between driver & FW Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 3/6] bnx2x: add missing VF resource allocation during init Yuval Mintz
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

From: Ariel Elior <ariele@broadcom.com>

Due to incorrect usage of PF macros when reading information relating to
interrupts, some PFs were erroneously unable to support VFs.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2604b62..d9370d4 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1819,7 +1819,7 @@ bnx2x_get_vf_igu_cam_info(struct bnx2x *bp)
 		fid = GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID);
 		if (fid & IGU_FID_ENCODE_IS_PF)
 			current_pf = fid & IGU_FID_PF_NUM_MASK;
-		else if (current_pf == BP_ABS_FUNC(bp))
+		else if (current_pf == BP_FUNC(bp))
 			bnx2x_vf_set_igu_info(bp, sb_id,
 					      (fid & IGU_FID_VF_NUM_MASK));
 		DP(BNX2X_MSG_IOV, "%s[%d], igu_sb_id=%d, msix=%d\n",
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 3/6] bnx2x: add missing VF resource allocation during init
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 1/6] bnx2x: Prevent mistaken hangup between driver & FW Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 2/6] bnx2x: Fix support for VFs on some PFs Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 4/6] bnx2x: prevent masking error from cnic Yuval Mintz
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

From: Ariel Elior <ariele@broadcom.com>

bnx2x_iov_static_resc() should be called after IGU was read for information on
the number of available VFs, so that resources will be correctly set.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index d9370d4..9ad012b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3180,6 +3180,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
 		/* set local queue arrays */
 		vf->vfqs = &bp->vfdb->vfqs[qcount];
 		qcount += vf_sb_count(vf);
+		bnx2x_iov_static_resc(bp, vf);
 	}
 
 	/* prepare msix vectors in VF configuration space */
@@ -3187,6 +3188,8 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
 		bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx));
 		REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL,
 		       num_vf_queues);
+		DP(BNX2X_MSG_IOV, "set msix vec num in VF %d cfg space to %d\n",
+		   vf_idx, num_vf_queues);
 	}
 	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 4/6] bnx2x: prevent masking error from cnic
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
                   ` (2 preceding siblings ...)
  2013-09-23  7:12 ` [PATCH net 3/6] bnx2x: add missing VF resource allocation during init Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 5/6] bnx2x: prevent masked MCP parities from appearing Yuval Mintz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

During error flows while loading cnic the return value was incorrectly replaced
by that of bnx2x_set_real_num_queues(); If that function was to finish
successfully then the cnic would have mistakenly thought the load ended
successfully, causing issues (& panics) later on.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 61726af..e66beff 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2481,8 +2481,7 @@ load_error_cnic2:
 load_error_cnic1:
 	bnx2x_napi_disable_cnic(bp);
 	/* Update the number of queues without the cnic queues */
-	rc = bnx2x_set_real_num_queues(bp, 0);
-	if (rc)
+	if (bnx2x_set_real_num_queues(bp, 0))
 		BNX2X_ERR("Unable to set real_num_queues not including cnic\n");
 load_error_cnic0:
 	BNX2X_ERR("CNIC-related load failed\n");
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 5/6] bnx2x: prevent masked MCP parities from appearing
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
                   ` (3 preceding siblings ...)
  2013-09-23  7:12 ` [PATCH net 4/6] bnx2x: prevent masking error from cnic Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23  7:12 ` [PATCH net 6/6] bnx2x: handle known but unsupported VF messages Yuval Mintz
  2013-09-23 20:18 ` [PATCH net 0/6] bnx2x: Bug fixes patch series David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

During flows which mask block attentions (e.g., register dump) all parities
are masked. However, unlike other blocks the MCP's attention is not masked
inside the block but rather the indication to the driver. If another attention
(e.g., link change) will occour while there's an MCP parity, the driver will
ignore the fact that the parity is masked and erroneously report a parity.

This patch forces the driver to read the MCP masking while checking for
parities.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index f403c6b..82b658d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -4703,6 +4703,14 @@ bool bnx2x_chk_parity_attn(struct bnx2x *bp, bool *global, bool print)
 	attn.sig[3] = REG_RD(bp,
 		MISC_REG_AEU_AFTER_INVERT_4_FUNC_0 +
 			     port*4);
+	/* Since MCP attentions can't be disabled inside the block, we need to
+	 * read AEU registers to see whether they're currently disabled
+	 */
+	attn.sig[3] &= ((REG_RD(bp,
+				!port ? MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0
+				      : MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0) &
+			 MISC_AEU_ENABLE_MCP_PRTY_BITS) |
+			~MISC_AEU_ENABLE_MCP_PRTY_BITS);
 
 	if (!CHIP_IS_E1x(bp))
 		attn.sig[4] = REG_RD(bp,
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 6/6] bnx2x: handle known but unsupported VF messages
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
                   ` (4 preceding siblings ...)
  2013-09-23  7:12 ` [PATCH net 5/6] bnx2x: prevent masked MCP parities from appearing Yuval Mintz
@ 2013-09-23  7:12 ` Yuval Mintz
  2013-09-23 20:18 ` [PATCH net 0/6] bnx2x: Bug fixes patch series David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: Yuval Mintz @ 2013-09-23  7:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: ariele, eilong, Yuval Mintz

From: Ariel Elior <ariele@broadcom.com>

Commit b9871bcf "bnx2x: VF RSS support - PF side" has deprecated one of
the previous existing messages. If an old VF driver were to send this message
to the PF then the PF will not reply and leave the mailbox in an unsteady
state (and cause a timeout on the VF side).

Wait until firmware ack is written before unlocking channel

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 50 ++++++++++++------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
index 6cfb887..da16953 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
@@ -1765,28 +1765,28 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
 		switch (mbx->first_tlv.tl.type) {
 		case CHANNEL_TLV_ACQUIRE:
 			bnx2x_vf_mbx_acquire(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_INIT:
 			bnx2x_vf_mbx_init_vf(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_SETUP_Q:
 			bnx2x_vf_mbx_setup_q(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_SET_Q_FILTERS:
 			bnx2x_vf_mbx_set_q_filters(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_TEARDOWN_Q:
 			bnx2x_vf_mbx_teardown_q(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_CLOSE:
 			bnx2x_vf_mbx_close_vf(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_RELEASE:
 			bnx2x_vf_mbx_release_vf(bp, vf, mbx);
-			break;
+			return;
 		case CHANNEL_TLV_UPDATE_RSS:
 			bnx2x_vf_mbx_update_rss(bp, vf, mbx);
-			break;
+			return;
 		}
 
 	} else {
@@ -1802,26 +1802,24 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
 		for (i = 0; i < 20; i++)
 			DP_CONT(BNX2X_MSG_IOV, "%x ",
 				mbx->msg->req.tlv_buf_size.tlv_buffer[i]);
+	}
 
-		/* test whether we can respond to the VF (do we have an address
-		 * for it?)
-		 */
-		if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) {
-			/* mbx_resp uses the op_rc of the VF */
-			vf->op_rc = PFVF_STATUS_NOT_SUPPORTED;
+	/* can we respond to VF (do we have an address for it?) */
+	if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) {
+		/* mbx_resp uses the op_rc of the VF */
+		vf->op_rc = PFVF_STATUS_NOT_SUPPORTED;
 
-			/* notify the VF that we do not support this request */
-			bnx2x_vf_mbx_resp(bp, vf);
-		} else {
-			/* can't send a response since this VF is unknown to us
-			 * just ack the FW to release the mailbox and unlock
-			 * the channel.
-			 */
-			storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
-			mmiowb();
-			bnx2x_unlock_vf_pf_channel(bp, vf,
-						   mbx->first_tlv.tl.type);
-		}
+		/* notify the VF that we do not support this request */
+		bnx2x_vf_mbx_resp(bp, vf);
+	} else {
+		/* can't send a response since this VF is unknown to us
+		 * just ack the FW to release the mailbox and unlock
+		 * the channel.
+		 */
+		storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
+		/* Firmware ack should be written before unlocking channel */
+		mmiowb();
+		bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type);
 	}
 }
 
-- 
1.8.1.227.g44fe835

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/6] bnx2x: Bug fixes patch series
  2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
                   ` (5 preceding siblings ...)
  2013-09-23  7:12 ` [PATCH net 6/6] bnx2x: handle known but unsupported VF messages Yuval Mintz
@ 2013-09-23 20:18 ` David Miller
  6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2013-09-23 20:18 UTC (permalink / raw)
  To: yuvalmin; +Cc: netdev, ariele, eilong

From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Mon, 23 Sep 2013 10:12:49 +0300

> This patch contains various bug fixes, half of which are SR-IOV related
> (some fixing issues in the recently added VF RSS support), while the other fix
> a wide assortments of issues in the driver.
> 
> Please consider applying these patches to `net'.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-23 20:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23  7:12 [PATCH net 0/6] bnx2x: Bug fixes patch series Yuval Mintz
2013-09-23  7:12 ` [PATCH net 1/6] bnx2x: Prevent mistaken hangup between driver & FW Yuval Mintz
2013-09-23  7:12 ` [PATCH net 2/6] bnx2x: Fix support for VFs on some PFs Yuval Mintz
2013-09-23  7:12 ` [PATCH net 3/6] bnx2x: add missing VF resource allocation during init Yuval Mintz
2013-09-23  7:12 ` [PATCH net 4/6] bnx2x: prevent masking error from cnic Yuval Mintz
2013-09-23  7:12 ` [PATCH net 5/6] bnx2x: prevent masked MCP parities from appearing Yuval Mintz
2013-09-23  7:12 ` [PATCH net 6/6] bnx2x: handle known but unsupported VF messages Yuval Mintz
2013-09-23 20:18 ` [PATCH net 0/6] bnx2x: Bug fixes patch series David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).