DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <dev@dpdk.org>
Cc: <Dept-EngDPDKDev@qlogic.com>, Harish Patil <harish.patil@qlogic.com>
Subject: [dpdk-dev] [PATCH 13/17] qede/base: add support to initiate PF FLR
Date: Fri, 26 Aug 2016 23:29:23 -0700	[thread overview]
Message-ID: <1472279367-25042-8-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1472279367-25042-1-git-send-email-rasesh.mody@qlogic.com>

From: Harish Patil <harish.patil@qlogic.com>

Add support to send PF FLR request to the management firmware to
bringup the device in clean slate. This cleanup is necessary
in some corner cases where the device would be left in a bad
state from its previous operations. The driver will send PF FLR
request before slowpath initialization.

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 doc/guides/nics/qede.rst          |    1 -
 drivers/net/qede/base/ecore_dev.c |   15 +++++++++++----
 drivers/net/qede/base/ecore_mcp.c |    9 +++++++++
 drivers/net/qede/base/ecore_mcp.h |   11 +++++++++++
 4 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/doc/guides/nics/qede.rst b/doc/guides/nics/qede.rst
index 2a585e7..50e6f87 100644
--- a/doc/guides/nics/qede.rst
+++ b/doc/guides/nics/qede.rst
@@ -65,7 +65,6 @@ Non-supported Features
 
 - SR-IOV PF
 - Tunneling offloads
-- Reload of the PMD after a non-graceful termination
 
 Supported QLogic Adapters
 -------------------------
diff --git a/drivers/net/qede/base/ecore_dev.c b/drivers/net/qede/base/ecore_dev.c
index 95a6a95..4dbdab5 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2952,13 +2952,14 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 			void OSAL_IOMEM *p_doorbells,
 			struct ecore_hw_prepare_params *p_params)
 {
+	struct ecore_dev *p_dev = p_hwfn->p_dev;
 	enum _ecore_status_t rc = ECORE_SUCCESS;
 
 	/* Split PCI bars evenly between hwfns */
 	p_hwfn->regview = p_regview;
 	p_hwfn->doorbells = p_doorbells;
 
-	if (IS_VF(p_hwfn->p_dev))
+	if (IS_VF(p_dev))
 		return ecore_vf_hw_prepare(p_hwfn);
 
 	/* Validate that chip access is feasible */
@@ -2982,7 +2983,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 
 	/* First hwfn learns basic information, e.g., number of hwfns */
 	if (!p_hwfn->my_id) {
-		rc = ecore_get_dev_info(p_hwfn->p_dev);
+		rc = ecore_get_dev_info(p_dev);
 		if (rc != ECORE_SUCCESS)
 			goto err1;
 	}
@@ -2996,6 +2997,12 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 		goto err1;
 	}
 
+	if (p_hwfn == ECORE_LEADING_HWFN(p_dev) && !p_dev->recov_in_prog) {
+		rc = ecore_mcp_initiate_pf_flr(p_hwfn, p_hwfn->p_main_ptt);
+		if (rc != ECORE_SUCCESS)
+			DP_NOTICE(p_hwfn, false, "Failed to initiate PF FLR\n");
+	}
+
 	/* Read the device configuration information from the HW and SHMEM */
 	rc = ecore_get_hw_info(p_hwfn, p_hwfn->p_main_ptt,
 			       p_params->personality, p_params->drv_resc_alloc);
@@ -3011,7 +3018,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 		goto err2;
 	}
 #ifndef ASIC_ONLY
-	if (CHIP_REV_IS_FPGA(p_hwfn->p_dev)) {
+	if (CHIP_REV_IS_FPGA(p_dev)) {
 		DP_NOTICE(p_hwfn, false,
 			  "FPGA: workaround; Prevent DMAE parities\n");
 		ecore_wr(p_hwfn, p_hwfn->p_main_ptt, PCIE_REG_PRTY_MASK, 7);
@@ -3026,7 +3033,7 @@ ecore_hw_prepare_single(struct ecore_hwfn *p_hwfn, void OSAL_IOMEM *p_regview,
 	return rc;
  err2:
 	if (IS_LEAD_HWFN(p_hwfn))
-		ecore_iov_free_hw_info(p_hwfn->p_dev);
+		ecore_iov_free_hw_info(p_dev);
 	ecore_mcp_free(p_hwfn);
  err1:
 	ecore_hw_hwfn_free(p_hwfn);
diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c
index c316a3a..d792e2d 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -2450,3 +2450,12 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
 
 	return ECORE_SUCCESS;
 }
+
+enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn,
+					       struct ecore_ptt *p_ptt)
+{
+	u32 mcp_resp, mcp_param;
+
+	return ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_INITIATE_PF_FLR,
+			     0, &mcp_resp, &mcp_param);
+}
diff --git a/drivers/net/qede/base/ecore_mcp.h b/drivers/net/qede/base/ecore_mcp.h
index 2fc503a..1f84355 100644
--- a/drivers/net/qede/base/ecore_mcp.h
+++ b/drivers/net/qede/base/ecore_mcp.h
@@ -358,4 +358,15 @@ enum _ecore_status_t ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn,
 					     struct resource_info *p_resc_info,
 					     u32 *p_mcp_resp, u32 *p_mcp_param);
 
+/**
+ * @brief - Initiates PF FLR
+ *
+ * @param p_hwfn
+ * @param p_ptt
+ *
+ * @param return ECORE_SUCCESS upon success.
+ */
+enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn,
+					       struct ecore_ptt *p_ptt);
+
 #endif /* __ECORE_MCP_H__ */
-- 
1.7.10.3

  parent reply	other threads:[~2016-08-27  6:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27  6:29 [dpdk-dev] [PATCH 06/17] qede: add missing 100G link speed capability Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 07/17] qede: remove unused/dead code Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 08/17] qede: fix to prevent duplicate VLAN filters Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 09/17] qede: add enable/disable VLAN filtering Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 10/17] qede: fix RSS related issues Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 11/17] qede:add scatter gather support Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 12/17] qede/base: change rx tx queue start APIs Rasesh Mody
2016-08-27  6:29 ` Rasesh Mody [this message]
2016-08-27  6:29 ` [dpdk-dev] [PATCH 14/17] qede: skip slowpath polling for 100G VF device Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 15/17] qede: fix driver version string Rasesh Mody
2016-08-27  6:29 ` [dpdk-dev] [PATCH 16/17] doc: update qede pmd documentation Rasesh Mody
2016-09-26 15:34   ` Mcnamara, John
2016-08-27  6:29 ` [dpdk-dev] [PATCH 17/17] qede: update driver version Rasesh Mody

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=1472279367-25042-8-git-send-email-rasesh.mody@qlogic.com \
    --to=rasesh.mody@qlogic.com \
    --cc=Dept-EngDPDKDev@qlogic.com \
    --cc=dev@dpdk.org \
    --cc=harish.patil@qlogic.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 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).