struct bnxt_error_recovery_info {
/* All units in milliseconds */
uint32_t driver_polling_freq;
- uint32_t master_func_wait_period;
+ uint32_t primary_func_wait_period;
uint32_t normal_func_wait_period;
- uint32_t master_func_wait_period_after_reset;
+ uint32_t primary_func_wait_period_after_reset;
uint32_t max_bailout_time_after_reset;
#define BNXT_FW_STATUS_REG 0
#define BNXT_FW_HEARTBEAT_CNT_REG 1
uint8_t delay_after_reset[BNXT_NUM_RESET_REG];
#define BNXT_FLAG_ERROR_RECOVERY_HOST BIT(0)
#define BNXT_FLAG_ERROR_RECOVERY_CO_CPU BIT(1)
-#define BNXT_FLAG_MASTER_FUNC BIT(2)
+#define BNXT_FLAG_PRIMARY_FUNC BIT(2)
#define BNXT_FLAG_RECOVERY_ENABLED BIT(3)
uint32_t flags;
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);
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;
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;
HWRM_ASYNC_EVENT_CMPL_ERROR_RECOVERY_EVENT_DATA1_FLAGS_RECOVERY_ENABLED
bool bnxt_is_recovery_enabled(struct bnxt *bp);
-bool bnxt_is_master_func(struct bnxt *bp);
+bool bnxt_is_primary_func(struct bnxt *bp);
void bnxt_stop_rxtx(struct bnxt *bp);
int rc = 0;
if (info->flags & BNXT_FLAG_ERROR_RECOVERY_HOST) {
- /* Reset through master function driver */
+ /* Reset through primary function driver */
for (i = 0; i < info->reg_array_cnt; i++)
bnxt_write_fw_reset_reg(bp, i);
/* Wait for time specified by FW after triggering reset */
- rte_delay_ms(info->master_func_wait_period_after_reset);
+ rte_delay_ms(info->primary_func_wait_period_after_reset);
} else if (info->flags & BNXT_FLAG_ERROR_RECOVERY_CO_CPU) {
/* Reset with the help of Kong processor */
rc = bnxt_hwrm_fw_reset(bp);
struct bnxt_error_recovery_info *info = bp->recovery_info;
int rc = 0;
- /* Only Master function can do FW reset */
- if (bnxt_is_master_func(bp) &&
+ /* Only Primary function can do FW reset */
+ if (bnxt_is_primary_func(bp) &&
bnxt_is_recovery_enabled(bp)) {
rc = bnxt_fw_reset_all(bp);
if (rc) {
* advertised by FW in HWRM_ERROR_RECOVERY_QCFG.
* When the driver detects heartbeat stop or change in reset_counter,
* it has to trigger a reset to recover from the error condition.
- * A “master PF” is the function who will have the privilege to
- * initiate the chimp reset. The master PF will be elected by the
+ * A “primary function” is the function who will have the privilege to
+ * initiate the chimp reset. The primary function will be elected by the
* firmware and will be notified through async message.
*/
static void bnxt_check_fw_health(void *arg)
PMD_DRV_LOG(ERR, "Detected FW dead condition\n");
- if (bnxt_is_master_func(bp))
- wait_msec = info->master_func_wait_period;
+ if (bnxt_is_primary_func(bp))
+ wait_msec = info->primary_func_wait_period;
else
wait_msec = info->normal_func_wait_period;
/* FW returned values are in units of 100msec */
info->driver_polling_freq =
rte_le_to_cpu_32(resp->driver_polling_freq) * 100;
- info->master_func_wait_period =
+ info->primary_func_wait_period =
rte_le_to_cpu_32(resp->master_func_wait_period) * 100;
info->normal_func_wait_period =
rte_le_to_cpu_32(resp->normal_func_wait_period) * 100;
- info->master_func_wait_period_after_reset =
+ info->primary_func_wait_period_after_reset =
rte_le_to_cpu_32(resp->master_func_wait_period_after_reset) * 100;
info->max_bailout_time_after_reset =
rte_le_to_cpu_32(resp->max_bailout_time_after_reset) * 100;