From ce9242e1808c2cbf83b827c6676f017273dc95a4 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Tue, 27 Feb 2018 04:47:16 +0100 Subject: [PATCH 1/2] network.dpdk: Add dpdk.service dep to ovs unit Signed-off-by: Alexandru Avadanii --- linux/network/dpdk.sls | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls index 4b73f7f1..1d469caf 100644 --- a/linux/network/dpdk.sls +++ b/linux/network/dpdk.sls @@ -41,6 +41,17 @@ openvswitch_dpdk_pkgs: - openvswitch-switch - bridge-utils +{# create drop-in dpdk dependency for openvswitch-switch (ovsdb-server) #} +/etc/systemd/system/openvswitch-switch.service.d/dpdk.conf: + file.managed: + - makedirs: true + - require: + - pkg: openvswitch_dpdk_pkgs + - contents: | + [Unit] + Requires=dpdk.service + After=dpdk.service + linux_network_dpdk_ovs_service: cmd.run: - name: "ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true" From f6f0109b8b96a088a4ba84e9511c271854b8b85a Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Tue, 27 Feb 2018 19:10:31 +0100 Subject: [PATCH 2/2] network.dpdk: Restart openvswitch-switch for dpdk Current state of distro packages systemd unit deps (extract): - dpdk.service wants network-pre.target; - network-pre.target wants openvswitch-nonetwork.service; - openvswitch-switch.service wants openvswitch-nonetwork.service, network.target; However, openvswitch-nonetwork requires ports to be bound already, handled by dpdk service. On system boot, since openvswitch-nonetwork starts before dpdk (succesfully, despite the binding issue), and the ulterior start of openvswitch-switch does not trigger a restart, the system is left in a slightly broken state, fixed by restarting either of the openvswitch-* services. To avoid another race condition leading to dead openvswitch-switch, restart the openvswitch-nonetwork service directly. Signed-off-by: Alexandru Avadanii --- linux/network/dpdk.sls | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls index 1d469caf..7ed2480a 100644 --- a/linux/network/dpdk.sls +++ b/linux/network/dpdk.sls @@ -52,6 +52,16 @@ openvswitch_dpdk_pkgs: Requires=dpdk.service After=dpdk.service +{# create drop-in dpdk post-start reload of openvswitch-nonetwork #} +/etc/systemd/system/dpdk.service.d/openvswitch-nonetwork.conf: + file.managed: + - makedirs: true + - require: + - pkg: openvswitch_dpdk_pkgs + - contents: | + [Service] + ExecStartPost=/bin/systemctl restart openvswitch-nonetwork + linux_network_dpdk_ovs_service: cmd.run: - name: "ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true"