From 87dbcd9f1a5b2b464c27af56c3a91ab00f66c441 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 1 Dec 2017 16:14:11 -0800 Subject: mpmd: Refactor MPM transport architecture, use managers This splits up the transport code in mpmd_impl across multiple classes to properly leverage the request_xport/commit_xport API in MPM. Different types of transport (UDP, liberio) use their own distinct classes, which are generated dynamically on request. This is a true refactoring despite the large amount of changes; there are no functional differences. Reviewed-By: Brent Stapleton Reviewed-By: Trung Tran Reviewed-By: Ashish Chaudhari --- mpm/python/usrp_mpm/xports/xportmgr_udp.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mpm/python/usrp_mpm') diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index 0a7f19ffc..edd20a629 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -70,12 +70,19 @@ class XportMgrUDP(object): After calling this, _chdr_ifaces and _eth_dispatchers are in sync. """ + ifaces_to_remove = [ + x for x in self._eth_dispatchers.keys() + if x not in self._chdr_ifaces + ] + for iface in ifaces_to_remove: + self._eth_dispatchers.pop(iface) for iface in self._chdr_ifaces: if iface not in self._eth_dispatchers: self._eth_dispatchers[iface] = \ EthDispatcherTable(self.iface_config[iface]['label']) - for ifname, table in iteritems(self._eth_dispatchers): - table.set_ipv4_addr(self._chdr_ifaces[ifname]['ip_addr']) + self._eth_dispatchers[iface].set_ipv4_addr( + self._chdr_ifaces[iface]['ip_addr'] + ) def init(self, args): """ -- cgit v1.2.3