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

[software-bridges 5/x] Enable software-bridge implementation #750

Conversation

ykulazhenkov
Copy link
Collaborator

This PR enables all required code for software-bridges features.
I will submit documentation for the feature in the next PR. I created #749 to track documentation update.

How to test the feature:

  • deploy the operator
  • enable manageSoftwareBridges feature gate
    kubectl patch sriovoperatorconfigs.sriovnetwork.openshift.io -n network-operator default --patch '{ "spec": { "featureGates": { "manageSoftwareBridges": true } } }' --type='merge'
  • create policy with the OVS config
kind: SriovNetworkNodePolicy
metadata:
  name: connectx6dx-switchdev
  namespace: network-operator
spec:
  eSwitchMode: switchdev
  mtu: 1500
  nicSelector:
    deviceID: 101d
    vendor: 15b3
  nodeSelector:
    node-role.kubernetes.io/worker: ""
  numVfs: 4
  resourceName: switchdev
  bridge:
    ovs: {}
  • create OVSNetwork CR
apiVersion: sriovnetwork.openshift.io/v1
kind: OVSNetwork
metadata:
  name: ovs
  namespace: network-operator
spec:
  networkNamespace: default
  ipam: |
    {
      "type": "nv-ipam",
      "poolName": "pool1"
    }
  resourceName: switchdev
  vlan: 200

Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can 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, Maintainers can 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.

@coveralls
Copy link

coveralls commented Jul 25, 2024

Pull Request Test Coverage Report for Build 10564493259

Details

  • 89 of 187 (47.59%) changed or added relevant lines in 10 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 45.015%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/sriov-network-config-daemon/start.go 1 2 50.0%
pkg/systemd/systemd.go 0 1 0.0%
cmd/sriov-network-config-daemon/service.go 11 13 84.62%
pkg/host/internal/bridge/ovs/ovs.go 27 29 93.1%
pkg/plugins/generic/generic_plugin.go 34 46 73.91%
pkg/daemon/writer.go 0 14 0.0%
pkg/host/internal/sriov/sriov.go 2 17 11.76%
pkg/helper/mock/mock_helper.go 11 31 35.48%
pkg/host/mock/mock_host.go 0 31 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/plugins/generic/generic_plugin.go 1 55.67%
Totals Coverage Status
Change from base Build 10507933758: 0.02%
Covered Lines: 6605
Relevant Lines: 14673

💛 - Coveralls

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
Copy link
Collaborator

@SchSeba PTAL on this one.

pkg/plugins/generic/generic_plugin.go Show resolved Hide resolved
@@ -68,8 +69,16 @@ func WithSkipVFConfiguration() Option {
}
}

// WithSkipBridgeConfiguration configures generic_plugin to skip configuration of the managed bridges
func WithSkipBridgeConfiguration() Option {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this one used.

so at the end we only validate the vars.ManageSoftwareBridges. on the if state here return vars.ManageSoftwareBridges && !p.skipBridgeConfiguration

also (I know it's not part of this PR) can you please explain me when on prePhase we don't configure the vfs?

case PhasePre:
configPlugin, err = newGenericPluginFunc(hostHelpers, generic.WithSkipVFConfiguration())

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also (I know it's not part of this PR) can you please explain me when on prePhase we don't configure the vfs?

At the pre stage we creatr VFs, but unbind them from a driver to let OS Network manager (e.g. NetworkManager, systemd-network) to apply custom configuration for the PF function (e.g. VF-lag). Such configuration can't be when the PF has VFs that are bound to a driver.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The WithSkipBridgeConfiguration function is used in the service command to disable bridge management during the pre phase

Copy link
Collaborator

Choose a reason for hiding this comment

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

you are right! I miss that sorry

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

LGTM

nice work!

@@ -68,8 +69,16 @@ func WithSkipVFConfiguration() Option {
}
}

// WithSkipBridgeConfiguration configures generic_plugin to skip configuration of the managed bridges
func WithSkipBridgeConfiguration() Option {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you are right! I miss that sorry

@adrianchiris
Copy link
Collaborator

adrianchiris commented Aug 27, 2024

Thx for the great work @ykulazhenkov !! 🎉

@adrianchiris adrianchiris merged commit 8358d96 into k8snetworkplumbingwg:master Aug 27, 2024
13 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.

4 participants