* Reset VF device only to re-initialize resources in PMD layer */
| 2948 | * Reset VF device only to re-initialize resources in PMD layer |
| 2949 | */ |
| 2950 | static int |
| 2951 | iavf_dev_reset(struct rte_eth_dev *dev) |
| 2952 | { |
| 2953 | int ret; |
| 2954 | struct iavf_adapter *adapter = |
| 2955 | IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); |
| 2956 | struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 2957 | /* |
| 2958 | * Check whether the VF reset has been done and inform application, |
| 2959 | * to avoid calling the virtual channel command, which may cause |
| 2960 | * the device to be abnormal. |
| 2961 | */ |
| 2962 | ret = iavf_check_vf_reset_done(hw); |
| 2963 | if (ret) { |
| 2964 | PMD_DRV_LOG(ERR, "Wait too long for reset done!"); |
| 2965 | return ret; |
| 2966 | } |
| 2967 | iavf_set_no_poll(adapter, false); |
| 2968 | |
| 2969 | PMD_DRV_LOG(DEBUG, "Start dev_reset ..."); |
| 2970 | ret = iavf_dev_uninit(dev); |
| 2971 | if (ret) |
| 2972 | return ret; |
| 2973 | |
| 2974 | return iavf_dev_init(dev); |
| 2975 | } |
| 2976 | |
| 2977 | static inline bool |
| 2978 | iavf_is_reset(struct iavf_hw *hw) |
no test coverage detected