-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set MAC address after renaming the interface #280
Conversation
11ea0a4
to
312c193
Compare
312c193
to
e8b7a5e
Compare
LGTM |
@zeeke could you provide more info on the the race condition and how this reduces the chance of race condition ?
typo remove "i" in MAC i address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit in commit msg + adding more info on the race condition is appreciated.
overall LGTM
I'm collaborating with kernel engineers to gather more information about this. What we discovered so far is that after recent changes to iavf driver (around I'm currently testing this against multiple NIC vendors. I hope I'll be back with more information, or at least regression test results to share with the community. |
e8b7a5e
to
da3ca0e
Compare
da3ca0e
to
03df0d8
Compare
I managed to reproduce the issue this PR is trying to solve with bare
Though the second call goes well, the network device doesn't have any connectivity:
mlx5 driver is not affected by the problem [6], and the fix is not interfering with it [5]. Besides this test script, several tests have been executed against the sriov-operator with this cni fix, showing no regression on Intel E810 and Mellanox ConnectX-5 [1] test-ip.with-fix.sh.txt |
Nice work @zeeke! Perhaps we should add a log in the retrying mechanism of SetVFEffectiveMAC to catch transient errors while setting the mac. |
Good point |
1d69ed6
to
634a385
Compare
@Eoghan1232 can you please take a look at this? |
pkg/utils/utils.go
Outdated
@@ -402,3 +407,15 @@ func Retry(retries int, sleep time.Duration, f func() error) error { | |||
} | |||
return err | |||
} | |||
|
|||
func warnOnError(callerFn string, f func() error) func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simplify this. You can simply put the logging in the Retry function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would involve many log calls, one for each error returned. Here we catch all of them.
I'm ok with removing all this logging and discussing it in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I didn't mean to add it inside the func() which is passed as a parameter in the Retry function, but to add it in the Retry function itself. Line 400 of utils.go. You would only add it once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I got it. Not a big fan of logging from utility functions. it can lead to a lot of junk in the log files, for example, if the Retry
function is called for another job where it's expected to have multiple failures before going well.
since it's not yet used widely, I'd overcome that by making it private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also add a new parameter "warnOnError" in the Retry func to control when to log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5th parameter for a utility function. That's going to be even worse.
Thanks for the suggestions, but let's discuss it in a different PR, we went out of topic here.
Reverting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, please create an issue to not forget this.
4ef5df7
to
03df0d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with these changes.
One question, I see you took out the changes to utils:
func warnOnError(callerFn string, f func() error) func() error {
was this intended? @zeeke
Setting the MAC address at the end of SetupVF reduces the chances of race conditions with tools that set MAC address asynchronously (i.e. iavf). This commit solve an issue with i40e driver where calling `SetVFEffectiveMAC` after `SetVFHardwareMAC` may produce a VF with no connectivity even if the last configuration step didn't produce any error: ``` + ip link set dev ens1f0 vf 0 mac 20:04:0f:f1:88:A1 # No error + ip link set dev temp_71 address 20:04:0f:f1:88:A1 # Transient error RTNETLINK answers: Resource temporarily unavailable + ip link set dev temp_71 address 20:04:0f:f1:88:A1 # No error ``` Note: this seems to be a kernel driver regression introduced near torvalds/linux@c34743d Signed-off-by: Andrea Panattoni <[email protected]>
03df0d8
to
d572508
Compare
Yes, we didn't find a consensus on how to log setting MAC address retries, so we'll tackle that on a different PR.
Updated the commit message |
understood, then I think we are good to merge this. |
PR got 2 LGTMs from maintainers, merging. |
Thx for the detailed information @zeeke ! |
Setting the MAC address at the end of SetupVF reduces the chances of race conditions with tools that set MAC i address asynchronously (i.e. iavf).