X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fbnxt_cpr.c;h=63ff02a198263649806e1970b839c6c6fb8b8252;hb=6132d35512c54c55519e9f6118e8dafd5b825417;hp=12230dcea4ecb8a3c668952435ea3c3d25c31fe1;hpb=95de0faf12d4a226d77ce9fbc52df83e63904c3b;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 12230dcea4..63ff02a198 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -120,6 +120,7 @@ void bnxt_handle_async_event(struct bnxt *bp, struct bnxt_error_recovery_info *info; uint32_t event_data; uint32_t data1, data2; + uint32_t status; data1 = rte_le_to_cpu_32(async_cmp->event_data1); data2 = rte_le_to_cpu_32(async_cmp->event_data2); @@ -188,24 +189,26 @@ void bnxt_handle_async_event(struct bnxt *bp, if (!info) return; - PMD_DRV_LOG(INFO, "Port %u: Error recovery async event received\n", - port_id); - event_data = data1 & EVENT_DATA1_FLAGS_MASK; - if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC) - info->flags |= BNXT_FLAG_MASTER_FUNC; - else - info->flags &= ~BNXT_FLAG_MASTER_FUNC; - - if (event_data & EVENT_DATA1_FLAGS_RECOVERY_ENABLED) + if (event_data & EVENT_DATA1_FLAGS_RECOVERY_ENABLED) { info->flags |= BNXT_FLAG_RECOVERY_ENABLED; - else + } else { info->flags &= ~BNXT_FLAG_RECOVERY_ENABLED; + PMD_DRV_LOG(INFO, "Driver recovery watchdog is disabled\n"); + return; + } + + if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC) + info->flags |= BNXT_FLAG_PRIMARY_FUNC; + else + info->flags &= ~BNXT_FLAG_PRIMARY_FUNC; - PMD_DRV_LOG(INFO, "Port %u: recovery enabled(%d), master function(%d)\n", - port_id, bnxt_is_recovery_enabled(bp), - bnxt_is_master_func(bp)); + status = bnxt_read_fw_status_reg(bp, BNXT_FW_STATUS_REG); + PMD_DRV_LOG(INFO, + "Port: %u Driver recovery watchdog, role: %s, FW status: 0x%x (%s)\n", + port_id, bnxt_is_primary_func(bp) ? "primary" : "backup", status, + (status == BNXT_FW_STATUS_HEALTHY) ? "healthy" : "unhealthy"); if (bp->flags & BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED) return; @@ -361,9 +364,9 @@ int bnxt_event_hwrm_resp_handler(struct bnxt *bp, struct cmpl_base *cmp) return evt; } -bool bnxt_is_master_func(struct bnxt *bp) +bool bnxt_is_primary_func(struct bnxt *bp) { - if (bp->recovery_info->flags & BNXT_FLAG_MASTER_FUNC) + if (bp->recovery_info->flags & BNXT_FLAG_PRIMARY_FUNC) return true; return false;