Skip to content

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

@usr06c4

Description

@usr06c4

in commit fd19db9, 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions