diff options
author | michael-west <michael.west@ettus.com> | 2016-07-19 14:13:07 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-07-22 11:31:40 -0700 |
commit | 1824770f44318e272b7aedc89eb5a6317a558f73 (patch) | |
tree | 6b09f7c0337df05446ef8d6dfdfc77fa12e092e7 | |
parent | 4d88b797279aeb76fdf1f595c209123bc9361617 (diff) | |
download | uhd-1824770f44318e272b7aedc89eb5a6317a558f73.tar.gz uhd-1824770f44318e272b7aedc89eb5a6317a558f73.tar.bz2 uhd-1824770f44318e272b7aedc89eb5a6317a558f73.zip |
UHD: Fixes for super_recv_packet_hadler
- Make recv() return immediately on EOB
- In the timeout case, don't call the flow control hander if none exists
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 5ca18d4a0..b65d7c7aa 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -231,7 +231,7 @@ public: buffs, nsamps_per_buff, metadata, timeout ); - if (one_packet){ + if (one_packet or metadata.end_of_burst){ #ifdef UHD_TXRX_DEBUG_PRINTS dbg_gather_data(nsamps_per_buff, accum_num_samps, metadata, timeout, one_packet); #endif @@ -239,7 +239,9 @@ public: } //first recv had an error code set, return immediately - if (metadata.error_code != rx_metadata_t::ERROR_CODE_NONE) return accum_num_samps; + if (metadata.error_code != rx_metadata_t::ERROR_CODE_NONE) { + return accum_num_samps; + } //loop until buffer is filled or error code while(accum_num_samps < nsamps_per_buff){ @@ -253,10 +255,16 @@ public: _queue_error_for_next_call = true; break; } + accum_num_samps += num_samps; + + //return immediately if end of burst + if (_queue_metadata.end_of_burst) { + break; + } } #ifdef UHD_TXRX_DEBUG_PRINTS - dbg_gather_data(nsamps_per_buff, accum_num_samps, metadata, timeout, one_packet); + dbg_gather_data(nsamps_per_buff, accum_num_samps, metadata, timeout, one_packet); #endif return accum_num_samps; } @@ -573,6 +581,9 @@ private: case PACKET_TIMEOUT_ERROR: std::swap(curr_info, next_info); //save progress from curr -> next + if(_props[index].handle_flowctrl) { + _props[index].handle_flowctrl(next_info[index].ifpi.packet_count); + } curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_TIMEOUT; return; |