Skip to content

Commit

Permalink
net/ice: retry getting VF VSI map after failure
Browse files Browse the repository at this point in the history
[ upstream commit b71573e ]

The request of getting VF VSI map request may fail when DCF is busy,
this patch adds retry mechanism to make it able to succeed.

Fixes: b09d34a ("net/ice: fix flow redirector")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
  • Loading branch information
yudapengx authored and steevenlee committed Nov 8, 2021
1 parent 90d7fd5 commit c9eddf6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions drivers/net/ice/ice_dcf.c
Expand Up @@ -529,15 +529,26 @@ int
ice_dcf_handle_vsi_update_event(struct ice_dcf_hw *hw)
{
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(hw->eth_dev);
int err = 0;
int i = 0;
int err = -1;

rte_spinlock_lock(&hw->vc_cmd_send_lock);

rte_intr_disable(&pci_dev->intr_handle);
ice_dcf_disable_irq0(hw);

if (ice_dcf_get_vf_resource(hw) || ice_dcf_get_vf_vsi_map(hw) < 0)
err = -1;
for (;;) {
if (ice_dcf_get_vf_resource(hw) == 0 &&
ice_dcf_get_vf_vsi_map(hw) >= 0) {
err = 0;
break;
}

if (++i >= ICE_DCF_ARQ_MAX_RETRIES)
break;

rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME);
}

rte_intr_enable(&pci_dev->intr_handle);
ice_dcf_enable_irq0(hw);
Expand Down

0 comments on commit c9eddf6

Please sign in to comment.