aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include
diff options
context:
space:
mode:
authorCiro Nishiguchi <ciro.nishiguchi@ni.com>2019-09-11 16:50:11 -0500
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:45 -0800
commitf312d827602fafa21625106dafe2f209e10a22b3 (patch)
treefc805bebde263da87da3d7ceeb133014156cba3f /host/lib/include
parent1a6368331bf441290b0d08ac233c9e5050021493 (diff)
downloaduhd-f312d827602fafa21625106dafe2f209e10a22b3.tar.gz
uhd-f312d827602fafa21625106dafe2f209e10a22b3.tar.bz2
uhd-f312d827602fafa21625106dafe2f209e10a22b3.zip
rfnoc: Fix transport buffer reservations
Change transports to reserve the number of frame buffers they actually need from the I/O service. Previously some I/O service clients reserved 0 buffers since they shared frame buffers with other clients, as we know the two clients do not use the links simultaneously. This is possible with the inline_io_service but not with a multithreaded I/O service which queues buffer for clients before they are requested.
Diffstat (limited to 'host/lib/include')
-rw-r--r--host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp7
-rw-r--r--host/lib/include/uhdlib/transport/inline_io_service.hpp13
2 files changed, 11 insertions, 9 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp
index 726ea7f6c..2a37a5afc 100644
--- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp
+++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp
@@ -120,6 +120,13 @@ public:
void release_recv_buff(frame_buff::uptr buff);
/*!
+ * Release a frame buffer, allowing the recv link driver to reuse it.
+ *
+ * \param buffer frame buffer to release for reuse by the link
+ */
+ void release_mgmt_buff(frame_buff::uptr buff);
+
+ /*!
* Get this xport's EPID
*
* \return the source EPID for this transport
diff --git a/host/lib/include/uhdlib/transport/inline_io_service.hpp b/host/lib/include/uhdlib/transport/inline_io_service.hpp
index f10e7018d..f207d15a0 100644
--- a/host/lib/include/uhdlib/transport/inline_io_service.hpp
+++ b/host/lib/include/uhdlib/transport/inline_io_service.hpp
@@ -71,9 +71,8 @@ private:
* Disconnect the sender and free resources
*
* \param link the link that was used for sending data
- * \param num_frames number of frames to release (same as reservation)
*/
- void disconnect_sender(send_link_if* link, size_t num_frames);
+ void disconnect_sender(send_link_if* link);
/*!
* Connect a receiver to the link and reserve resources
@@ -87,9 +86,8 @@ private:
* Disconnect the receiver from the provided link and free resources
* \param link the recv link that was used for reception
* \param cb the callback to disassociate
- * \param num_frames the number of frames that was reserved for the cb
*/
- void disconnect_receiver(recv_link_if* link, inline_recv_cb* cb, size_t num_frames);
+ void disconnect_receiver(recv_link_if* link, inline_recv_cb* cb);
/*
* Function to perform recv operations on a link, which is potentially
@@ -103,14 +101,11 @@ private:
frame_buff::uptr recv(
inline_recv_cb* recv_io_cb, recv_link_if* recv_link, int32_t timeout_ms);
- /* Track whether link is muxed, the callback, and buffer reservations */
+ /* Track whether link is muxed and the callback */
std::unordered_map<recv_link_if*,
- std::tuple<inline_recv_mux*, inline_recv_cb*, size_t>>
+ std::tuple<inline_recv_mux*, inline_recv_cb*>>
_recv_tbl;
- /* Track how many send_frames have been reserved for each link */
- std::unordered_map<send_link_if*, size_t> _send_tbl;
-
/* Shared ptr kept to avoid untimely release */
std::list<send_link_if::sptr> _send_links;
std::list<recv_link_if::sptr> _recv_links;