Skip to content
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 link state up for target ports of SriovNetworkNodePolicy for kubernetes cluster #72

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

Mmduh-483
Copy link
Contributor

fixes #45

// Set PF link up for kubernetes cluster
if ClusterType == ClusterTypeKubernetes && ifaceStatus.Name != "" {
pfLink, err := netlink.LinkByName(ifaceStatus.Name)
if err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can check if the pfLink is not up with
pfLink.Attrs().OperState == OperUp or something like that.

Also in what case ifaceStatus.Name will be ""?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If some modules are not loaded like ipoib for IB interfaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added condition for state and removed the condition for name

@Mmduh-483 Mmduh-483 force-pushed the k8s-cluster-pf-state branch from 304caa3 to de56cca Compare February 22, 2021 07:15
@Mmduh-483 Mmduh-483 requested a review from moshe010 February 22, 2021 07:15
@@ -315,6 +315,19 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
}
}
}
// Set PF link up for kubernetes cluster
if ClusterType == ClusterTypeKubernetes {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason this is special for k8s cluster?

Copy link
Collaborator

@moshe010 moshe010 Feb 23, 2021

Choose a reason for hiding this comment

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

So we encounter this is k8s vanilla, we can remove this check if you think it make sense openshift.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks Moshe!
I think it's fine to enable it for both cluster types, as long as there is numvfs configured for that device, link state will be set to up.
/cc @pliurh

Copy link
Collaborator

Choose a reason for hiding this comment

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

In openshift, the NetworkManager will do the job. Shall we check whether the link-state first before setting it to up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a check for the state if pfLink.Attrs().OperState != netlink.OperUp

@Mmduh-483 Mmduh-483 force-pushed the k8s-cluster-pf-state branch from de56cca to ab7165e Compare February 23, 2021 10:38
@pliurh pliurh merged commit 80d51bf into k8snetworkplumbingwg:master Mar 2, 2021
@pliurh pliurh mentioned this pull request Mar 4, 2021
6 tasks
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.

Applied SriovNetworkNodePolicy does no bring ETH/IB port with DOWN link state to link state UP
4 participants