Skip to content

Commit

Permalink
net/nfp: fix DMA error after abnormal exit
Browse files Browse the repository at this point in the history
[ upstream commit 9e442599802e788874110339901f4eeb8f0ecc3b ]

When DPDK application exit abnormally, there might have DMA error,
and which will cause the load of firmware failed.

Fix this by force the physical port down to clear the possible DMA error.

Fixes: 896c265 ("net/nfp: use new CPP interface")

Signed-off-by: Shihong Wang <shihong.wang@corigine.com>
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
  • Loading branch information
shenxh3 authored and bluca committed Nov 8, 2023
1 parent fff9e49 commit 61bbbae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/nfp/nfp_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -3662,6 +3662,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
int ret = -ENODEV;
int err;
int i;
uint32_t j;

if (!dev)
return ret;
Expand Down Expand Up @@ -3696,6 +3697,10 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
return -EIO;
}

/* Force the physical port down to clear the possible DMA error */
for (j = 0; j < nfp_eth_table->count; j++)
nfp_eth_set_configured(cpp, nfp_eth_table->ports[j].index, 0);

if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
if (nfp_fw_setup(dev, cpp, nfp_eth_table, hwinfo)) {
PMD_DRV_LOG(INFO, "Error when uploading firmware");
Expand Down

0 comments on commit 61bbbae

Please sign in to comment.