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

Function bnxt_dev_recover

dpdk/drivers/net/bnxt/bnxt_ethdev.c:4387–4456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4385}
4386
4387static void bnxt_dev_recover(void *arg)
4388{
4389 struct bnxt *bp = arg;
4390 int rc = 0;
4391
4392 pthread_mutex_lock(&bp->err_recovery_lock);
4393
4394 if (!bp->fw_reset_min_msecs) {
4395 rc = bnxt_check_fw_reset_done(bp);
4396 if (rc)
4397 goto err;
4398 }
4399
4400 /* Clear Error flag so that device re-init should happen */
4401 bp->flags &= ~BNXT_FLAG_FATAL_ERROR;
4402 PMD_DRV_LOG(INFO, "Port: %u Starting recovery...\n",
4403 bp->eth_dev->data->port_id);
4404
4405 rc = bnxt_check_fw_ready(bp);
4406 if (rc)
4407 goto err;
4408
4409 rc = bnxt_init_resources(bp, true);
4410 if (rc) {
4411 PMD_DRV_LOG(ERR,
4412 "Failed to initialize resources after reset\n");
4413 goto err;
4414 }
4415 /* clear reset flag as the device is initialized now */
4416 bp->flags &= ~BNXT_FLAG_FW_RESET;
4417
4418 rc = bnxt_dev_start_op(bp->eth_dev);
4419 if (rc) {
4420 PMD_DRV_LOG(ERR, "Failed to start port after reset\n");
4421 goto err_start;
4422 }
4423
4424 rc = bnxt_restore_filters(bp);
4425 if (rc)
4426 goto err_start;
4427
4428 rte_eth_fp_ops[bp->eth_dev->data->port_id].rx_pkt_burst =
4429 bp->eth_dev->rx_pkt_burst;
4430 rte_eth_fp_ops[bp->eth_dev->data->port_id].tx_pkt_burst =
4431 bp->eth_dev->tx_pkt_burst;
4432 rte_mb();
4433
4434 PMD_DRV_LOG(INFO, "Port: %u Recovered from FW reset\n",
4435 bp->eth_dev->data->port_id);
4436 pthread_mutex_unlock(&bp->err_recovery_lock);
4437 rte_eth_dev_callback_process(bp->eth_dev,
4438 RTE_ETH_EVENT_RECOVERY_SUCCESS,
4439 NULL);
4440 return;
4441err_start:
4442 bnxt_dev_stop(bp->eth_dev);
4443err:
4444 bp->flags |= BNXT_FLAG_FATAL_ERROR;

Callers

nothing calls this directly

Calls 10

pthread_mutex_lockFunction · 0.85
bnxt_check_fw_reset_doneFunction · 0.85
bnxt_check_fw_readyFunction · 0.85
bnxt_init_resourcesFunction · 0.85
bnxt_dev_start_opFunction · 0.85
bnxt_restore_filtersFunction · 0.85
pthread_mutex_unlockFunction · 0.85
bnxt_dev_stopFunction · 0.85
bnxt_uninit_resourcesFunction · 0.85

Tested by

no test coverage detected