Commit e4e38237 authored by Vasundhara Volam's avatar Vasundhara Volam Committed by David S. Miller
Browse files

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: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e633a329
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -10750,6 +10750,7 @@ static void bnxt_fw_reset_task(struct work_struct *work)
		smp_mb__before_atomic();
		smp_mb__before_atomic();
		clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
		clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
		bnxt_ulp_start(bp, rc);
		bnxt_ulp_start(bp, rc);
		bnxt_dl_health_status_update(bp, true);
		rtnl_unlock();
		rtnl_unlock();
		break;
		break;
	}
	}
@@ -10757,6 +10758,8 @@ static void bnxt_fw_reset_task(struct work_struct *work)


fw_reset_abort:
fw_reset_abort:
	clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
	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;
	bp->fw_reset_state = 0;
	rtnl_lock();
	rtnl_lock();
	dev_close(bp->dev);
	dev_close(bp->dev);
+1 −0
Original line number Original line Diff line number Diff line
@@ -1384,6 +1384,7 @@ struct bnxt_fw_health {
	u32 last_fw_reset_cnt;
	u32 last_fw_reset_cnt;
	u8 enabled:1;
	u8 enabled:1;
	u8 master:1;
	u8 master:1;
	u8 fatal:1;
	u8 tmr_multiplier;
	u8 tmr_multiplier;
	u8 tmr_counter;
	u8 tmr_counter;
	u8 fw_reset_seq_cnt;
	u8 fw_reset_seq_cnt;
+21 −0
Original line number Original line Diff line number Diff line
@@ -91,6 +91,7 @@ static int bnxt_fw_fatal_recover(struct devlink_health_reporter *reporter,
	if (!priv_ctx)
	if (!priv_ctx)
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;


	bp->fw_health->fatal = true;
	event = fw_reporter_ctx->sp_event;
	event = fw_reporter_ctx->sp_event;
	if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)
	if (event == BNXT_FW_RESET_NOTIFY_SP_EVENT)
		bnxt_fw_reset(bp);
		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 = {
static const struct devlink_ops bnxt_dl_ops = {
#ifdef CONFIG_BNXT_SRIOV
#ifdef CONFIG_BNXT_SRIOV
	.eswitch_mode_set = bnxt_dl_eswitch_mode_set,
	.eswitch_mode_set = bnxt_dl_eswitch_mode_set,
+1 −0
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ struct bnxt_dl_nvm_param {
};
};


void bnxt_devlink_health_report(struct bnxt *bp, unsigned long event);
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);
int bnxt_dl_register(struct bnxt *bp);
void bnxt_dl_unregister(struct bnxt *bp);
void bnxt_dl_unregister(struct bnxt *bp);