Skip to content

Commit 5998f48

Browse files
committed
Make ovs-vswitchd service 'other_config' option configurable
Signed-off-by: Ivan Kolodiazhnyi <[email protected]>
1 parent 0a5260b commit 5998f48

30 files changed

+366
-337
lines changed

api/v1/sriovnetworknodepolicy_types.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ type OVSUplinkConfig struct {
115115
Interface OVSInterfaceConfig `json:"interface,omitempty"`
116116
}
117117

118+
type OvsOtherConfig map[string]string
119+
118120
// OVSInterfaceConfig contains some options from the Interface table of the OVSDB for PF
119121
type OVSInterfaceConfig struct {
120122
// type field in the Interface table in OVSDB
@@ -124,7 +126,7 @@ type OVSInterfaceConfig struct {
124126
// external_ids field in the Interface table in OVSDB
125127
ExternalIDs map[string]string `json:"externalIDs,omitempty"`
126128
// other_config field in the Interface table in OVSDB
127-
OtherConfig map[string]string `json:"otherConfig,omitempty"`
129+
OtherConfig OvsOtherConfig `json:"otherConfig,omitempty"`
128130
}
129131

130132
// SriovNetworkNodePolicyStatus defines the observed state of SriovNetworkNodePolicy

api/v1/sriovnetworknodestate_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ type System struct {
119119
// +kubebuilder:validation:Enum=shared;exclusive
120120
//RDMA subsystem. Allowed value "shared", "exclusive".
121121
RdmaMode string `json:"rdmaMode,omitempty"`
122+
// OVS config. It will be provided for ovs-vswitchd service as other_config option
123+
// +kubebuilder:default:={hw-offload=: "true"}
124+
OvsConfig OvsOtherConfig `json:"ovsConfig,omitempty"`
122125
}
123126

124127
// SriovNetworkNodeStateStatus defines the observed state of SriovNetworkNodeState

api/v1/sriovnetworkpoolconfig_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ type OvsHardwareOffloadConfig struct {
3434
// On OpenShift:
3535
// Name is the name of MachineConfigPool to be enabled with OVS hardware offload
3636
Name string `json:"name,omitempty"`
37+
// OVS config. It will be provided for ovs-vswitchd service as other_config option
38+
// +kubebuilder:default:={hw-offload=: "true"}
39+
OvsConfig OvsOtherConfig `json:"otherConfig,omitempty"`
3740
}
3841

3942
// SriovNetworkPoolConfigStatus defines the observed state of SriovNetworkPoolConfig

api/v1/zz_generated.deepcopy.go

+40-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindata/manifests/switchdev-config/ovs-units/ovs-vswitchd.service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dropins:
33
- name: 10-hw-offload.conf
44
contents: |
55
[Service]
6-
ExecStartPre=/bin/ovs-vsctl --no-wait set Open_vSwitch . other_config:hw-offload=true
6+
ExecStartPre=/bin/ovs-vsctl --no-wait set Open_vSwitch . {{ .OtherOvsConfig }}

config/crd/bases/sriovnetwork.openshift.io_ovsnetworks.yaml

+12-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.9.0
7+
creationTimestamp: null
78
name: ovsnetworks.sriovnetwork.openshift.io
89
spec:
910
group: sriovnetwork.openshift.io
@@ -20,34 +21,27 @@ spec:
2021
description: OVSNetwork is the Schema for the ovsnetworks API
2122
properties:
2223
apiVersion:
23-
description: |-
24-
APIVersion defines the versioned schema of this representation of an object.
25-
Servers should convert recognized schemas to the latest internal value, and
26-
may reject unrecognized values.
27-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2827
type: string
2928
kind:
30-
description: |-
31-
Kind is a string value representing the REST resource this object represents.
32-
Servers may infer this from the endpoint the client submits requests to.
33-
Cannot be updated.
34-
In CamelCase.
35-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
29+
description: 'Kind is a string value representing the REST resource this
30+
object represents. Servers may infer this from the endpoint the client
31+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
3632
type: string
3733
metadata:
3834
type: object
3935
spec:
4036
description: OVSNetworkSpec defines the desired state of OVSNetwork
4137
properties:
4238
bridge:
43-
description: |-
44-
name of the OVS bridge, if not set OVS will automatically select bridge
45-
based on VF PCI address
39+
description: name of the OVS bridge, if not set OVS will automatically
40+
select bridge based on VF PCI address
4641
type: string
4742
capabilities:
48-
description: |-
49-
Capabilities to be configured for this network.
50-
Capabilities supported: (mac|ips), e.g. '{"mac": true}'
43+
description: 'Capabilities to be configured for this network. Capabilities
44+
supported: (mac|ips), e.g. ''{"mac": true}'''
5145
type: string
5246
interfaceType:
5347
description: The type of interface on ovs.

config/crd/bases/sriovnetwork.openshift.io_sriovibnetworks.yaml

+12-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.9.0
7+
creationTimestamp: null
78
name: sriovibnetworks.sriovnetwork.openshift.io
89
spec:
910
group: sriovnetwork.openshift.io
@@ -20,29 +21,23 @@ spec:
2021
description: SriovIBNetwork is the Schema for the sriovibnetworks API
2122
properties:
2223
apiVersion:
23-
description: |-
24-
APIVersion defines the versioned schema of this representation of an object.
25-
Servers should convert recognized schemas to the latest internal value, and
26-
may reject unrecognized values.
27-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
24+
description: 'APIVersion defines the versioned schema of this representation
25+
of an object. Servers should convert recognized schemas to the latest
26+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2827
type: string
2928
kind:
30-
description: |-
31-
Kind is a string value representing the REST resource this object represents.
32-
Servers may infer this from the endpoint the client submits requests to.
33-
Cannot be updated.
34-
In CamelCase.
35-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
29+
description: 'Kind is a string value representing the REST resource this
30+
object represents. Servers may infer this from the endpoint the client
31+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
3632
type: string
3733
metadata:
3834
type: object
3935
spec:
4036
description: SriovIBNetworkSpec defines the desired state of SriovIBNetwork
4137
properties:
4238
capabilities:
43-
description: |-
44-
Capabilities to be configured for this network.
45-
Capabilities supported: (infinibandGUID), e.g. '{"infinibandGUID": true}'
39+
description: 'Capabilities to be configured for this network. Capabilities
40+
supported: (infinibandGUID), e.g. ''{"infinibandGUID": true}'''
4641
type: string
4742
ipam:
4843
description: IPAM configuration to be used for this network.
@@ -55,9 +50,8 @@ spec:
5550
- disable
5651
type: string
5752
metaPlugins:
58-
description: |-
59-
MetaPluginsConfig configuration to be used in order to chain metaplugins to the sriov interface returned
60-
by the operator.
53+
description: MetaPluginsConfig configuration to be used in order to
54+
chain metaplugins to the sriov interface returned by the operator.
6155
type: string
6256
networkNamespace:
6357
description: Namespace of the NetworkAttachmentDefinition custom resource

config/crd/bases/sriovnetwork.openshift.io_sriovnetworknodepolicies.yaml

+10-15
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.9.0
7+
creationTimestamp: null
78
name: sriovnetworknodepolicies.sriovnetwork.openshift.io
89
spec:
910
group: sriovnetwork.openshift.io
@@ -21,29 +22,23 @@ spec:
2122
API
2223
properties:
2324
apiVersion:
24-
description: |-
25-
APIVersion defines the versioned schema of this representation of an object.
26-
Servers should convert recognized schemas to the latest internal value, and
27-
may reject unrecognized values.
28-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
25+
description: 'APIVersion defines the versioned schema of this representation
26+
of an object. Servers should convert recognized schemas to the latest
27+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2928
type: string
3029
kind:
31-
description: |-
32-
Kind is a string value representing the REST resource this object represents.
33-
Servers may infer this from the endpoint the client submits requests to.
34-
Cannot be updated.
35-
In CamelCase.
36-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
30+
description: 'Kind is a string value representing the REST resource this
31+
object represents. Servers may infer this from the endpoint the client
32+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
3733
type: string
3834
metadata:
3935
type: object
4036
spec:
4137
description: SriovNetworkNodePolicySpec defines the desired state of SriovNetworkNodePolicy
4238
properties:
4339
bridge:
44-
description: |-
45-
contains bridge configuration for matching PFs,
46-
valid only for eSwitchMode==switchdev
40+
description: contains bridge configuration for matching PFs, valid
41+
only for eSwitchMode==switchdev
4742
properties:
4843
ovs:
4944
description: contains configuration for the OVS bridge,

config/crd/bases/sriovnetwork.openshift.io_sriovnetworknodestates.yaml

+28-18
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.9.0
7+
creationTimestamp: null
78
name: sriovnetworknodestates.sriovnetwork.openshift.io
89
spec:
910
group: sriovnetwork.openshift.io
@@ -34,19 +35,14 @@ spec:
3435
API
3536
properties:
3637
apiVersion:
37-
description: |-
38-
APIVersion defines the versioned schema of this representation of an object.
39-
Servers should convert recognized schemas to the latest internal value, and
40-
may reject unrecognized values.
41-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
38+
description: 'APIVersion defines the versioned schema of this representation
39+
of an object. Servers should convert recognized schemas to the latest
40+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
4241
type: string
4342
kind:
44-
description: |-
45-
Kind is a string value representing the REST resource this object represents.
46-
Servers may infer this from the endpoint the client submits requests to.
47-
Cannot be updated.
48-
In CamelCase.
49-
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
43+
description: 'Kind is a string value representing the REST resource this
44+
object represents. Servers may infer this from the endpoint the client
45+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
5046
type: string
5147
metadata:
5248
type: object
@@ -85,9 +81,8 @@ spec:
8581
description: name of the bridge
8682
type: string
8783
uplinks:
88-
description: |-
89-
uplink-level bridge configuration for each uplink(PF).
90-
currently must contain only one element
84+
description: uplink-level bridge configuration for each
85+
uplink(PF). currently must contain only one element
9186
items:
9287
description: OVSUplinkConfigExt contains configuration
9388
for the concrete OVS uplink(PF)
@@ -176,6 +171,14 @@ spec:
176171
type: array
177172
system:
178173
properties:
174+
ovsConfig:
175+
additionalProperties:
176+
type: string
177+
default:
178+
hw-offload=: "true"
179+
description: OVS config. It will be provided for ovs-vswitchd
180+
service as other_config option
181+
type: object
179182
rdmaMode:
180183
description: RDMA subsystem. Allowed value "shared", "exclusive".
181184
enum:
@@ -220,9 +223,8 @@ spec:
220223
description: name of the bridge
221224
type: string
222225
uplinks:
223-
description: |-
224-
uplink-level bridge configuration for each uplink(PF).
225-
currently must contain only one element
226+
description: uplink-level bridge configuration for each
227+
uplink(PF). currently must contain only one element
226228
items:
227229
description: OVSUplinkConfigExt contains configuration
228230
for the concrete OVS uplink(PF)
@@ -346,6 +348,14 @@ spec:
346348
type: string
347349
system:
348350
properties:
351+
ovsConfig:
352+
additionalProperties:
353+
type: string
354+
default:
355+
hw-offload=: "true"
356+
description: OVS config. It will be provided for ovs-vswitchd
357+
service as other_config option
358+
type: object
349359
rdmaMode:
350360
description: RDMA subsystem. Allowed value "shared", "exclusive".
351361
enum:

0 commit comments

Comments
 (0)