diff options
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.cpp | 1 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.hpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_xport.cpp | 3 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 5 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n310.py | 13 |
5 files changed, 14 insertions, 11 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index c44cc2040..911b57558 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -276,7 +276,6 @@ const std::string mpmd_impl::MPM_ECHO_CMD = "MPM-ECHO"; mpmd_impl::mpmd_impl(const device_addr_t& device_args) : usrp::device3_impl() , _device_args(device_args) - , _sid_framer(0) { UHD_LOGGER_INFO("MPMD") << "Initializing device with args: " << device_args.to_string(); diff --git a/host/lib/usrp/mpmd/mpmd_impl.hpp b/host/lib/usrp/mpmd/mpmd_impl.hpp index 7b81be0f6..fe98b0329 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.hpp +++ b/host/lib/usrp/mpmd/mpmd_impl.hpp @@ -219,9 +219,6 @@ public: //! A counter for distributing local addresses to crossbars // No-one touches this except allocate_xbar_local_addr(), gotcha? size_t _xbar_local_addr_ctr = 2; - - // TODO make sure this can't wrap - size_t _sid_framer; }; }} /* namespace uhd::mpmd */ diff --git a/host/lib/usrp/mpmd/mpmd_xport.cpp b/host/lib/usrp/mpmd/mpmd_xport.cpp index c21da3839..43d5d6e2b 100644 --- a/host/lib/usrp/mpmd/mpmd_xport.cpp +++ b/host/lib/usrp/mpmd/mpmd_xport.cpp @@ -49,8 +49,7 @@ both_xports_t mpmd_impl::make_transport( identify_mboard_by_xbar_addr(dst_address.get_dst_addr()); const sid_t sid( - 0, - _sid_framer++, // FIXME make sure we only increment if actually valid + 0, 0, // Not actually an address, more of an 'ignore me' value dst_address.get_dst_addr(), dst_address.get_dst_endpoint() ); diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index d1ae84df6..8acc21b90 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -135,7 +135,6 @@ class PeriphManagerBase(object): self.log = get_logger('PeriphManager') self.claimed = False self._init_args = {} - self._available_endpoints = list(range(256)) try: self._init_mboard_with_eeprom() self._init_mboard_overlays(self._eeprom_head, args) @@ -338,7 +337,6 @@ class PeriphManagerBase(object): for dboard in self.dboards: dboard.deinit() self.log.trace("Resetting SID pool...") - self._available_endpoints = list(range(256)) def tear_down(self): """ @@ -647,6 +645,9 @@ class PeriphManagerBase(object): - type: Type of transport, e.g., "UDP", "liberio". - ipv4 (UDP only): IPv4 address to connect to. - port (UDP only): IP port to connect to. + - send_sid: String version of the SID used for this transport. This is + the definitive version of the SID, the suggested_src_address + can be ignored at this point. - allocation: This is an integer value which represents a score of how much bandwidth is used. Note: Currently does not have any unit, is just a counter. Higher numbers mean diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index 135f5e290..4a7997d75 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -297,6 +297,7 @@ class n310(PeriphManagerBase): self._ext_clock_freq = None self._clock_source = None self._time_source = None + self._available_endpoints = list(range(256)) try: self._init_peripherals(args) self._device_initialized = True @@ -417,6 +418,7 @@ class n310(PeriphManagerBase): super(n310, self).deinit() for xport_mgr in itervalues(self._xport_mgrs): xport_mgr.deinit() + self._available_endpoints = list(range(256)) def tear_down(self): """ @@ -443,14 +445,19 @@ class n310(PeriphManagerBase): """ See PeriphManagerBase.request_xport() for docs. """ - # For now, we always accept the suggestion if available, or fail + # Try suggested address first, then just pick the first available one: src_address = suggested_src_address if src_address not in self._available_endpoints: - raise RuntimeError("no more sids yo") + if len(self._available_endpoints) == 0: + raise RuntimeError( + "Depleted pool of SID endpoints for this device!") + else: + src_address = self._available_endpoints[0] sid = SID(src_address << 16 | dst_address) + # Note: This SID may change its source address! self.log.debug( "request_xport(dst=0x%04X, suggested_src_address=0x%04X, xport_type=%s): " \ - "operating on SID: %s", + "operating on temporary SID: %s", dst_address, suggested_src_address, str(xport_type), str(sid)) # FIXME token! assert self.mboard_info['rpc_connection'] in ('remote', 'local') |