Skip to content

incusd/device: Retry MAC address setting on SR-IOV VF interfaces#2894

Closed
psaab wants to merge 1 commit intolxc:mainfrom
psaab:fix-sriov-mac-retry
Closed

incusd/device: Retry MAC address setting on SR-IOV VF interfaces#2894
psaab wants to merge 1 commit intolxc:mainfrom
psaab:fix-sriov-mac-retry

Conversation

@psaab
Copy link
Copy Markdown

@psaab psaab commented Feb 5, 2026

Summary

  • Add retry loop when setting MAC address on SR-IOV VF interfaces for containers
  • Some drivers like iavf (Intel Adaptive Virtual Function) may still be initializing after the network interface appears, causing MAC address setting to fail with EAGAIN
  • The retry loop waits up to 5 seconds, polling every 50ms

Test plan

  • Tested on Intel E810 NIC with iavf driver
  • Container with SR-IOV network now starts successfully

🤖 Generated with Claude Code

Some drivers like iavf (Intel Adaptive Virtual Function) may still be
initializing after the network interface appears, causing MAC address
setting to fail with EAGAIN. This adds a retry loop (up to 5 seconds)
when setting the MAC address on SR-IOV VF interfaces for containers.

Signed-off-by: Paul Saab <[email protected]>
@psaab psaab requested a review from stgraber as a code owner February 5, 2026 03:09
@bensmrs
Copy link
Copy Markdown
Contributor

bensmrs commented Feb 5, 2026

Please refer to CONTRIBUTING.md before submitting AI-generated PRs.
This one is easy to review and spot for potential mistakes, though.

@psaab
Copy link
Copy Markdown
Author

psaab commented Feb 5, 2026

Ahh whoops, sorry about that. I did test this change out and it solves my issues with the ice driver.. I guess I am just looking for how we want to handle the retry loop.

@psaab
Copy link
Copy Markdown
Author

psaab commented Feb 5, 2026

Do we still think we can review this and get something in to fix this problem? I have tested that this works and I can now use incus with sriov on one of my machines.

@stgraber
Copy link
Copy Markdown
Member

stgraber commented Feb 5, 2026

Yeah, I'll send an equivalent PR soon. The code here looks pretty good, just not our usual style of retry loops :)

@brauner brauner closed this in c893837 Feb 6, 2026
tlusser pushed a commit to tlusser/incus that referenced this pull request Feb 8, 2026
Closes lxc#2894

Signed-off-by: Stéphane Graber <[email protected]>
Suggested-by: Paul Saab <[email protected]>
stgraber added a commit that referenced this pull request Mar 12, 2026
Closes #2894

Signed-off-by: Stéphane Graber <[email protected]>
Suggested-by: Paul Saab <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants