-
Notifications
You must be signed in to change notification settings - Fork 114
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
Parallel NICs configuration #497
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
42bf306
to
ca9ace5
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
UPDATE: environment variables exist in pod after node reboot |
ca9ace5
to
37a73d8
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
37a73d8
to
e2b7dd4
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 7916806140Details
💛 - Coveralls |
e2b7dd4
to
c753939
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
c753939
to
851bc86
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
851bc86
to
59acc63
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
59acc63
to
11dba38
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
11dba38
to
e039dc5
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
e039dc5
to
9ca38c4
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
Left a few comments
pkg/utils/utils.go
Outdated
if !parallelNicConfig { | ||
return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) | ||
} | ||
return ConfigSriovInterfacesInParallel(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) |
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.
nit: use positve condition for readability
if !parallelNicConfig { | |
return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) | |
} | |
return ConfigSriovInterfacesInParallel(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) | |
if parallelNicConfig { | |
return ConfigSriovInterfacesInParallel(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) | |
} | |
return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) |
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.
done
pkg/utils/utils.go
Outdated
result = resetErr | ||
} | ||
} | ||
wg.Done() |
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.
Please, put it in a defer
statement at the beginning of the 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.
done
pkg/utils/utils.go
Outdated
go func(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt) { | ||
if err := configSriovDevice(iface, ifaceStatus); err != nil { | ||
glog.Errorf("ConfigSriovInterfacesInParallel(): fail to configure sriov interface %s: %v. resetting interface.", iface.PciAddress, err) | ||
result = err |
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.
What about using errgroup.Group
to handle this synchronization? I think it would be useful, as we are dealing with errors here.
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.
using result is problematic, multiple goroutines may update this at the same time
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.
we need to re-visit our API to include muliple results in SriovNetworkNodeState
pkg/utils/utils.go
Outdated
} | ||
} | ||
wg.Done() | ||
}(&iface, &ifaceStatus) |
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's not a good idea to use pointers here, as the variable address is always the same. Please, take a look at this modified example of WaitGroup: https://go.dev/play/p/8CuE98kz-Eg. If you try running it, you'll get the same print every time:
http://www.example.com/
http://www.example.com/
http://www.example.com/
Program exited.
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.
thanks, fixed
9ca38c4
to
5cc64b9
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
5cc64b9
to
1e08d75
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
pkg/utils/utils.go
Outdated
go func(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt) { | ||
if err := configSriovDevice(iface, ifaceStatus); err != nil { | ||
glog.Errorf("ConfigSriovInterfacesInParallel(): fail to configure sriov interface %s: %v. resetting interface.", iface.PciAddress, err) | ||
result = err |
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.
using result is problematic, multiple goroutines may update this at the same time
0f10346
to
5be6a80
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
5be6a80
to
79347dd
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
79347dd
to
6ff8524
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
6ff8524
to
f6bfd53
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
overall looks good @e0ne !
added some comments, nothing major.
@@ -187,6 +187,10 @@ func (r *SriovOperatorConfigReconciler) syncConfigDaemonSet(ctx context.Context, | |||
} else { | |||
data.Data["UsedSystemdMode"] = false | |||
} | |||
data.Data["ParallelNicConfig"] = false | |||
if parallelConfig, ok := dc.Spec.FeatureGates["parallelNicConfig"]; ok { |
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.
can we have "parallelNicConfig" as a constant in const package ?
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.
done
pkg/host/internal/sriov/sriov.go
Outdated
return nil | ||
} | ||
|
||
func checkNeedUpdate(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetworkv1.InterfaceExt, storeManager store.ManagerInterface) (bool, 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.
can you add docstring for added methods ?
also from the name "checkNeedUpdate" i expected that if true is returned then we need to update, but its actually the opposite... but i see also sriovnetworkv1.NeedToUpdateSriov
has same meaning...
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.
done
f6bfd53
to
aafe487
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
FeatureGates is a map to enable experimental features.
aafe487
to
01eb91f
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
01eb91f
to
8132982
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
8132982
to
1e4308a
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
LGTM !
Thx @e0ne :)
@zeeke could take a look ? |
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.
Left a few minor comments
1e4308a
to
0aead49
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
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.
LGTM. merging
Changes to CustomResourceDefinition have been introduced by - k8snetworkplumbingwg/sriov-network-operator#497 - k8snetworkplumbingwg/sriov-network-operator#569 Signed-off-by: Andrea Panattoni <[email protected]>
Changes to CustomResourceDefinition have been introduced by - k8snetworkplumbingwg/sriov-network-operator#497 - k8snetworkplumbingwg/sriov-network-operator#569 Signed-off-by: Andrea Panattoni <[email protected]>
No description provided.