* Async event handling */
| 131 | * Async event handling |
| 132 | */ |
| 133 | void bnxt_handle_async_event(struct bnxt *bp, |
| 134 | struct cmpl_base *cmp) |
| 135 | { |
| 136 | struct hwrm_async_event_cmpl *async_cmp = |
| 137 | (struct hwrm_async_event_cmpl *)cmp; |
| 138 | uint16_t event_id = rte_le_to_cpu_16(async_cmp->event_id); |
| 139 | uint16_t port_id = bp->eth_dev->data->port_id; |
| 140 | struct bnxt_error_recovery_info *info; |
| 141 | uint32_t event_data; |
| 142 | uint32_t data1, data2; |
| 143 | uint32_t status; |
| 144 | |
| 145 | data1 = rte_le_to_cpu_32(async_cmp->event_data1); |
| 146 | data2 = rte_le_to_cpu_32(async_cmp->event_data2); |
| 147 | |
| 148 | switch (event_id) { |
| 149 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE: |
| 150 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE: |
| 151 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: |
| 152 | /* FALLTHROUGH */ |
| 153 | bnxt_link_update_op(bp->eth_dev, 0); |
| 154 | rte_eth_dev_callback_process(bp->eth_dev, |
| 155 | RTE_ETH_EVENT_INTR_LSC, NULL); |
| 156 | break; |
| 157 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: |
| 158 | PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); |
| 159 | break; |
| 160 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE: |
| 161 | PMD_DRV_LOG(INFO, "Port %u: VF config change async event\n", port_id); |
| 162 | PMD_DRV_LOG(INFO, "event: data1 %#x data2 %#x\n", data1, data2); |
| 163 | bnxt_hwrm_func_qcfg(bp, NULL); |
| 164 | if (BNXT_VF(bp)) |
| 165 | rte_eal_alarm_set(1, bnxt_handle_vf_cfg_change, (void *)bp); |
| 166 | break; |
| 167 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED: |
| 168 | PMD_DRV_LOG(INFO, "Port conn async event\n"); |
| 169 | break; |
| 170 | case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY: |
| 171 | /* |
| 172 | * Avoid any rx/tx packet processing during firmware reset |
| 173 | * operation. |
| 174 | */ |
| 175 | bnxt_stop_rxtx(bp->eth_dev); |
| 176 | |
| 177 | /* Ignore reset notify async events when stopping the port */ |
| 178 | if (!bp->eth_dev->data->dev_started) { |
| 179 | bp->flags |= BNXT_FLAG_FATAL_ERROR; |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | rte_eth_dev_callback_process(bp->eth_dev, |
| 184 | RTE_ETH_EVENT_ERR_RECOVERING, |
| 185 | NULL); |
| 186 | |
| 187 | pthread_mutex_lock(&bp->err_recovery_lock); |
| 188 | event_data = data1; |
| 189 | /* timestamp_lo/hi values are in units of 100ms */ |
| 190 | bp->fw_reset_max_msecs = async_cmp->timestamp_hi ? |
no test coverage detected