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 v2 16/22] qede/base: add support to initiate PF FLR
Date: Fri, 30 Sep 2016 00:06:03 -0700	[thread overview]
Message-ID: <1475219169-8774-17-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1475219169-8774-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 c530934..0f814f2 100644
--- a/drivers/net/qede/base/ecore_dev.c
+++ b/drivers/net/qede/base/ecore_dev.c
@@ -2954,13 +2954,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 */
@@ -2984,7 +2985,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;
 	}
@@ -2998,6 +2999,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);
@@ -3013,7 +3020,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);
@@ -3028,7 +3035,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 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.8.3.1

  parent reply	other threads:[~2016-09-30  7:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-30  7:05 [dpdk-dev] [PATCH v2 00/22] qede: update qede pmd to 1.2.2.1 and enable by default Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 01/22] qede/base: add new files and shuffle the code Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 02/22] qede/base: formatting changes Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 03/22] qede: use FW CONFIG defines as needed Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 04/22] qede/base: update base driver Rasesh Mody
2016-09-30 16:44   ` Ferruh Yigit
     [not found]     ` <BLUPR0701MB157207202A7D8EB817D33DA59FC10@BLUPR0701MB1572.namprd07.prod.outlook.com>
2016-10-05 16:29       ` Thomas Monjalon
2016-10-10 23:31         ` Mody, Rasesh
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 05/22] qede/base: add the driver support for the MFW crash dump Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 06/22] qede: enable support for unequal number of RX/TX queues Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 07/22] qede: fix port (re)configuration issue Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 08/22] qede/base: allow MTU change via vport-update Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 09/22] qede: add missing 100G link speed capability Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 10/22] qede: remove unused/dead code Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 11/22] qede: fixes for VLAN filters Rasesh Mody
2016-09-30  7:05 ` [dpdk-dev] [PATCH v2 12/22] qede: add enable/disable VLAN filtering Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 13/22] qede: fix RSS related issues Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 14/22] qede:add scatter gather support Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 15/22] qede/base: change rx tx queue start APIs Rasesh Mody
2016-09-30  7:06 ` Rasesh Mody [this message]
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 17/22] qede: skip slowpath polling for 100G VF device Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 18/22] qede: fix driver version string Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 19/22] qede: add support for queue statistics Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 20/22] qede: remove external dependency and enable by default Rasesh Mody
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 21/22] doc: update qede pmd documentation Rasesh Mody
2016-09-30 15:11   ` Mcnamara, John
2016-09-30  7:06 ` [dpdk-dev] [PATCH v2 22/22] 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=1475219169-8774-17-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).