DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: jing.d.chen@intel.com
Cc: helin.zhang@intel.com, dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 11/17] net/fm10k/base: enable lport map request
Date: Thu,  2 Mar 2017 22:17:21 -0500	[thread overview]
Message-ID: <20170303031727.461-12-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20170303031727.461-1-qi.z.zhang@intel.com>

If the fm10k interface is brought up, but the switch manager software is
not running, the driver will continuously request the lport map every
few seconds in the base driver watchdog routine. Eventually after
several minutes the switch mailbox Tx fifo will fill up and the mailbox
will timeout, resulting in a reset. This reset will appear as if for no
reason, and occurs regularly every few minutes until the switch manager
software is loaded.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/fm10k/base/fm10k_common.c |  8 ++++++--
 drivers/net/fm10k/base/fm10k_pf.c     | 17 ++++-------------
 drivers/net/fm10k/base/fm10k_type.h   |  1 +
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/net/fm10k/base/fm10k_common.c b/drivers/net/fm10k/base/fm10k_common.c
index a90d2f0..7acc1ba 100644
--- a/drivers/net/fm10k/base/fm10k_common.c
+++ b/drivers/net/fm10k/base/fm10k_common.c
@@ -542,7 +542,7 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
 		goto out;
 
 	/* if we somehow dropped the Tx enable we should reset */
-	if (hw->mac.tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
+	if (mac->tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
 		ret_val = FM10K_ERR_RESET_REQUESTED;
 		goto out;
 	}
@@ -558,8 +558,12 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
 		goto out;
 
 	/* interface cannot receive traffic without logical ports */
-	if (mac->dglort_map == FM10K_DGLORTMAP_NONE)
+	if (mac->dglort_map == FM10K_DGLORTMAP_NONE) {
+		if (mac->ops.request_lport_map)
+			ret_val = mac->ops.request_lport_map(hw);
+
 		goto out;
+	}
 
 	/* if we passed all the tests above then the switch is ready and we no
 	 * longer need to check for link
diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c
index 4c075b6..bbc483d 100644
--- a/drivers/net/fm10k/base/fm10k_pf.c
+++ b/drivers/net/fm10k/base/fm10k_pf.c
@@ -1688,13 +1688,12 @@ STATIC s32 fm10k_request_lport_map_pf(struct fm10k_hw *hw)
  *  @hw: pointer to hardware structure
  *  @switch_ready: pointer to boolean value that will record switch state
  *
- *  This funciton will check the DMA_CTRL2 register and mailbox in order
+ *  This function will check the DMA_CTRL2 register and mailbox in order
  *  to determine if the switch is ready for the PF to begin requesting
  *  addresses and mapping traffic to the local interface.
  **/
 STATIC s32 fm10k_get_host_state_pf(struct fm10k_hw *hw, bool *switch_ready)
 {
-	s32 ret_val = FM10K_SUCCESS;
 	u32 dma_ctrl2;
 
 	DEBUGFUNC("fm10k_get_host_state_pf");
@@ -1702,19 +1701,10 @@ STATIC s32 fm10k_get_host_state_pf(struct fm10k_hw *hw, bool *switch_ready)
 	/* verify the switch is ready for interaction */
 	dma_ctrl2 = FM10K_READ_REG(hw, FM10K_DMA_CTRL2);
 	if (!(dma_ctrl2 & FM10K_DMA_CTRL2_SWITCH_READY))
-		goto out;
+		return FM10K_SUCCESS;
 
 	/* retrieve generic host state info */
-	ret_val = fm10k_get_host_state_generic(hw, switch_ready);
-	if (ret_val)
-		goto out;
-
-	/* interface cannot receive traffic without logical ports */
-	if (hw->mac.dglort_map == FM10K_DGLORTMAP_NONE)
-		ret_val = fm10k_request_lport_map_pf(hw);
-
-out:
-	return ret_val;
+	return fm10k_get_host_state_generic(hw, switch_ready);
 }
 
 /* This structure defines the attibutes to be parsed below */
@@ -2102,6 +2092,7 @@ s32 fm10k_init_ops_pf(struct fm10k_hw *hw)
 	mac->ops.set_dma_mask = &fm10k_set_dma_mask_pf;
 	mac->ops.get_fault = &fm10k_get_fault_pf;
 	mac->ops.get_host_state = &fm10k_get_host_state_pf;
+	mac->ops.request_lport_map = &fm10k_request_lport_map_pf;
 	mac->ops.adjust_systime = &fm10k_adjust_systime_pf;
 	mac->ops.notify_offset = &fm10k_notify_offset_pf;
 	mac->ops.read_systime = &fm10k_read_systime_pf;
diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h
index 515be26..b74cebf 100644
--- a/drivers/net/fm10k/base/fm10k_type.h
+++ b/drivers/net/fm10k/base/fm10k_type.h
@@ -611,6 +611,7 @@ struct fm10k_mac_ops {
 	s32 (*stop_hw)(struct fm10k_hw *);
 	s32 (*get_bus_info)(struct fm10k_hw *);
 	s32 (*get_host_state)(struct fm10k_hw *, bool *);
+	s32 (*request_lport_map)(struct fm10k_hw *);
 #ifndef NO_IS_SLOT_APPROPRIATE_CHECK
 	bool (*is_slot_appropriate)(struct fm10k_hw *);
 #endif
-- 
2.9.3

  parent reply	other threads:[~2017-03-03  2:26 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  3:17 [dpdk-dev] [PATCH 00/17] net/fm10k: update base code Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 01/17] net/fm10k/base: add a flag to indicate VF trust mode Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 02/17] net/fm10k/base: reset multicaset mode when deleting lport Qi Zhang
2017-03-05 11:41   ` Ferruh Yigit
2017-03-03  3:17 ` [dpdk-dev] [PATCH 03/17] net/fm10k/base: expose macros needed by DPDK Qi Zhang
2017-03-05 11:41   ` Ferruh Yigit
2017-03-03  3:17 ` [dpdk-dev] [PATCH 04/17] net/fm10k/base: add error code Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 05/17] net/fm10k/base: clean up the logic Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 06/17] net/fm10k/base: add new item to lport msg attr Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 07/17] net/fm10k/base: use 8 bit notation instead of 10bit notation Qi Zhang
2017-03-05 11:42   ` Ferruh Yigit
2017-03-03  3:17 ` [dpdk-dev] [PATCH 08/17] net/fm10k/base: use different name for override bit Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 09/17] net/fm10k/base: update comment regarding reserved bits check Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 10/17] net/fm10k/base: improve VF's multi-bit VLAN update requests Qi Zhang
2017-03-05 11:42   ` Ferruh Yigit
2017-03-03  3:17 ` Qi Zhang [this message]
2017-03-03  3:17 ` [dpdk-dev] [PATCH 12/17] net/fm10k/base: add macros for global interrupt Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 13/17] net/fm10k/base: don't stop reset Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 14/17] net/fm10k/base: add macro for geneve tunnel offload Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 15/17] net/fm10k/base: improve re-map queues handle Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 16/17] net/fm10k/base: replace macros Qi Zhang
2017-03-03  3:17 ` [dpdk-dev] [PATCH 17/17] net/fm10k/base: equest reset when mbx->state changes Qi Zhang
2017-03-05 11:42   ` Ferruh Yigit
2017-03-05 11:41 ` [dpdk-dev] [PATCH 00/17] net/fm10k: update base code Ferruh Yigit
2017-03-08  6:18 ` [dpdk-dev] [PATCH v2 00/18] " Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 01/18] net/fm10k/base: add a flag to indicate VF trust mode Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 02/18] net/fm10k/base: reset multicast mode when deleting lport Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 03/18] net/fm10k/base: expose macros needed by DPDK Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 04/18] net/fm10k/base: add error code Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 05/18] net/fm10k/base: clean up the logic Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 06/18] net/fm10k/base: add new item to lport msg attr Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 07/18] net/fm10k/base: update comment Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 08/18] net/fm10k/base: use different name for override bit Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 09/18] net/fm10k/base: update comment regarding reserved bits check Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 10/18] net/fm10k/base: improve VF's multi-bit VLAN update requests Qi Zhang
2017-03-08  6:18   ` [dpdk-dev] [PATCH v2 11/18] net/fm10k/base: enable lport map request Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 12/18] net/fm10k/base: add macros for global interrupt Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 13/18] net/fm10k/base: don't stop reset Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 14/18] net/fm10k/base: add macro for geneve tunnel offload Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 15/18] net/fm10k/base: improve re-map queues handle Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 16/18] net/fm10k/base: replace macros Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 17/18] net/fm10k/base: request reset when mbx->state changes Qi Zhang
2017-03-08  6:19   ` [dpdk-dev] [PATCH v2 18/18] net/fm10k/base: add base driver information Qi Zhang
2017-03-09 11:13   ` [dpdk-dev] [PATCH v2 00/18] net/fm10k: update base code Ferruh Yigit
2017-03-10  3:11     ` Zhang, Qi Z

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=20170303031727.461-12-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jing.d.chen@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).