Skip to content

generate: sriov: execute udev rules before starting sriov apply service#569

Merged
benhoyt merged 1 commit intocanonical:mainfrom
rmalz-c:usr/rmalz/fix_sriov_apply
Feb 12, 2026
Merged

generate: sriov: execute udev rules before starting sriov apply service#569
benhoyt merged 1 commit intocanonical:mainfrom
rmalz-c:usr/rmalz/fix_sriov_apply

Conversation

@rmalz-c
Copy link
Contributor

@rmalz-c rmalz-c commented Feb 2, 2026

netplan-sriov-apply.service already depends on .device units to start its execution. However that unit does not guarantee that expected interface names are already set. As a result netplan might hit race condition with udev rules processing and interface name can change when service is running. This can cause multiple issues in apply_sriov_config function. For instance netplan will fetch current PF names and will try to configure them according to the config, however if name changes during that process, netplan will crash when trying to get pci slot name.

This issue is not visible outside of netplan-sriov-apply.service because netplan apply command will explicitly trigger udev rules and wait for it to finish (before process_sriov_config call).

Proposed change modifies netplan-sriov-apply.service generation to execute udev rules, instead of directly calling it in code, to explicitly show dependencies on udev rule execution.

LP2139598

netplan-sriov-apply.service already depends on .device units to start its execution.
However that unit does not guarantee that expected interface names are already set.
As a result netplan might hit race condition with udev rules processing and interface
name can change when service is running. This can cause multiple issues in
apply_sriov_config function. For instance netplan will fetch current PF names and will
try to configure them according to the config, however if name changes during that process,
netplan will crash when trying to get pci slot name.

This issue is not visible outside of netplan-sriov-apply.service because netplan apply command
will explicitly trigger udev rules and wait for it to finish (before process_sriov_config call).

Proposed change modifies netplan-sriov-apply.service generation to execute udev rules, instead
of directly calling it in code, to explicitly show dependencies on udev rule execution.

LP2139598
@slyon
Copy link
Contributor

slyon commented Feb 2, 2026

Thanks @rmalz-c for the effort you put into this!

the approach is as discussed, provides an isolated solution and lgtm!

Copy link
Contributor

@nicolasbock nicolasbock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice catch!

Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed and Jegadish discussed with Robert. Looks good (and separately we'll get more context on the project).

@benhoyt benhoyt merged commit 09402c6 into canonical:main Feb 12, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments