fix(hostagent): avoid EBUSY when setting sriov_numvfs#58
Open
tsorya wants to merge 1 commit into
Open
Conversation
The kernel returns EBUSY when writing to sriov_numvfs if VFs already exist. This happens in two scenarios during reconciliation: 1. The desired VF count is already configured (redundant write). 2. A different non-zero VF count is requested without first resetting to 0. Read the current sriov_numvfs value before writing: - If it already matches, skip the write entirely. - If changing from one non-zero value to another, write 0 first to tear down existing VFs before setting the new count. Example error seen in production: failed to execute operation CreateP0VF: write /sys/bus/pci/devices/0000:b5:00.0/sriov_numvfs: device or resource busy Signed-off-by: Igal Tsoiref <itsoiref@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Under what conditions would this happen? VF creation is executed after host reboot, during which |
Author
|
We have an api to set VF number and as part of the installation we were asked to set 1 and in case it had not zero value we will fail |
Author
|
In general it should be safe fix, nothing changes in the flow if vf number is 0 or the same |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The kernel returns EBUSY when writing to sriov_numvfs if VFs already exist. This happens in two scenarios during reconciliation:
Read the current sriov_numvfs value before writing:
Example error seen in production:
failed to execute operation CreateP0VF: write /sys/bus/pci/devices/0000:b5:00.0/sriov_numvfs: device or resource busy