BNXT_DEFAULT_VNIC_CHANGE_VF_ID_SFT;
PMD_DRV_LOG(INFO, "async event received vf_id 0x%x\n", vf_fid);
- for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS; vf_id++) {
+ for (vf_id = 0; vf_id < BNXT_MAX_VF_REPS(bp); vf_id++) {
eth_dev = bp->rep_info[vf_id].vfr_eth_dev;
if (!eth_dev)
continue;
bnxt_rep_dev_start_op(eth_dev);
}
+static void bnxt_handle_event_error_report(struct bnxt *bp,
+ uint32_t data1,
+ uint32_t data2)
+{
+ switch (BNXT_EVENT_ERROR_REPORT_TYPE(data1)) {
+ case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_PAUSE_STORM:
+ PMD_DRV_LOG(WARNING, "Port:%d Pause Storm detected!\n",
+ bp->eth_dev->data->port_id);
+ break;
+ default:
+ PMD_DRV_LOG(INFO, "FW reported unknown error type data1 %d"
+ " data2: %d\n", data1, data2);
+ break;
+ }
+}
+
/*
* Async event handling
*/
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;
+ }
- 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));
+ if (event_data & EVENT_DATA1_FLAGS_MASTER_FUNC)
+ info->flags |= BNXT_FLAG_PRIMARY_FUNC;
+ else
+ info->flags &= ~BNXT_FLAG_PRIMARY_FUNC;
+
+ 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;
if (bp->recovery_info)
bnxt_hwrm_fw_echo_reply(bp, data1, data2);
break;
+ case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT:
+ bnxt_handle_event_error_report(bp, data1, data2);
+ break;
default:
PMD_DRV_LOG(DEBUG, "handle_async_event id = 0x%x\n", event_id);
break;
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;
{
bp->eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
bp->eth_dev->tx_pkt_burst = &bnxt_dummy_xmit_pkts;
+
+ rte_eth_fp_ops[bp->eth_dev->data->port_id].rx_pkt_burst =
+ bp->eth_dev->rx_pkt_burst;
+ rte_eth_fp_ops[bp->eth_dev->data->port_id].tx_pkt_burst =
+ bp->eth_dev->tx_pkt_burst;
+ rte_mb();
+
+ /* Allow time for threads to exit the real burst functions. */
+ rte_delay_ms(100);
}