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

Never reduce MTU on PF #489

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

bn222
Copy link
Collaborator

@bn222 bn222 commented Aug 11, 2023

In case a policy specifying a different MTU, in the past, the MTU of the PF associated with the VFs would also be updated. Since reducing the MTU on PF could cause issues when the PF is used by other things too (i.e. primary network), reducing the MTU could cause connectivity issues. Therefore, take the conservative approach of never reducing the MTU on the PF when configuring the MTU on the VF.

In case a policy specifying a different MTU, in the past,
the MTU of the PF associated with the VFs would also be updated.
Since reducing the MTU on PF could cause issues when the PF is
used by other things too (i.e. primary network), reducing the
MTU could cause connectivity issues. Therefore, take the conservative
approach of never reducing the MTU on the PF when configuring
the MTU on the VF.

Signed-off-by: Balazs Nemeth <[email protected]>
@bn222
Copy link
Collaborator Author

bn222 commented Aug 11, 2023

@SchSeba @adrianchiris

@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@wizhaoredhat
Copy link
Contributor

LGTM

@@ -263,10 +263,14 @@ func configSriovDevice(iface *sriovnetworkv1.Interface, ifaceStatus *sriovnetwor
}
// set PF mtu
if iface.Mtu > 0 && iface.Mtu != ifaceStatus.Mtu {
Copy link
Collaborator

@adrianchiris adrianchiris Aug 16, 2023

Choose a reason for hiding this comment

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

i would simply:

if iface.Mtu > 0  && iface.Mtu > ifaceStatus.Mtu {
  err = setNetdevMTU(iface.PciAddress, iface.Mtu)
  if err != nil {
    glog.Warningf("configSriovDevice(): fail to set mtu for PF %s: %v", iface.PciAddress, err)
    return err
  }
}

no need to emit the warning IMO in case desired VF MTU is less than PF mtu.

Copy link
Collaborator

Choose a reason for hiding this comment

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

looking at previous patch set, i see thats how you originally implemented it.
personally i prefer this way because its an allowed configuration and a resonable one. we should not emit warning to clutter an already cluttered log.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have no preference either way. I thought having a log would make it easier for people to figure out that their MTUs aren't being applied. Otherwise users will need to read to code to know that this is the desired behavior.

Copy link
Collaborator

@adrianchiris adrianchiris left a comment

Choose a reason for hiding this comment

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

small comment otherwise LGTM

@bn222
Copy link
Collaborator Author

bn222 commented Aug 16, 2023

I'm ok to revert the last change requested by William or to keep it. I do not have any preference. @wizhaoredhat What is your preference? It seems to me that @adrianchiris prefers a less polluted log file.

@wizhaoredhat
Copy link
Contributor

Just wondering, Does this handle the case if the MTU for the PF changes after the policy has been applied? Should we consider this case or not?

@adrianchiris
Copy link
Collaborator

Just wondering, Does this handle the case if the MTU for the PF changes after the policy has been applied? Should we consider this case or not?

i dont think we consider it for any parameter which the daemon configures. its generally assumed that no one tinkers with these configurations during config daemon run.

generally speaking, we could add similar behaviour to nodepolicy controller where we "periodically reconcile" the node.

@bn222
Copy link
Collaborator Author

bn222 commented Aug 17, 2023

right, but imo that's out of scope for this PR.

@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@bn222
Copy link
Collaborator Author

bn222 commented Aug 17, 2023

I've reverted the requested change from @wizhaoredhat . @adrianchiris PTAL one final time and merge it if ok.

Copy link
Collaborator

@adrianchiris adrianchiris left a comment

Choose a reason for hiding this comment

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

LGTM

@adrianchiris adrianchiris merged commit 4dd75bc into k8snetworkplumbingwg:master Aug 22, 2023
17 checks passed
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.

3 participants