intel / intel/ethernet-linux-i40e

i40e v2.28.5+: VF initialization fails on PREEMPT kernels with multiple VFs

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

in commit fd19db996d035542f2bed2f44207f7c362cdc815, the change ignores i40e_sync_vf_state()'s return value and re-reads
VF state, allowing concurrent operations to cause spurious -EINVAL failures during legitimate VF initialization.
original code semantics before this change were correct (wait until flag or timeout)

Manifests on CONFIG_PREEMPT kernels with multiple simultaneous VFs due to larger preemption window.
causes iavf to get stuck in an infinite retry loop
Dec 05 18:51:20 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config (-5)
Dec 05 18:51:20 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Failed to communicate with PF; waiting before retry
Dec 05 18:51:25 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Hardware came out of reset. Attempting reinit.
Dec 05 18:51:25 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config due to PF error condition, not retrying
Dec 05 18:51:25 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config (-5)
Dec 05 18:51:25 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Failed to communicate with PF; waiting before retry
Dec 05 18:51:31 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Hardware came out of reset. Attempting reinit.
Dec 05 18:51:31 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config due to PF error condition, not retrying
Dec 05 18:51:31 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config (-5)
Dec 05 18:51:31 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Failed to communicate with PF; waiting before retry
Dec 05 18:51:36 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Hardware came out of reset. Attempting reinit.
Dec 05 18:51:36 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config due to PF error condition, not retrying
Dec 05 18:51:36 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config (-5)
Dec 05 18:51:36 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Failed to communicate with PF; waiting before retry
Dec 05 18:51:41 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Hardware came out of reset. Attempting reinit.
Dec 05 18:51:41 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config due to PF error condition, not retrying
Dec 05 18:51:41 xxxxxxxxxxx kernel: iavf 0000:21:0a.0: Unable to get VF config (-5)

```
- if (!i40e_sync_vf_state(vf, I40E_VF_STATE_INIT)) {
+ /* sync once, test multiple states later */
+ i40e_sync_vf_state(vf, I40E_VF_STATE_INIT);
+
+ if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states) ||
+ test_bit(I40E_VF_STATE_RESOURCES_LOADED, &vf->vf_states)) {
aq_ret = I40E_ERR_PARAM;
goto err;
```

last working released intel version is i40e-2.27.8.
thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.