From 3bf4954a6b8a9eaaa1719f9563ea3cf4327075e1 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Wed, 10 Apr 2024 22:48:02 +0300 Subject: [PATCH] [neutron] Properly create ovs bridges in mappings for DPDK 1. Create bridges with datapath_type=netdev parameter so that neutron ovs-agent wouldn't recreate it dropping all the custom settings 2. Delete --no-wait flag to make sure a bridge/port was in fact created by ovs-vswitchd in order to prevent further commands from failing Change-Id: I3ad5b63a0813761a23573166c5024e17d87f775d --- neutron/Chart.yaml | 2 +- .../bin/_neutron-openvswitch-agent-init.sh.tpl | 10 +++++++--- releasenotes/notes/neutron.yaml | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/neutron/Chart.yaml b/neutron/Chart.yaml index 1f2cc0f086..b1d88659bd 100644 --- a/neutron/Chart.yaml +++ b/neutron/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Neutron name: neutron -version: 0.3.39 +version: 0.3.40 home: https://docs.openstack.org/neutron/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl index 1ee084bcd2..bd0a64ac81 100644 --- a/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl +++ b/neutron/templates/bin/_neutron-openvswitch-agent-init.sh.tpl @@ -427,12 +427,16 @@ for bmap in `sed 's/[{}"]//g' /tmp/auto_bridge_add | tr "," "\n"` do bridge=${bmap%:*} iface=${bmap#*:} - ovs-vsctl --no-wait --may-exist add-br $bridge + if [[ "${DPDK_ENABLED}" == "true" ]]; then + ovs-vsctl --db=unix:${OVS_SOCKET} --may-exist add-br $bridge -- set bridge $bridge datapath_type=netdev + else + ovs-vsctl --db=unix:${OVS_SOCKET} --may-exist add-br $bridge + fi if [ -n "$iface" ] && [ "$iface" != "null" ] && ( ip link show $iface 1>/dev/null 2>&1 ); then - ovs-vsctl --no-wait --may-exist add-port $bridge $iface + ovs-vsctl --db=unix:${OVS_SOCKET} --may-exist add-port $bridge $iface migrate_ip_from_nic $iface $bridge - if [[ $(get_dpdk_config_value ${DPDK_CONFIG} '.enabled') != "true" ]]; then + if [[ "${DPDK_ENABLED}" != "true" ]]; then ip link set dev $iface up fi fi diff --git a/releasenotes/notes/neutron.yaml b/releasenotes/notes/neutron.yaml index 3ce76ee5e3..dace2683c8 100644 --- a/releasenotes/notes/neutron.yaml +++ b/releasenotes/notes/neutron.yaml @@ -81,4 +81,5 @@ neutron: - 0.3.37 Proper chown /run/openvswitch/db.sock under OVN - 0.3.38 Add 2024.1 overrides - 0.3.39 Ensure that the script handles cases where the PID file exists but is empty or does not contain the expected data structure. + - 0.3.40 Fix ovs bridge creation in mappings for DPDK ...