Remove ovs from dpdk bridge config
This partially reverts commit f4d2d7ddce4297ffb65d78c151c2ab12c4443f74
OVS in config file leads to errors with dpdk bridge setup after
reboot and eventually to dpdk bridge absence.
Error is like: "ifup@br\x2dprv.service: Unit is bound to
inactive unit sys-subsystem-net-devices-br\x2dprv.device. Stopping, too."
The patch is also fixing success criteria for bridge creation to
avoid false positive when some ports have similar names.
Change-Id: I939b649542c79f49a8136e89fec5803db7d4c7da
Related-Prod: PROD-25241
Related-Prod: PROD-25269
(cherry picked from commit fdbdecfabb6af00849acb06efe254e22f4679a2a)
diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
index 7cc4102..c400831 100644
--- a/linux/network/dpdk.sls
+++ b/linux/network/dpdk.sls
@@ -141,7 +141,45 @@
linux_network_dpdk_bridge_interface_{{ interface_name }}:
cmd.run:
- name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-br {{ interface_name }} -- set bridge {{ interface_name }} datapath_type=netdev{% if interface.tag is defined %} -- set port {{ interface_name }} tag={{ interface.tag }}{% endif %}"
- - unless: "ovs-vsctl show | grep {{ interface_name }}"
+ - unless: 'ovs-vsctl show | grep "Bridge {{ interface_name }}"'
+
+ {# OVS dpdk needs ip address for vxlan termination on bridge br-prv #}
+ {%- if interface.address is defined %}
+
+{# create override for openvswitch dependency for dpdk br-prv #}
+/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
+ file.managed:
+ - makedirs: true
+ - require:
+ - cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
+ - contents: |
+ [Unit]
+ Requires=openvswitch-switch.service
+ After=openvswitch-switch.service
+
+{# enforce ip address and mtu for ovs dpdk br-prv #}
+dpdk_ovs_bridge_{{ interface_name }}:
+ file.managed:
+ - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
+ - contents: |
+ auto {{ interface_name }}
+ iface {{ interface_name }} inet static
+ address {{ interface.address }}
+ netmask {{ interface.netmask }}
+ {%- if interface.mtu is defined %}
+ mtu {{ interface.mtu }}
+ {%- endif %}
+ - makedirs: True
+ - require:
+ - file: /etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf
+
+dpdk_ovs_bridge_up_{{ interface_name }}:
+ cmd.run:
+ - name: ifup {{ interface_name }}
+ - require:
+ - file: dpdk_ovs_bridge_{{ interface_name }}
+
+ {%- endif %}
{%- elif interface.type == 'dpdk_ovs_port' and interface.bridge is defined %}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 6086957..bc1685e 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -79,43 +79,6 @@
- name: ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-port {{ interface_name }} {{ int_name }}
{%- endif %}
{%- endfor %}
-
-linux_interfaces_include_{{ interface_name }}:
- file.prepend:
- - name: /etc/network/interfaces
- - text: |
- source /etc/network/interfaces.d/*
- # Workaround for Upstream-Bug: https://github.com/saltstack/salt/issues/40262
- source /etc/network/interfaces.u/*
-
-{# create override for openvswitch dependency for dpdk br-prv #}
-/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
- file.managed:
- - makedirs: true
- - require:
- - cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
- - contents: |
- [Unit]
- Requires=openvswitch-switch.service
- After=openvswitch-switch.service
-
-dpdk_ovs_bridge_{{ interface_name }}:
- file.managed:
- - name: /etc/network/interfaces.u/ifcfg-{{ interface_name }}
- - makedirs: True
- - source: salt://linux/files/ovs_bridge
- - defaults:
- bridge: {{ interface|yaml }}
- bridge_name: {{ interface_name }}
- - template: jinja
-
-dpdk_ovs_bridge_up_{{ interface_name }}:
- cmd.run:
- - name: ifup {{ interface_name }}
- - require:
- - file: dpdk_ovs_bridge_{{ interface_name }}
- - file: linux_interfaces_final_include
-
{%- endif %}
{# it is not used for any interface with type preffix dpdk,eg. dpdk_ovs_port #}