if (i >= MAX_RESET_WAIT_CNT)
return -1;
- vf->vf_reset = false;
vf->pend_msg &= ~PFMSG_RESET_IMPENDING;
return 0;
switch (pf_msg->event) {
case VIRTCHNL_EVENT_RESET_IMPENDING:
PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_RESET_IMPENDING event");
+ vf->vf_reset = true;
rte_eth_dev_callback_process(dev,
RTE_ETH_EVENT_INTR_RESET, NULL);
break;
{
struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+ struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
int ret;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
i40e_shutdown_adminq(hw);
i40evf_disable_irq0(hw);
+ /*
+ * If the VF is reset via VFLR, the device will be knocked out of bus
+ * master mode, and the driver will fail to recover from the reset. Fix
+ * this by enabling bus mastering after every reset. In a non-VFLR case,
+ * the bus master bit will not be disabled, and this call will have no
+ * effect.
+ */
+ if (vf->vf_reset && !rte_pci_set_bus_master(pci_dev, true))
+ vf->vf_reset = false;
+
rte_free(vf->vf_res);
vf->vf_res = NULL;
rte_free(vf->aq_resp);