diff options
| author | Ciro Nishiguchi <ciro.nishiguchi@ni.com> | 2019-08-27 16:19:15 -0500 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:45 -0800 | 
| commit | 98209df92ea2a6abf6ed41af03bc3909b8e152b9 (patch) | |
| tree | b794f5def785ea46304ea8ea4d95ea814adb422b | |
| parent | 745fbf19bc22e98cee42acac04cda28c5f9bcbd4 (diff) | |
| download | uhd-98209df92ea2a6abf6ed41af03bc3909b8e152b9.tar.gz uhd-98209df92ea2a6abf6ed41af03bc3909b8e152b9.tar.bz2 uhd-98209df92ea2a6abf6ed41af03bc3909b8e152b9.zip  | |
streamer: Add option to ignore sequence errors
Add template parameter to ignore sequence errors, used for testing.
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 <typename transport_t> +template <typename transport_t, bool ignore_seq_err = false>  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 <typename transport_t> +template <typename transport_t, bool ignore_seq_err = false>  class rx_streamer_impl : public rx_streamer  {  public: @@ -352,7 +352,7 @@ private:      std::vector<uhd::convert::converter::sptr> _converters;      // Implementation of frame buffer management and packet info -    rx_streamer_zero_copy<transport_t> _zero_copy_streamer; +    rx_streamer_zero_copy<transport_t, ignore_seq_err> _zero_copy_streamer;      // Container for buffer pointers used in recv method      std::vector<const void*> _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 <uhd/utils/log.hpp>  #include <uhdlib/transport/get_aligned_buffs.hpp>  #include <boost/format.hpp> -#include <vector>  #include <atomic> +#include <vector>  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 <typename transport_t> +template <typename transport_t, bool ignore_seq_err = false>  class rx_streamer_zero_copy  {  public: @@ -219,7 +219,7 @@ public:      }  private: -    using get_aligned_buffs_t = get_aligned_buffs<transport_t>; +    using get_aligned_buffs_t = get_aligned_buffs<transport_t, ignore_seq_err>;      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);  | 
