MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bnxt_wait_for_device_shutdown

Function bnxt_wait_for_device_shutdown

dpdk/drivers/net/bnxt/bnxt_cpr.c:15–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include "hsi_struct_def_dpdk.h"
14
15void bnxt_wait_for_device_shutdown(struct bnxt *bp)
16{
17 uint32_t val, timeout;
18
19 /* if HWRM_FUNC_QCAPS_OUTPUT_FLAGS_ERR_RECOVER_RELOAD is set
20 * in HWRM_FUNC_QCAPS command, wait for FW_STATUS to set
21 * the SHUTDOWN bit in health register
22 */
23 if (!(bp->recovery_info &&
24 (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD)))
25 return;
26
27 /* Driver has to wait for fw_reset_max_msecs or shutdown bit which comes
28 * first for FW to collect crash dump.
29 */
30 timeout = bp->fw_reset_max_msecs;
31
32 /* Driver has to poll for shutdown bit in fw_status register
33 *
34 * 1. in case of hot fw upgrade, this bit will be set after all
35 * function drivers unregistered with fw.
36 * 2. in case of fw initiated error recovery, this bit will be
37 * set after fw has collected the core dump
38 */
39 do {
40 val = bnxt_read_fw_status_reg(bp, BNXT_FW_STATUS_REG);
41 if (val & BNXT_FW_STATUS_SHUTDOWN)
42 return;
43
44 rte_delay_ms(100);
45 timeout -= 100;
46 } while (timeout);
47}
48
49static void
50bnxt_process_default_vnic_change(struct bnxt *bp,

Callers 1

Calls 2

bnxt_read_fw_status_regFunction · 0.85
rte_delay_msFunction · 0.85

Tested by

no test coverage detected