Aligning OVS and Neutron configuration for DPDK

This change aligns DPDK configuration parameters across the OVS and Neutron
charts.

Change-Id: I381286a49dfe65762cfb4a344e7bd178e42f10f6
This commit is contained in:
Georg Kunz 2019-08-13 13:07:01 +02:00 committed by Deepak
parent 49c8c744ac
commit c0dda7785f
6 changed files with 68 additions and 23 deletions

View File

@ -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 }}

View File

@ -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 }}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.