From: "Mody, Rasesh" <Rasesh.Mody@cavium.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "Mody, Rasesh" <Rasesh.Mody@cavium.com>,
"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
Dept-Eng DPDK Dev <Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH 11/18] net/qede/base: add periodic Doorbell Recovery support
Date: Sat, 29 Sep 2018 08:14:33 +0000 [thread overview]
Message-ID: <1538208822-9726-12-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1538208822-9726-1-git-send-email-rasesh.mody@cavium.com>
Add support for periodic Doorbell Recovery.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
---
drivers/net/qede/base/bcm_osal.h | 1 +
drivers/net/qede/base/ecore_int.c | 37 +++++++++++++++++----------------
drivers/net/qede/base/ecore_int_api.h | 11 ++++++++++
3 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 70805f6..1abf44f 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -454,5 +454,6 @@ void qede_get_mcp_proto_stats(struct ecore_dev *, enum ecore_mcp_protocol_type,
#define OSAL_DIV_S64(a, b) ((a) / (b))
#define OSAL_LLDP_RX_TLVS(p_hwfn, tlv_buf, tlv_size) nothing
#define OSAL_DBG_ALLOC_USER_DATA(p_hwfn, user_data_ptr) (0)
+#define OSAL_DB_REC_OCCURRED(p_hwfn) nothing
#endif /* __BCM_OSAL_H */
diff --git a/drivers/net/qede/base/ecore_int.c b/drivers/net/qede/base/ecore_int.c
index c9acc72..fd8f657 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -428,13 +428,13 @@ static enum _ecore_status_t ecore_fw_assertion(struct ecore_hwfn *p_hwfn)
#define ECORE_DORQ_ATTENTION_SIZE_MASK (0x7f)
#define ECORE_DORQ_ATTENTION_SIZE_SHIFT (16)
-#define ECORE_DB_REC_COUNT 10
+#define ECORE_DB_REC_COUNT 1000
#define ECORE_DB_REC_INTERVAL 100
static enum _ecore_status_t ecore_db_rec_flush_queue(struct ecore_hwfn *p_hwfn,
struct ecore_ptt *p_ptt)
{
- u8 count = ECORE_DB_REC_COUNT;
+ u32 count = ECORE_DB_REC_COUNT;
u32 usage = 1;
/* wait for usage to zero or count to run out. This is necessary since
@@ -463,12 +463,19 @@ static enum _ecore_status_t ecore_db_rec_flush_queue(struct ecore_hwfn *p_hwfn,
return ECORE_SUCCESS;
}
-/* assumes sticky overflow indication was set for this PF */
-static enum _ecore_status_t ecore_db_rec_attn(struct ecore_hwfn *p_hwfn,
- struct ecore_ptt *p_ptt)
+enum _ecore_status_t ecore_db_rec_handler(struct ecore_hwfn *p_hwfn,
+ struct ecore_ptt *p_ptt)
{
+ u32 overflow;
enum _ecore_status_t rc;
+ overflow = ecore_rd(p_hwfn, p_ptt, DORQ_REG_PF_OVFL_STICKY);
+ DP_NOTICE(p_hwfn, false, "PF Overflow sticky 0x%x\n", overflow);
+ if (!overflow) {
+ ecore_db_recovery_execute(p_hwfn, DB_REC_ONCE);
+ return ECORE_SUCCESS;
+ }
+
if (ecore_edpm_enabled(p_hwfn)) {
rc = ecore_db_rec_flush_queue(p_hwfn, p_ptt);
if (rc != ECORE_SUCCESS)
@@ -491,8 +498,7 @@ static enum _ecore_status_t ecore_db_rec_attn(struct ecore_hwfn *p_hwfn,
static enum _ecore_status_t ecore_dorq_attn_cb(struct ecore_hwfn *p_hwfn)
{
- u32 int_sts, first_drop_reason, details, address, overflow,
- all_drops_reason;
+ u32 int_sts, first_drop_reason, details, address, all_drops_reason;
struct ecore_ptt *p_ptt = p_hwfn->p_dpc_ptt;
enum _ecore_status_t rc;
@@ -518,8 +524,6 @@ static enum _ecore_status_t ecore_dorq_attn_cb(struct ecore_hwfn *p_hwfn)
DORQ_REG_DB_DROP_DETAILS);
address = ecore_rd(p_hwfn, p_ptt,
DORQ_REG_DB_DROP_DETAILS_ADDRESS);
- overflow = ecore_rd(p_hwfn, p_ptt,
- DORQ_REG_PF_OVFL_STICKY);
all_drops_reason = ecore_rd(p_hwfn, p_ptt,
DORQ_REG_DB_DROP_DETAILS_REASON);
@@ -530,19 +534,16 @@ static enum _ecore_status_t ecore_dorq_attn_cb(struct ecore_hwfn *p_hwfn)
"FID\t\t0x%04x\t\t(Opaque FID)\n"
"Size\t\t0x%04x\t\t(in bytes)\n"
"1st drop reason\t0x%08x\t(details on first drop since last handling)\n"
- "Sticky reasons\t0x%08x\t(all drop reasons since last handling)\n"
- "Overflow\t0x%x\t\t(a per PF indication)\n",
+ "Sticky reasons\t0x%08x\t(all drop reasons since last handling)\n",
address,
GET_FIELD(details, ECORE_DORQ_ATTENTION_OPAQUE),
GET_FIELD(details, ECORE_DORQ_ATTENTION_SIZE) * 4,
- first_drop_reason, all_drops_reason, overflow);
+ first_drop_reason, all_drops_reason);
- /* if this PF caused overflow, initiate recovery */
- if (overflow) {
- rc = ecore_db_rec_attn(p_hwfn, p_ptt);
- if (rc != ECORE_SUCCESS)
- return rc;
- }
+ rc = ecore_db_rec_handler(p_hwfn, p_ptt);
+ OSAL_DB_REC_OCCURRED(p_hwfn);
+ if (rc != ECORE_SUCCESS)
+ return rc;
/* clear the doorbell drop details and prepare for next drop */
ecore_wr(p_hwfn, p_ptt, DORQ_REG_DB_DROP_DETAILS_REL, 0);
diff --git a/drivers/net/qede/base/ecore_int_api.h b/drivers/net/qede/base/ecore_int_api.h
index aeaf469..5b9c31d 100644
--- a/drivers/net/qede/base/ecore_int_api.h
+++ b/drivers/net/qede/base/ecore_int_api.h
@@ -343,4 +343,15 @@ enum _ecore_status_t ecore_int_get_sb_dbg(struct ecore_hwfn *p_hwfn,
enum _ecore_status_t
ecore_int_igu_relocate_sb(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
u16 sb_id, bool b_to_vf);
+
+/**
+ * @brief - Doorbell Recovery handler.
+ * Run DB_REAL_DEAL doorbell recovery in case of PF overflow
+ * (and flush DORQ if needed), otherwise run DB_REC_ONCE.
+ *
+ * @param p_hwfn
+ * @param p_ptt
+ */
+enum _ecore_status_t ecore_db_rec_handler(struct ecore_hwfn *p_hwfn,
+ struct ecore_ptt *p_ptt);
#endif
--
1.7.10.3
next prev parent reply other threads:[~2018-09-29 8:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-29 8:13 [dpdk-dev] [PATCH 00/18] net/qede: base driver update Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 01/18] net/qede/base: upgrade to FW 8.37.7.0 Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 03/18] net/qede/base: add DPC sync after PF stop Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 02/18] net/qede/base: check for EDPM enabled in DB recovery Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 04/18] net/qede/base: workaround to indicate SHMEM data ready Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 05/18] net/qede/base: add API to update FW RSS indirection table Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 06/18] net/qede/base: add mf-bit/API for FIP special mode Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 07/18] net/qede/base: add error handling for mutex allocation Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 09/18] net/qede/base: add pretend function for port/PF Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 08/18] net/qede/base: adjust queue manager idx greater than max Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 12/18] net/qede/base: get pre-negotiated OEM values Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 10/18] net/qede/base: add support for SRIOV VF min rate Mody, Rasesh
2018-09-29 8:14 ` Mody, Rasesh [this message]
2018-09-29 8:14 ` [dpdk-dev] [PATCH 13/18] net/qede/base: enable control frame filtering Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 15/18] net/qede/base: add RL update params Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 14/18] net/qede/base: changes for 100G Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 16/18] net/qede/base: add APIs for dscp priority map configuration Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 17/18] net/qede/base: semantic changes Mody, Rasesh
2018-09-29 8:14 ` [dpdk-dev] [PATCH 18/18] net/qede: bump PMD version to 2.10.0.1 Mody, Rasesh
2018-10-03 10:32 ` [dpdk-dev] [PATCH 00/18] net/qede: base driver update Ferruh Yigit
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=1538208822-9726-12-git-send-email-rasesh.mody@cavium.com \
--to=rasesh.mody@cavium.com \
--cc=Dept-EngDPDKDev@cavium.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.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).