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

Function i40e_dev_handle_vfr_event

dpdk/drivers/net/i40e/i40e_ethdev.c:6690–6727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6688}
6689
6690static void
6691i40e_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
6729static void
6730i40e_notify_all_vfs_link_status(struct rte_eth_dev *dev)

Callers 2

i40e_dev_alarm_handlerFunction · 0.85

Calls 1

i40e_pf_host_vf_resetFunction · 0.85

Tested by

no test coverage detected