| 6688 | } |
| 6689 | |
| 6690 | static void |
| 6691 | i40e_dev_handle_vfr_event(struct rte_eth_dev *dev) |
| 6692 | { |
| 6693 | struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 6694 | struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); |
| 6695 | int i; |
| 6696 | uint16_t abs_vf_id; |
| 6697 | uint32_t index, offset, val; |
| 6698 | |
| 6699 | if (!pf->vfs) |
| 6700 | return; |
| 6701 | /** |
| 6702 | * Try to find which VF trigger a reset, use absolute VF id to access |
| 6703 | * since the reg is global register. |
| 6704 | */ |
| 6705 | for (i = 0; i < pf->vf_num; i++) { |
| 6706 | abs_vf_id = hw->func_caps.vf_base_id + i; |
| 6707 | index = abs_vf_id / I40E_UINT32_BIT_SIZE; |
| 6708 | offset = abs_vf_id % I40E_UINT32_BIT_SIZE; |
| 6709 | val = I40E_READ_REG(hw, I40E_GLGEN_VFLRSTAT(index)); |
| 6710 | /* VFR event occurred */ |
| 6711 | if (val & (0x1 << offset)) { |
| 6712 | int ret; |
| 6713 | |
| 6714 | /* Clear the event first */ |
| 6715 | I40E_WRITE_REG(hw, I40E_GLGEN_VFLRSTAT(index), |
| 6716 | (0x1 << offset)); |
| 6717 | PMD_DRV_LOG(INFO, "VF %u reset occurred", abs_vf_id); |
| 6718 | /** |
| 6719 | * Only notify a VF reset event occurred, |
| 6720 | * don't trigger another SW reset |
| 6721 | */ |
| 6722 | ret = i40e_pf_host_vf_reset(&pf->vfs[i], 0); |
| 6723 | if (ret != I40E_SUCCESS) |
| 6724 | PMD_DRV_LOG(ERR, "Failed to do VF reset"); |
| 6725 | } |
| 6726 | } |
| 6727 | } |
| 6728 | |
| 6729 | static void |
| 6730 | i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev) |
no test coverage detected