aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2017-10-04 13:02:50 -0700
committerMartin Braun <martin.braun@ettus.com>2017-10-05 16:18:10 -0700
commit04005863438b3638ed1e996ae59934f59725300a (patch)
tree28e487e9714a1bdb95cb09f0e71e401e7f56d9c9 /host/lib/transport
parentf3248df2bb1ab2696edb306649b22a6b751129f2 (diff)
downloaduhd-04005863438b3638ed1e996ae59934f59725300a.tar.gz
uhd-04005863438b3638ed1e996ae59934f59725300a.tar.bz2
uhd-04005863438b3638ed1e996ae59934f59725300a.zip
transport: liberio: Fix bug with recv timeout conversion
The timeout value passed in by UHD would get multiplied by USEC, to convert from the UHD value in seconds to the liberio value in microseconds. The bug manifested itself by calling liberio_dequeue_buf() with a timeout equivalent to 100s. Fixes ed1c64c81 ('transport: Added liberio_zero_copy transport ...') Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Alex Williams <alex.williams@ni.com>
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/liberio_zero_copy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/transport/liberio_zero_copy.cpp b/host/lib/transport/liberio_zero_copy.cpp
index ebe509010..fb30f8936 100644
--- a/host/lib/transport/liberio_zero_copy.cpp
+++ b/host/lib/transport/liberio_zero_copy.cpp
@@ -68,7 +68,7 @@ public:
}
}
- sptr get_new(int timeout, size_t &index)
+ sptr get_new(double timeout, size_t &index)
{
_buf = liberio_chan_buf_dequeue(_chan, timeout * USEC);
if (!_buf)
@@ -99,7 +99,7 @@ public:
liberio_chan_buf_enqueue(_chan, _buf);
}
- sptr get_new(int timeout, size_t &index)
+ sptr get_new(double timeout, size_t &index)
{
_buf = liberio_chan_buf_dequeue(_chan, timeout * USEC);
if (!_buf)
@@ -200,7 +200,7 @@ public:
if (_next_recv_buff_index == _num_recv_bufs)
_next_recv_buff_index = 0;
return _mrb_pool[_next_recv_buff_index]->get_new(
- USEC * timeout, _next_recv_buff_index);
+ timeout, _next_recv_buff_index);
}
size_t get_num_recv_frames(void) const