From 98209df92ea2a6abf6ed41af03bc3909b8e152b9 Mon Sep 17 00:00:00 2001 From: Ciro Nishiguchi Date: Tue, 27 Aug 2019 16:19:15 -0500 Subject: streamer: Add option to ignore sequence errors Add template parameter to ignore sequence errors, used for testing. --- host/lib/include/uhdlib/transport/get_aligned_buffs.hpp | 5 +++-- host/lib/include/uhdlib/transport/rx_streamer_impl.hpp | 4 ++-- host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/host/lib/include/uhdlib/transport/get_aligned_buffs.hpp b/host/lib/include/uhdlib/transport/get_aligned_buffs.hpp index 662be6d2d..d0f5682ca 100644 --- a/host/lib/include/uhdlib/transport/get_aligned_buffs.hpp +++ b/host/lib/include/uhdlib/transport/get_aligned_buffs.hpp @@ -27,7 +27,7 @@ constexpr size_t ALIGNMENT_FAILURE_THRESHOLD = 1000; * match those of other channels due to dropped packets. Packets that do not * have a tsf are not checked for alignment and never dropped. */ -template +template class get_aligned_buffs { public: @@ -144,7 +144,8 @@ public: // If this packet had a sequence error, stop to return the error. // Keep the packet for the next call to get_aligned_buffs. - if (seq_error) { + if (seq_error && !ignore_seq_err) { + UHD_LOG_FASTPATH("D"); return SEQUENCE_ERROR; } } diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp index c57a8e0d1..0691138e6 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp @@ -69,7 +69,7 @@ private: /*! * Implementation of rx streamer API */ -template +template class rx_streamer_impl : public rx_streamer { public: @@ -352,7 +352,7 @@ private: std::vector _converters; // Implementation of frame buffer management and packet info - rx_streamer_zero_copy _zero_copy_streamer; + rx_streamer_zero_copy _zero_copy_streamer; // Container for buffer pointers used in recv method std::vector _in_buffs; diff --git a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp index 27b7eaf7d..4da925062 100644 --- a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp +++ b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include namespace uhd { namespace transport { @@ -23,7 +23,7 @@ namespace uhd { namespace transport { * This class is part of rx_streamer_impl, split into a separate unit as it is * a mostly self-contained portion of the streamer logic. */ -template +template class rx_streamer_zero_copy { public: @@ -219,7 +219,7 @@ public: } private: - using get_aligned_buffs_t = get_aligned_buffs; + using get_aligned_buffs_t = get_aligned_buffs; void _handle_overrun() { @@ -232,7 +232,7 @@ private: _frame_buffs[chan] = nullptr; } - frame_buff::uptr buff; + typename transport_t::buff_t::uptr buff; while (true) { std::tie(buff, std::ignore, std::ignore) = _xports[chan]->get_recv_buff(0); -- cgit v1.2.3