From 039de2841b3e96421fe0b868b7c97825b2023a66 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 2 Jun 2017 19:12:54 -0700 Subject: mpm/mpmd: Allow SID increment; more fixes for multi-usrp operation --- mpm/python/usrp_mpm/periph_manager/n310.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mpm') diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index f49b6d052..7b43aec38 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -149,12 +149,14 @@ class n310(PeriphManagerBase): for ifname, table in iteritems(self._eth_dispatchers): table.set_ipv4_addr(self._chdr_interfaces[ifname]['ip_addr']) - def _allocate_sid(self, sender_addr, port, sid, xbar_src_addr, xbar_src_port): + def _allocate_sid(self, sender_addr, port, sid, xbar_src_addr, xbar_src_port, new_ep): """ Get the MAC address of the sender and store it in the FPGA ARP table """ mac_addr = get_mac_addr(sender_addr) - new_ep = self._available_endpoints.pop(0) + if new_ep not in self._available_endpoints: + raise RuntimeError("no more sids yo") + self._available_endpoints.remove(new_ep) if mac_addr is not None: if sender_addr not in self.sid_endpoints: self.sid_endpoints.update({sender_addr: (new_ep,)}) -- cgit v1.2.3