Fix addresses and routes reinserted to the VRF#1151
Merged
squeed merged 1 commit intocontainernetworking:mainfrom Mar 24, 2025
Merged
Fix addresses and routes reinserted to the VRF#1151squeed merged 1 commit intocontainernetworking:mainfrom
squeed merged 1 commit intocontainernetworking:mainfrom
Conversation
These changes make sure that only IPV6 global addresses and non local/connected routes are reinserted to the VRF table after slaving the interface Signed-off-by: Marcelo Guerrero <marguerr@redhat.com>
Member
Author
squeed
approved these changes
Mar 24, 2025
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.
Fix addresses and routes reinserted to the VRF
These changes make sure that only IPV6 global addresses and non local/connected routes are reinserted to the VRF table after slaving the interface
Issue:
Consistent failure
After slaving an interface to a VRF, global IPV6 addresses (unless a sysctl option is enabled) are lost. The plugin gets the IPV6 addresses after and before slaving the interface and adds the ones that are missing. It checks that those addresses are present in the kernel to prevent failures when adding missing global routes associated with these addresses (subsequent operation). There is a retrying mechanism for checking the presence of these addresses since the kernel takes some time to add them.
First approach was to increase the number of retries (from 10 retries to 100 retries - same sleep time 10ms). It works, however, as seen in the log, the IPV6 address is a link-local one. These are moved by the kernel automatically. For some reason, when combining SRIOV and VRF, the kernel takes longer to add these. So, instead, a logic was added to only reinsert global IPV6 addresses. The issue was fixed with this without having to increment the retries. There were some routes that don't need to be added. This PR includes a fix for this as well. This latter approach is preferred instead of blindly increasing the retries.
https://docs.kernel.org/networking/vrf.html