bnxt_en: Report health status update after reset is done
Report health status update to devlink health reporter, once reset is completed. Cc: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e633a32935
commit
e4e38237d7
|
@ -10750,6 +10750,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
|||
smp_mb__before_atomic();
|
||||
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
|
||||
bnxt_ulp_start(bp, rc);
|
||||
bnxt_dl_health_status_update(bp, true);
|
||||
rtnl_unlock();
|
||||
break;
|
||||
}
|
||||
|
@ -10757,6 +10758,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)
|
|||
|
||||
fw_reset_abort:
|
||||
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
|
||||
if (bp->fw_reset_state != BNXT_FW_RESET_STATE_POLL_VF)
|
||||
bnxt_dl_health_status_update(bp, false);
|
||||
bp->fw_reset_state = 0;
|
||||
rtnl_lock();
|
||||
dev_close(bp->dev);
|
||||
|
|
|
@ -1384,6 +1384,7 @@ struct bnxt_fw_health {
|
|||
u32 last_fw_reset_cnt;
|
||||
u8 enabled:1;
|
||||
u8 master:1;
|
||||
u8 fatal:1;
|
||||
u8 tmr_multiplier;
|
||||
u8 tmr_counter;
|
||||
u8 fw_reset_seq_cnt;
|
||||
|
|
|
@ -91,6 +91,7 @@ static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
|
|||
if (!priv_ctx)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
bp->fw_health->fatal = true;
|
||||
event = fw_reporter_ctx->sp_event;
|
||||
if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)
|
||||
bnxt_fw_reset(bp);
|
||||
|
@ -199,6 +200,26 @@ void bnxt_devlink_health_report(struct bnxt *bp, unsigned long event)
|
|||
}
|
||||
}
|
||||
|
||||
void bnxt_dl_health_status_update(struct bnxt *bp, bool healthy)
|
||||
{
|
||||
struct bnxt_fw_health *health = bp->fw_health;
|
||||
u8 state;
|
||||
|
||||
if (healthy)
|
||||
state = DEVLINK_HEALTH_REPORTER_STATE_HEALTHY;
|
||||
else
|
||||
state = DEVLINK_HEALTH_REPORTER_STATE_ERROR;
|
||||
|
||||
if (health->fatal)
|
||||
devlink_health_reporter_state_update(health->fw_fatal_reporter,
|
||||
state);
|
||||
else
|
||||
devlink_health_reporter_state_update(health->fw_reset_reporter,
|
||||
state);
|
||||
|
||||
health->fatal = false;
|
||||
}
|
||||
|
||||
static const struct devlink_ops bnxt_dl_ops = {
|
||||
#ifdef CONFIG_BNXT_SRIOV
|
||||
.eswitch_mode_set = bnxt_dl_eswitch_mode_set,
|
||||
|
|
|
@ -57,6 +57,7 @@ struct bnxt_dl_nvm_param {
|
|||
};
|
||||
|
||||
void bnxt_devlink_health_report(struct bnxt *bp, unsigned long event);
|
||||
void bnxt_dl_health_status_update(struct bnxt *bp, bool healthy);
|
||||
int bnxt_dl_register(struct bnxt *bp);
|
||||
void bnxt_dl_unregister(struct bnxt *bp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue