nfp: report more info when reconfiguration fails
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 28 Nov 2018 06:24:58 +0000 (22:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Nov 2018 21:30:45 +0000 (13:30 -0800)
FW reconfiguration timeouts are a common indicator of FW trouble.
To make debugging easier print requested update and control word
when reconfiguration fails.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net.h
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 5a9a6178cf2677a6999a5b7fc4963574d1ec1e3f..be37c2d6151c43f705515314e555f6fc643ccd91 100644 (file)
@@ -544,6 +544,7 @@ struct nfp_net_dp {
  * @reconfig_timer_active:  Timer for reading reconfiguration results is pending
  * @reconfig_sync_present:  Some thread is performing synchronous reconfig
  * @reconfig_timer:    Timer for async reading of reconfig results
+ * @reconfig_in_progress_update:       Update FW is processing now (debug only)
  * @link_up:            Is the link up?
  * @link_status_lock:  Protects @link_* and ensures atomicity with BAR reading
  * @rx_coalesce_usecs:      RX interrupt moderation usecs delay parameter
@@ -612,6 +613,7 @@ struct nfp_net {
        bool reconfig_timer_active;
        bool reconfig_sync_present;
        struct timer_list reconfig_timer;
+       u32 reconfig_in_progress_update;
 
        u32 rx_coalesce_usecs;
        u32 rx_coalesce_max_frames;
index 3cb7dceca2d902d9d45a39f9f0f1eaf9d034a57d..e97636d2e6ee7677b1f0b77b0600b2561a1eaa17 100644 (file)
@@ -101,6 +101,7 @@ static void nfp_net_reconfig_start(struct nfp_net *nn, u32 update)
        /* ensure update is written before pinging HW */
        nn_pci_flush(nn);
        nfp_qcp_wr_ptr_add(nn->qcp_cfg, 1);
+       nn->reconfig_in_progress_update = update;
 }
 
 /* Pass 0 as update to run posted reconfigs. */
@@ -123,10 +124,14 @@ static bool nfp_net_reconfig_check_done(struct nfp_net *nn, bool last_check)
        if (reg == 0)
                return true;
        if (reg & NFP_NET_CFG_UPDATE_ERR) {
-               nn_err(nn, "Reconfig error: 0x%08x\n", reg);
+               nn_err(nn, "Reconfig error (status: 0x%08x update: 0x%08x ctrl: 0x%08x)\n",
+                      reg, nn->reconfig_in_progress_update,
+                      nn_readl(nn, NFP_NET_CFG_CTRL));
                return true;
        } else if (last_check) {
-               nn_err(nn, "Reconfig timeout: 0x%08x\n", reg);
+               nn_err(nn, "Reconfig timeout (status: 0x%08x update: 0x%08x ctrl: 0x%08x)\n",
+                      reg, nn->reconfig_in_progress_update,
+                      nn_readl(nn, NFP_NET_CFG_CTRL));
                return true;
        }