aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorkarthik s <ksundara@redhat.com>2017-02-15 18:03:14 +0530
committerSaravanan KR <skramaja@redhat.com>2017-03-01 00:20:13 +0530
commitab0e0d433fb363f6a01b7c8305771f2bde47930e (patch)
tree7bc11bd20efff6f3ab20cf5ff7a12f84fb0f1832 /os_net_config/impl_ifcfg.py
parent3a113c0c0c40b84efbc57b6f3681e63030ed1208 (diff)
Restart Openvswitch after adding DPDK ports
OvS needs to be restarted after adding a DPDK port. This change shall be removed on migration to OvS 2.7 where DPDK Hotplug support is available. Co-Authored-By: Saravanan KR <skramaja@redhat.com> Closes-Bug: #1668375 Signed-off-by: karthik s <ksundara@redhat.com> Change-Id: I250bb8e9a8e50874a82bf7f159e5a9d5677ef5ac
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 0a4f817..84a5139 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -694,6 +694,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
nfvswitch_interfaces = [] # nfvswitch physical interfaces
nfvswitch_internal_ifaces = [] # nfvswitch internal/management ports
stop_dhclient_interfaces = []
+ ovs_needs_restart = False
for interface_name, iface_data in self.interface_data.items():
route_data = self.route_data.get(interface_name, '')
@@ -719,6 +720,11 @@ class IfcfgNetConfig(os_net_config.NetConfig):
update_files[route6_path] = route6_data
if "BOOTPROTO=dhcp" not in iface_data:
stop_dhclient_interfaces.append(interface_name)
+ # Openvswitch needs to be restarted when OVSDPDKPort or
+ # OVSDPDKBond is added
+ if "OVSDPDK" in iface_data:
+ ovs_needs_restart = True
+
else:
logger.info('No changes required for interface: %s' %
interface_name)
@@ -926,6 +932,16 @@ class IfcfgNetConfig(os_net_config.NetConfig):
for oldname, newname in self.renamed_interfaces.items():
self.ifrename(oldname, newname)
+ # DPDK initialization is done before running os-net-config, to make
+ # the DPDK ports available when enabled. DPDK Hotplug support is
+ # supported only in OvS 2.7 version. Until then, OvS needs to be
+ # restarted after adding a DPDK port. This change will be removed on
+ # migration to OvS 2.7 where DPDK Hotplug support is available.
+ if ovs_needs_restart:
+ msg = "Restart openvswitch"
+ self.execute(msg, '/usr/bin/systemctl',
+ 'restart', 'openvswitch')
+
for location, data in update_files.items():
self.write_config(location, data)