From 6e8b0ec413ad816d88bcb09a24afacb99e145e9e Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Thu, 24 Jan 2019 14:45:12 -0800 Subject: mpm: Parameterize max UDP link allocation Add an argument to the UDP xport_mgr to adjust the xport sorting. This enables Rhodium to use a different limit from Magnesium. Previously, the sorting method would overload a link with both of Rhodium's higher-rate streams. --- mpm/python/usrp_mpm/periph_manager/n3xx.py | 5 +++++ mpm/python/usrp_mpm/xports/xportmgr_udp.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'mpm/python/usrp_mpm') diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index 64ccb48da..b018d055e 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -507,9 +507,14 @@ class n3xx(ZynqComponents, PeriphManagerBase): # FIXME token! assert self.device_info['rpc_connection'] in ('remote', 'local') if self.device_info['rpc_connection'] == 'remote': + if self.device_info['product'] == 'n320': + alloc_limit = 1 + else: + alloc_limit = 2 return self._xport_mgrs['udp'].request_xport( sid, xport_type, + alloc_limit ) elif self.device_info['rpc_connection'] == 'local': return self._xport_mgrs['liberio'].request_xport( diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index 0404a5b69..c5d97a42a 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -239,6 +239,7 @@ class XportMgrUDP(object): self, sid, xport_type, + alloc_limit=2 ): """ Return UDP xport info @@ -267,7 +268,7 @@ class XportMgrUDP(object): if src_addr in self._previous_block_ep: prev_block = self._previous_block_ep[src_addr] allocation = int(xport['allocation']) - if allocation >= 2: + if allocation >= alloc_limit: return allocation else: return allocation if prev_block != sid.get_dst_block() else -1; -- cgit v1.2.3