aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/xports
diff options
context:
space:
mode:
authorSteven Koo <steven.koo@ni.com>2020-07-25 13:09:53 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-07-30 11:39:00 -0500
commit25a0e462ddc8ca737415dbae4feb90787e6a35b2 (patch)
tree2f4f7c57e57299e02a7e0f94e4ddb6ca1a6be6ee /mpm/python/usrp_mpm/xports
parent80b79df60380990744f59137d313b1dd1db9ca92 (diff)
downloaduhd-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/usrp_mpm/xports')
-rw-r--r--mpm/python/usrp_mpm/xports/xportmgr_udp.py8
1 files changed, 7 insertions, 1 deletions
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):