sfc: Add EF10 support for TX/RX DMA error events handling.
authorAlexandre Rames <arames@solarflare.com>
Thu, 13 Jun 2013 10:36:15 +0000 (11:36 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Tue, 27 Aug 2013 21:27:10 +0000 (22:27 +0100)
Also, since we handle all DMA errors in the same way, merge
RESET_TYPE_(RX|TX)_DESC_FETCH into RESET_TYPE_DMA_ERROR.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/efx.c
drivers/net/ethernet/sfc/enum.h
drivers/net/ethernet/sfc/falcon.c
drivers/net/ethernet/sfc/farch.c
drivers/net/ethernet/sfc/mcdi.c

index 9fe375f1710ae1c27107872cb0e7ac6442d1d156..efad5f73e1ce398be6d4e7232e53188d78902e60 100644 (file)
@@ -80,8 +80,7 @@ const char *const efx_reset_type_names[] = {
        [RESET_TYPE_TX_WATCHDOG]        = "TX_WATCHDOG",
        [RESET_TYPE_INT_ERROR]          = "INT_ERROR",
        [RESET_TYPE_RX_RECOVERY]        = "RX_RECOVERY",
-       [RESET_TYPE_RX_DESC_FETCH]      = "RX_DESC_FETCH",
-       [RESET_TYPE_TX_DESC_FETCH]      = "TX_DESC_FETCH",
+       [RESET_TYPE_DMA_ERROR]          = "DMA_ERROR",
        [RESET_TYPE_TX_SKIP]            = "TX_SKIP",
        [RESET_TYPE_MC_FAILURE]         = "MC_FAILURE",
 };
index ab8fb5889e55829df9bedbb39cbcc0104bd48242..8665921d7170bf147524f7e79289d8da45c36613 100644 (file)
@@ -147,8 +147,7 @@ enum efx_loopback_mode {
  * @RESET_TYPE_TX_WATCHDOG: reset due to TX watchdog
  * @RESET_TYPE_INT_ERROR: reset due to internal error
  * @RESET_TYPE_RX_RECOVERY: reset to recover from RX datapath errors
- * @RESET_TYPE_RX_DESC_FETCH: pcie error during rx descriptor fetch
- * @RESET_TYPE_TX_DESC_FETCH: pcie error during tx descriptor fetch
+ * @RESET_TYPE_DMA_ERROR: DMA error
  * @RESET_TYPE_TX_SKIP: hardware completed empty tx descriptors
  * @RESET_TYPE_MC_FAILURE: MC reboot/assertion
  */
@@ -163,8 +162,7 @@ enum reset_type {
        RESET_TYPE_TX_WATCHDOG,
        RESET_TYPE_INT_ERROR,
        RESET_TYPE_RX_RECOVERY,
-       RESET_TYPE_RX_DESC_FETCH,
-       RESET_TYPE_TX_DESC_FETCH,
+       RESET_TYPE_DMA_ERROR,
        RESET_TYPE_TX_SKIP,
        RESET_TYPE_MC_FAILURE,
        RESET_TYPE_MAX,
index 0be1f3711c89899e8a4534fd2b7ebb34e70a7b8e..1140b832d5416aeb61c56a422b1fdb67f8abac9f 100644 (file)
@@ -1893,8 +1893,7 @@ static enum reset_type falcon_map_reset_reason(enum reset_type reason)
 {
        switch (reason) {
        case RESET_TYPE_RX_RECOVERY:
-       case RESET_TYPE_RX_DESC_FETCH:
-       case RESET_TYPE_TX_DESC_FETCH:
+       case RESET_TYPE_DMA_ERROR:
        case RESET_TYPE_TX_SKIP:
                /* These can occasionally occur due to hardware bugs.
                 * We try to reset without disrupting the link.
index b6af8f4cc7040ba6e08784342fe6718964c31dbb..d21483dfea40d52b7d3226b682d9fcb11013b36f 100644 (file)
@@ -832,7 +832,7 @@ efx_farch_handle_tx_event(struct efx_channel *channel, efx_qword_t *event)
                efx_farch_notify_tx_desc(tx_queue);
                netif_tx_unlock(efx->net_dev);
        } else if (EFX_QWORD_FIELD(*event, FSF_AZ_TX_EV_PKT_ERR)) {
-               efx_schedule_reset(efx, RESET_TYPE_TX_DESC_FETCH);
+               efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
        } else {
                netif_err(efx, tx_err, efx->net_dev,
                          "channel %d unexpected TX event "
@@ -1217,7 +1217,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
                                  "RX DMA Q %d reports descriptor fetch error."
                                  " RX Q %d is disabled.\n", ev_sub_data,
                                  ev_sub_data);
-                       efx_schedule_reset(efx, RESET_TYPE_RX_DESC_FETCH);
+                       efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
                } else
                        efx_sriov_desc_fetch_err(efx, ev_sub_data);
                break;
@@ -1227,7 +1227,7 @@ efx_farch_handle_driver_event(struct efx_channel *channel, efx_qword_t *event)
                                  "TX DMA Q %d reports descriptor fetch error."
                                  " TX Q %d is disabled.\n", ev_sub_data,
                                  ev_sub_data);
-                       efx_schedule_reset(efx, RESET_TYPE_TX_DESC_FETCH);
+                       efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
                } else
                        efx_sriov_desc_fetch_err(efx, ev_sub_data);
                break;
index ff90ebf51dbd4c268465b5934cd793d47e7a10af..381063484ee469f989c1a7bdd71df4702686e8e4 100644 (file)
@@ -587,6 +587,14 @@ void efx_mcdi_process_event(struct efx_channel *channel,
                efx_ptp_event(efx, event);
                break;
 
+       case MCDI_EVENT_CODE_TX_ERR:
+       case MCDI_EVENT_CODE_RX_ERR:
+               netif_err(efx, hw, efx->net_dev,
+                         "%s DMA error (event: "EFX_QWORD_FMT")\n",
+                         code == MCDI_EVENT_CODE_TX_ERR ? "TX" : "RX",
+                         EFX_QWORD_VAL(*event));
+               efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR);
+               break;
        default:
                netif_err(efx, hw, efx->net_dev, "Unknown MCDI event 0x%x\n",
                          code);