diff options
author | Steven Koo <steven.koo@ni.com> | 2020-07-25 13:09:53 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-30 11:39:00 -0500 |
commit | 25a0e462ddc8ca737415dbae4feb90787e6a35b2 (patch) | |
tree | 2f4f7c57e57299e02a7e0f94e4ddb6ca1a6be6ee /mpm/python | |
parent | 80b79df60380990744f59137d313b1dd1db9ca92 (diff) | |
download | uhd-25a0e462ddc8ca737415dbae4feb90787e6a35b2.tar.gz uhd-25a0e462ddc8ca737415dbae4feb90787e6a35b2.tar.bz2 uhd-25a0e462ddc8ca737415dbae4feb90787e6a35b2.zip |
mpm: Default virtual NIC CHDR IP selection
This change adds detection for setting the correct internal
fpga CHDR IP address when using embedded mode.
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/e31x.py | 6 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/e320.py | 6 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n3xx.py | 6 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_udp.py | 8 |
4 files changed, 22 insertions, 4 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/e31x.py b/mpm/python/usrp_mpm/periph_manager/e31x.py index 11f65dd17..025f8b222 100644 --- a/mpm/python/usrp_mpm/periph_manager/e31x.py +++ b/mpm/python/usrp_mpm/periph_manager/e31x.py @@ -524,7 +524,11 @@ class e31x(ZynqComponents, PeriphManagerBase): self.log.warning("Can't get link options for unknown link type: `{}'." .format(xport_type)) return [] - return self._xport_mgrs[xport_type].get_chdr_link_options() + if xport_type == "udp": + return self._xport_mgrs[xport_type].get_chdr_link_options( + self.mboard_info['rpc_connection']) + else: + return self._xport_mgrs[xport_type].get_chdr_link_options() ########################################################################### # Device info diff --git a/mpm/python/usrp_mpm/periph_manager/e320.py b/mpm/python/usrp_mpm/periph_manager/e320.py index 770b449b5..f8b17df7f 100644 --- a/mpm/python/usrp_mpm/periph_manager/e320.py +++ b/mpm/python/usrp_mpm/periph_manager/e320.py @@ -399,7 +399,11 @@ class e320(ZynqComponents, PeriphManagerBase): self.log.warning("Can't get link options for unknown link type: `{}'." .format(xport_type)) return [] - return self._xport_mgrs[xport_type].get_chdr_link_options() + if xport_type == "udp": + return self._xport_mgrs[xport_type].get_chdr_link_options( + self.mboard_info['rpc_connection']) + else: + return self._xport_mgrs[xport_type].get_chdr_link_options() ########################################################################### # Device info diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index 7a9f61df7..4e9406c81 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -519,7 +519,11 @@ class n3xx(ZynqComponents, PeriphManagerBase): if xport_type not in self._xport_mgrs: self.log.warning("Can't get link options for unknown link type: `{}'.".format(xport_type)) return [] - return self._xport_mgrs[xport_type].get_chdr_link_options() + if xport_type == "udp": + return self._xport_mgrs[xport_type].get_chdr_link_options( + self.mboard_info['rpc_connection']) + else: + return self._xport_mgrs[xport_type].get_chdr_link_options() ########################################################################### # Device info diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index 65228e5da..28c50688a 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -178,7 +178,7 @@ class XportMgrUDP: (x['ip_addr'] for x in itervalues(available_interfaces)) )) - def get_chdr_link_options(self): + def get_chdr_link_options(self, host_location = 'all'): """ Returns a list of dictionaries for returning by PeriphManagerBase.get_chdr_link_options(). @@ -186,6 +186,8 @@ class XportMgrUDP: Note: This requires a claim, which means that init() was called, and deinit() was not yet called. """ + assert host_location in ('remote', 'local', 'all') + return [ { 'ipv4': str(iface_info['ip_addr']) if (self.iface_config[iface_name]['type'] != 'internal') @@ -196,6 +198,10 @@ class XportMgrUDP: 'mtu': str(iface_info['mtu']) } for iface_name, iface_info in iteritems(self._chdr_ifaces) + if((self.iface_config[iface_name]['type'] == 'internal' and host_location == 'local') or + (self.iface_config[iface_name]['type'] != 'internal' and self.iface_config[iface_name]['type'] != 'forward' + and host_location == 'remote') or + host_location == 'all') ] def _setup_forwarding(self, iface): |