netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net 0/2] bnx2x: bug fixes
@ 2019-12-11 17:59 Manish Chopra
  2019-12-11 17:59 ` [PATCH v2 net 1/2] bnx2x: Do not handle requests from VFs after parity Manish Chopra
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Manish Chopra @ 2019-12-11 17:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, skalluru

Hi David,

This series has two driver changes, one to fix some unexpected
hardware behaviour casued during the parity error recovery in
presence of SR-IOV VFs and another one related for fixing resource
management in the driver among the PFs configured on an engine.

Please consider applying it to "net".

V1->V2:
=======
Fix the compilation errors reported by kbuild test robot
on the patch #1 with CONFIG_BNX2X_SRIOV=n

Thanks,
Manish
 
Manish Chopra (2):
  bnx2x: Do not handle requests from VFs after parity
  bnx2x: Fix logic to get total no. of PFs per engine

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h   |  2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  | 12 ++++++++++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c  | 12 ++++++++++++
 4 files changed, 24 insertions(+), 3 deletions(-)

-- 
2.18.1


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

* [PATCH v2 net 1/2] bnx2x: Do not handle requests from VFs after parity
  2019-12-11 17:59 [PATCH v2 net 0/2] bnx2x: bug fixes Manish Chopra
@ 2019-12-11 17:59 ` Manish Chopra
  2019-12-11 17:59 ` [PATCH v2 net 2/2] bnx2x: Fix logic to get total no. of PFs per engine Manish Chopra
  2019-12-14 21:04 ` [PATCH v2 net 0/2] bnx2x: bug fixes Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Manish Chopra @ 2019-12-11 17:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, skalluru

Parity error from the hardware will cause PF to lose the state
of their VFs due to PF's internal reload and hardware reset following
the parity error. Restrict any configuration request from the VFs after
the parity as it could cause unexpected hardware behavior, only way
for VFs to recover would be to trigger FLR on VFs and reload them.

Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c  | 12 ++++++++++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  1 +
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c  | 12 ++++++++++++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 192ff8d5da32..cff64e43bdd8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9976,10 +9976,18 @@ static void bnx2x_recovery_failed(struct bnx2x *bp)
  */
 static void bnx2x_parity_recover(struct bnx2x *bp)
 {
-	bool global = false;
 	u32 error_recovered, error_unrecovered;
-	bool is_parity;
+	bool is_parity, global = false;
+#ifdef CONFIG_BNX2X_SRIOV
+	int vf_idx;
+
+	for (vf_idx = 0; vf_idx < bp->requested_nr_virtfn; vf_idx++) {
+		struct bnx2x_virtf *vf = BP_VF(bp, vf_idx);
 
+		if (vf)
+			vf->state = VF_LOST;
+	}
+#endif
 	DP(NETIF_MSG_HW, "Handling parity\n");
 	while (1) {
 		switch (bp->recovery_state) {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index b6ebd92ec565..3a716c015415 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -139,6 +139,7 @@ struct bnx2x_virtf {
 #define VF_ACQUIRED	1	/* VF acquired, but not initialized */
 #define VF_ENABLED	2	/* VF Enabled */
 #define VF_RESET	3	/* VF FLR'd, pending cleanup */
+#define VF_LOST		4	/* Recovery while VFs are loaded */
 
 	bool flr_clnup_stage;	/* true during flr cleanup */
 	bool malicious;		/* true if FW indicated so, until FLR */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
index 0752b7fa4d9c..ea0e9394f898 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
@@ -2107,6 +2107,18 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
 {
 	int i;
 
+	if (vf->state == VF_LOST) {
+		/* Just ack the FW and return if VFs are lost
+		 * in case of parity error. VFs are supposed to be timedout
+		 * on waiting for PF response.
+		 */
+		DP(BNX2X_MSG_IOV,
+		   "VF 0x%x lost, not handling the request\n", vf->abs_vfid);
+
+		storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
+		return;
+	}
+
 	/* check if tlv type is known */
 	if (bnx2x_tlv_supported(mbx->first_tlv.tl.type)) {
 		/* Lock the per vf op mutex and note the locker's identity.
-- 
2.18.1


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

* [PATCH v2 net 2/2] bnx2x: Fix logic to get total no. of PFs per engine
  2019-12-11 17:59 [PATCH v2 net 0/2] bnx2x: bug fixes Manish Chopra
  2019-12-11 17:59 ` [PATCH v2 net 1/2] bnx2x: Do not handle requests from VFs after parity Manish Chopra
@ 2019-12-11 17:59 ` Manish Chopra
  2019-12-14 21:04 ` [PATCH v2 net 0/2] bnx2x: bug fixes Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Manish Chopra @ 2019-12-11 17:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, aelior, skalluru

Driver doesn't calculate total number of PFs configured on a
given engine correctly which messed up resources in the PFs
loaded on that engine, leading driver to exceed configuration
of resources (like vlan filters etc.) beyond the limit per
engine, which ended up with asserts from the firmware.

Signed-off-by: Manish Chopra <manishc@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 8b08cb18e363..3f63ffd7561b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -1109,7 +1109,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp)
 		for (i = 0; i < E1H_FUNC_MAX / 2; i++) {
 			u32 func_config =
 				MF_CFG_RD(bp,
-					  func_mf_config[BP_PORT(bp) + 2 * i].
+					  func_mf_config[BP_PATH(bp) + 2 * i].
 					  config);
 			func_num +=
 				((func_config & FUNC_MF_CFG_FUNC_HIDE) ? 0 : 1);
-- 
2.18.1


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

* Re: [PATCH v2 net 0/2] bnx2x: bug fixes
  2019-12-11 17:59 [PATCH v2 net 0/2] bnx2x: bug fixes Manish Chopra
  2019-12-11 17:59 ` [PATCH v2 net 1/2] bnx2x: Do not handle requests from VFs after parity Manish Chopra
  2019-12-11 17:59 ` [PATCH v2 net 2/2] bnx2x: Fix logic to get total no. of PFs per engine Manish Chopra
@ 2019-12-14 21:04 ` Jakub Kicinski
  2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2019-12-14 21:04 UTC (permalink / raw)
  To: Manish Chopra; +Cc: davem, netdev, aelior, skalluru

On Wed, 11 Dec 2019 09:59:54 -0800, Manish Chopra wrote:
> This series has two driver changes, one to fix some unexpected
> hardware behaviour casued during the parity error recovery in
> presence of SR-IOV VFs and another one related for fixing resource
> management in the driver among the PFs configured on an engine.
> 
> Please consider applying it to "net".

Applied to net, thank you. I'm not queuing for stable because there
were no Fixes tags. Please try to provide those, even if they just
point at the initial driver commit.

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

end of thread, other threads:[~2019-12-14 21:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 17:59 [PATCH v2 net 0/2] bnx2x: bug fixes Manish Chopra
2019-12-11 17:59 ` [PATCH v2 net 1/2] bnx2x: Do not handle requests from VFs after parity Manish Chopra
2019-12-11 17:59 ` [PATCH v2 net 2/2] bnx2x: Fix logic to get total no. of PFs per engine Manish Chopra
2019-12-14 21:04 ` [PATCH v2 net 0/2] bnx2x: bug fixes Jakub Kicinski

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).