diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-12-14 16:04:22 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:59 -0800 |
commit | 77dd58640c84315fe257daee30113e5c6f405f28 (patch) | |
tree | 08302e3cee946110363687fd786669b63955206f /mpm/python/usrp_mpm | |
parent | 8b700c7e0825fa23959748dd37f65e59aa1bda03 (diff) | |
download | uhd-77dd58640c84315fe257daee30113e5c6f405f28.tar.gz uhd-77dd58640c84315fe257daee30113e5c6f405f28.tar.bz2 uhd-77dd58640c84315fe257daee30113e5c6f405f28.zip |
mpm: udp xport: Bind SID addr 0 and 1 to respective SFP ports
Reviewed-by: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n310.py | 4 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_udp.py | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index 042cedd2e..6e48d8f60 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -200,6 +200,7 @@ class FP_GPIO(object): # Transport managers ############################################################################### class N310XportMgrUDP(XportMgrUDP): + " N310-specific UDP configuration " eth_tables = {'eth1': 'misc-enet-regs0', 'eth2': 'misc-enet-regs1'} xbar_port_map = {'eth1': 0, 'eth2': 1} xbar_dev = "/dev/crossbar0" @@ -208,15 +209,18 @@ class N310XportMgrUDP(XportMgrUDP): 'label': 'misc-enet-regs0', 'xbar': 0, 'xbar_port': 0, + 'ctrl_src_addr': 0, }, 'eth2': { 'label': 'misc-enet-regs1', 'xbar': 0, 'xbar_port': 1, + 'ctrl_src_addr': 1, }, } class N310XportMgrLiberio(XportMgrLiberio): + " N310-specific Liberio configuration " max_chan = 10 xbar_dev = "/dev/crossbar0" xbar_port = 2 diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index 9ae76a610..9e1c1d40a 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -28,6 +28,10 @@ class XportMgrUDP(object): # }, # } iface_config = {} + # The control addresses are typically addresses bound to the controlling + # UHD session. When the requested source address is below or equal to this + # number, we override requested SID source addresses based on other logic. + max_ctrl_addr = 1 def __init__(self, log): assert len(self.iface_config) @@ -170,6 +174,11 @@ class XportMgrUDP(object): """ Return UDP xport info """ + def fixup_sid(sid, iface_name): + " Modify the source SID (e.g. the UHD SID) " + if sid.src_addr <= self.max_ctrl_addr: + sid.src_addr = self.iface_config[iface_name]['ctrl_src_addr'] + return sid assert xport_type in ('CTRL', 'ASYNC_MSG', 'TX_DATA', 'RX_DATA') allocation_getter = lambda iface: { 'CTRL': 0, @@ -182,11 +191,11 @@ class XportMgrUDP(object): 'type': 'UDP', 'ipv4': str(iface_info['ip_addr']), 'port': str(self.chdr_port), - 'send_sid': str(sid), + 'send_sid': str(fixup_sid(sid, iface_name)), 'allocation': str(allocation_getter(iface_name)), 'xport_type': xport_type, } - for _, iface_info in iteritems(self._chdr_ifaces) + for iface_name, iface_info in iteritems(self._chdr_ifaces) ] return xport_info |