From c0dda7785f1d4ca5250c37bd3ca7dcc4c4a2bff8 Mon Sep 17 00:00:00 2001 From: Georg Kunz Date: Tue, 13 Aug 2019 13:07:01 +0200 Subject: [PATCH] Aligning OVS and Neutron configuration for DPDK This change aligns DPDK configuration parameters across the OVS and Neutron charts. Change-Id: I381286a49dfe65762cfb4a344e7bd178e42f10f6 --- .../bin/_openvswitch-vswitchd.sh.tpl | 26 ++++++++++--------- .../templates/daemonset-ovs-vswitchd.yaml | 12 ++++----- openvswitch/values.yaml | 11 ++++---- .../values_overrides/dpdk-opensuse_15.yaml | 18 +++++++++++++ .../values_overrides/dpdk-ubuntu_bionic.yaml | 18 +++++++++++++ ...ed-ovs-dpdk-root-key-f8aaf3ad65189c8a.yaml | 6 +++++ 6 files changed, 68 insertions(+), 23 deletions(-) create mode 100644 releasenotes/notes/changed-ovs-dpdk-root-key-f8aaf3ad65189c8a.yaml diff --git a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index 70151a1e1..f50cc4e4e 100644 --- a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -24,8 +24,10 @@ OVS_PID=/run/openvswitch/ovs-vswitchd.pid # Create vhostuser directory and grant nova user (default UID 42424) access # permissions. -mkdir -p /run/openvswitch/vhostuser -chown {{ .Values.pod.user.nova.uid }}.{{ .Values.pod.user.nova.uid }} /run/openvswitch/vhostuser +{{- if .Values.conf.ovs_dpdk.enabled }} +mkdir -p /run/openvswitch/{{ .Values.conf.ovs_dpdk.vhostuser_socket_dir }} +chown {{ .Values.pod.user.nova.uid }}.{{ .Values.pod.user.nova.uid }} /run/openvswitch/{{ .Values.conf.ovs_dpdk.vhostuser_socket_dir }} +{{- end }} function start () { t=0 @@ -41,23 +43,23 @@ function start () { ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait show -{{- if .Values.conf.dpdk.enabled }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-hugepage-dir={{ .Values.conf.dpdk.hugepages_mountpath | quote }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-socket-mem={{ .Values.conf.dpdk.socket_memory | quote }} +{{- if .Values.conf.ovs_dpdk.enabled }} + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-hugepage-dir={{ .Values.conf.ovs_dpdk.hugepages_mountpath | quote }} + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-socket-mem={{ .Values.conf.ovs_dpdk.socket_memory | quote }} -{{- if .Values.conf.dpdk.mem_channels }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-mem-channels={{ .Values.conf.dpdk.mem_channels | quote }} +{{- if .Values.conf.ovs_dpdk.mem_channels }} + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-mem-channels={{ .Values.conf.ovs_dpdk.mem_channels | quote }} {{- end }} -{{- if .Values.conf.dpdk.pmd_cpu_mask }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:pmd-cpu-mask={{ .Values.conf.dpdk.pmd_cpu_mask | quote }} +{{- if .Values.conf.ovs_dpdk.pmd_cpu_mask }} + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:pmd-cpu-mask={{ .Values.conf.ovs_dpdk.pmd_cpu_mask | quote }} {{- end }} -{{- if .Values.conf.dpdk.lcore_mask }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask={{ .Values.conf.dpdk.lcore_mask | quote }} +{{- if .Values.conf.ovs_dpdk.lcore_mask }} + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask={{ .Values.conf.ovs_dpdk.lcore_mask | quote }} {{- end }} - ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:vhost-sock-dir="vhostuser" + ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:vhost-sock-dir={{ .Values.conf.ovs_dpdk.vhostuser_socket_dir | quote }} ovs-vsctl --db=unix:${OVS_SOCKET} --no-wait set Open_vSwitch . other_config:dpdk-init=true {{- end }} diff --git a/openvswitch/templates/daemonset-ovs-vswitchd.yaml b/openvswitch/templates/daemonset-ovs-vswitchd.yaml index c98019897..529445a78 100644 --- a/openvswitch/templates/daemonset-ovs-vswitchd.yaml +++ b/openvswitch/templates/daemonset-ovs-vswitchd.yaml @@ -82,14 +82,14 @@ spec: readOnly: true containers: - name: openvswitch-vswitchd -{{- if .Values.conf.dpdk.enabled }} +{{- if .Values.conf.ovs_dpdk.enabled }} {{/* Run the container in priviledged mode due to the need for root permissions when using the uio_pci_generic driver. */}} {{- $_ := set $envAll.Values.pod.security_context.openvswitch_vswitchd.container.vswitchd "privileged" true -}} {{- end }} {{ tuple $envAll "openvswitch_vswitchd" | include "helm-toolkit.snippets.image" | indent 10 }} {{ dict "envAll" $envAll "application" "openvswitch_vswitchd" "container" "vswitchd" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} -{{- if .Values.conf.dpdk.enabled }} +{{- if .Values.conf.ovs_dpdk.enabled }} {{/* When running with DPDK, we need to specify the type and amount of hugepages. The following line enables resource handling in general, but the type and amount of hugepages must still be defined in the values.yaml.*/}} @@ -118,9 +118,9 @@ of hugepages must still be defined in the values.yaml.*/}} readOnly: true - name: run mountPath: /run -{{- if .Values.conf.dpdk.enabled }} +{{- if .Values.conf.ovs_dpdk.enabled }} - name: hugepages - mountPath: {{ .Values.conf.dpdk.hugepages_mountpath | quote }} + mountPath: {{ .Values.conf.ovs_dpdk.hugepages_mountpath | quote }} - name: pci-devices mountPath: /sys/bus/pci/devices - name: huge-pages-kernel @@ -149,7 +149,7 @@ of hugepages must still be defined in the values.yaml.*/}} hostPath: path: / type: Directory -{{- if .Values.conf.dpdk.enabled }} +{{- if .Values.conf.ovs_dpdk.enabled }} - name: devs hostPath: path: /dev @@ -176,7 +176,7 @@ of hugepages must still be defined in the values.yaml.*/}} type: Directory - name: hugepages hostPath: - path: {{ .Values.conf.dpdk.hugepages_mountpath | quote }} + path: {{ .Values.conf.ovs_dpdk.hugepages_mountpath | quote }} type: Directory {{- end }} {{- end }} diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml index a2b20a2de..54f9b8d7c 100644 --- a/openvswitch/values.yaml +++ b/openvswitch/values.yaml @@ -188,12 +188,13 @@ manifests: conf: openvswitch_db_server: ptcp_port: null - dpdk: + ovs_dpdk: enabled: false - socket_memory: 1024 - hugepages_mountpath: /dev/hugepages - # optional parameters for tuning the OVS config - # in alignment with the available hardware resources + ## Mandatory parameters. Please uncomment when enabling DPDK + # socket_memory: 1024 + # hugepages_mountpath: /dev/hugepages + # vhostuser_socket_dir: vhostuser + ## Optional hardware specific parameters: modify to match NUMA topology # mem_channels: 4 # lcore_mask: 0x1 # pmd_cpu_mask: 0x4 diff --git a/openvswitch/values_overrides/dpdk-opensuse_15.yaml b/openvswitch/values_overrides/dpdk-opensuse_15.yaml index b2bcd4901..7fc31d9ae 100644 --- a/openvswitch/values_overrides/dpdk-opensuse_15.yaml +++ b/openvswitch/values_overrides/dpdk-opensuse_15.yaml @@ -3,3 +3,21 @@ images: tags: openvswitch_db_server: docker.io/openstackhelm/openvswitch:latest-opensuse_15-dpdk openvswitch_vswitchd: docker.io/openstackhelm/openvswitch:latest-opensuse_15-dpdk +pod: + resources: + enabled: true + ovs: + vswitchd: + requests: + memory: "2Gi" + cpu: "2" + limits: + memory: "2Gi" + cpu: "2" + hugepages-1Gi: "1Gi" +conf: + ovs_dpdk: + enabled: true + hugepages_mountpath: /dev/hugepages + vhostuser_socket_dir: vhostuser + socket_memory: 1024 diff --git a/openvswitch/values_overrides/dpdk-ubuntu_bionic.yaml b/openvswitch/values_overrides/dpdk-ubuntu_bionic.yaml index 3d5457816..3c5a69ed9 100644 --- a/openvswitch/values_overrides/dpdk-ubuntu_bionic.yaml +++ b/openvswitch/values_overrides/dpdk-ubuntu_bionic.yaml @@ -3,3 +3,21 @@ images: tags: openvswitch_db_server: docker.io/openstackhelm/openvswitch:latest-ubuntu_bionic-dpdk openvswitch_vswitchd: docker.io/openstackhelm/openvswitch:latest-ubuntu_bionic-dpdk +pod: + resources: + enabled: true + ovs: + vswitchd: + requests: + memory: "2Gi" + cpu: "2" + limits: + memory: "2Gi" + cpu: "2" + hugepages-1Gi: "1Gi" +conf: + ovs_dpdk: + enabled: true + hugepages_mountpath: /dev/hugepages + vhostuser_socket_dir: vhostuser + socket_memory: 1024 diff --git a/releasenotes/notes/changed-ovs-dpdk-root-key-f8aaf3ad65189c8a.yaml b/releasenotes/notes/changed-ovs-dpdk-root-key-f8aaf3ad65189c8a.yaml new file mode 100644 index 000000000..d4580f37c --- /dev/null +++ b/releasenotes/notes/changed-ovs-dpdk-root-key-f8aaf3ad65189c8a.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + The root configuration key of the DPDK section has been changed from + "dpdk" to "ovs_dpdk" to achieve parity with the corresponding configuration + key in the Neutron chart.