aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-15 17:40:48 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:59 -0800
commitf45e3c3df0c936c0fb0e8dda4f3a3e7f06bc0627 (patch)
treeb77e00b8cce3e190401ecd4bb4dc00c70d3e5637 /mpm/python
parent77dd58640c84315fe257daee30113e5c6f405f28 (diff)
downloaduhd-f45e3c3df0c936c0fb0e8dda4f3a3e7f06bc0627.tar.gz
uhd-f45e3c3df0c936c0fb0e8dda4f3a3e7f06bc0627.tar.bz2
uhd-f45e3c3df0c936c0fb0e8dda4f3a3e7f06bc0627.zip
mpm: xports: Sort requested transport options by QoS
Reviewed-by: Trung Tran <trung.tran@ettus.com>
Diffstat (limited to 'mpm/python')
-rw-r--r--mpm/python/usrp_mpm/xports/xportmgr_udp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py
index 9e1c1d40a..dd783e132 100644
--- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py
+++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py
@@ -186,7 +186,7 @@ class XportMgrUDP(object):
'RX_DATA': self._allocations.get(iface, {}).get('rx', 0),
'TX_DATA': self._allocations.get(iface, {}).get('tx', 0),
}[xport_type]
- xport_info = [
+ xport_info = sorted([
{
'type': 'UDP',
'ipv4': str(iface_info['ip_addr']),
@@ -196,7 +196,7 @@ class XportMgrUDP(object):
'xport_type': xport_type,
}
for iface_name, iface_info in iteritems(self._chdr_ifaces)
- ]
+ ], key=lambda x: int(x['allocation']), reverse=False)
return xport_info
def commit_xport(self, sid, xport_info):
@@ -231,11 +231,11 @@ class XportMgrUDP(object):
sid.reversed(), sender_addr, sender_port)
self.log.trace("UDP transport successfully committed!")
if xport_info.get('xport_type') == 'TX_DATA':
- self._allocations[eth_iface]['tx'] = \
- self._allocations.get(eth_iface, {}).get('tx', 0) + 1
+ self._allocations[eth_iface] = \
+ {'tx': self._allocations.get(eth_iface, {}).get('tx', 0) + 1}
if xport_info.get('xport_type') == 'RX_DATA':
- self._allocations[eth_iface]['rx'] = \
- self._allocations.get(eth_iface, {}).get('rx', 0) + 1
+ self._allocations[eth_iface] = \
+ {'rx': self._allocations.get(eth_iface, {}).get('rx', 0) + 1}
self.log.trace(
"New link allocations for %s: TX: %d RX: %d",
eth_iface,