DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <ferruh.yigit@intel.com>, <thomas.monjalon@6wind.com>,
	<bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, <Dept-EngDPDKDev@qlogic.com>,
	Harish Patil <harish.patil@qlogic.com>
Subject: [dpdk-dev] [PATCH v3 25/32] qede/base: add support to initiate PF FLR
Date: Sat, 15 Oct 2016 13:08:02 -0700	[thread overview]
Message-ID: <1476562089-21823-26-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1476562089-21823-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 b530173..6060f9e 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 500368e..2ff9715 100644
--- a/drivers/net/qede/base/ecore_mcp.c
+++ b/drivers/net/qede/base/ecore_mcp.c
@@ -2442,3 +2442,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 d3103ff..831890c 100644
--- a/drivers/net/qede/base/ecore_mcp.h
+++ b/drivers/net/qede/base/ecore_mcp.h
@@ -353,4 +353,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.8.3.1

  parent reply	other threads:[~2016-10-15 20:10 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15 20:07 [dpdk-dev] [PATCH v3 00/32] qede: update qede pmd to 1.2.0.1 and enable by default Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 01/32] qede/base: add new init files and rearrange the code Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 02/32] qede/base: formatting changes Rasesh Mody
2016-10-17 16:28   ` Ferruh Yigit
2016-10-17 17:25     ` Mody, Rasesh
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 03/32] qede: use FW CONFIG defines as needed Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 04/32] qede/base: add HSI changes and register defines Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 05/32] qede/base: fix the attention formating string Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 06/32] qede/base: additional formatting/comment changes Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 07/32] qede: fix 32 bit compilation Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 08/32] qede: change the API signature of ecore_mcp_cmd_and_union() Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 09/32] qede: serialize access to MFW mbox Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 10/32] qede: add APIs to support NIC selftests and query sensor info Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 11/32] qede/base: update base driver Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 12/32] qede/base: rename structure and defines Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 13/32] qede/base: comment enhancements Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 14/32] qede/base: add MFW crash dump support Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 15/32] qede: enable support for unequal number of RX/TX queues Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 16/32] qede: fix port (re)configuration issue Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 17/32] qede/base: allow MTU change via vport-update Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 18/32] qede: add missing 100G link speed capability Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 19/32] qede: remove unused/dead code Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 20/32] qede: fixes for VLAN filters Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 21/32] qede: add enable/disable VLAN filtering Rasesh Mody
2016-10-15 20:07 ` [dpdk-dev] [PATCH v3 22/32] qede: fix RSS related issues Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 23/32] qede: add scatter gather support Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 24/32] qede/base: change rx tx queue start APIs Rasesh Mody
2016-10-15 20:08 ` Rasesh Mody [this message]
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 26/32] qede: skip slowpath polling for 100G VF device Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 27/32] qede: fix driver version string Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 28/32] qede: fix status_blk index for VF queues Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 29/32] qede: add support for queue statistics Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 30/32] qede: remove zlib dependency and enable PMD by default Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 31/32] doc: update qede pmd documentation Rasesh Mody
2016-10-15 20:08 ` [dpdk-dev] [PATCH v3 32/32] qede: update driver version Rasesh Mody
2016-10-17 17:05 ` [dpdk-dev] [PATCH v3 00/32] qede: update qede pmd to 1.2.0.1 and enable by default Ferruh Yigit
2016-10-17 17:52   ` Mody, Rasesh

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=1476562089-21823-26-git-send-email-rasesh.mody@qlogic.com \
    --to=rasesh.mody@qlogic.com \
    --cc=Dept-EngDPDKDev@qlogic.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=harish.patil@qlogic.com \
    --cc=thomas.monjalon@6wind.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).