From f312d827602fafa21625106dafe2f209e10a22b3 Mon Sep 17 00:00:00 2001 From: Ciro Nishiguchi Date: Wed, 11 Sep 2019 16:50:11 -0500 Subject: 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. --- host/lib/rfnoc/chdr_ctrl_xport.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'host/lib/rfnoc/chdr_ctrl_xport.cpp') diff --git a/host/lib/rfnoc/chdr_ctrl_xport.cpp b/host/lib/rfnoc/chdr_ctrl_xport.cpp index 929875dbd..f9f7c9e1b 100644 --- a/host/lib/rfnoc/chdr_ctrl_xport.cpp +++ b/host/lib/rfnoc/chdr_ctrl_xport.cpp @@ -74,9 +74,8 @@ chdr_ctrl_xport::chdr_ctrl_xport(io_service::sptr io_srv, return false; }; - // No additional frames reserved specifically for this virtual interface _mgmt_recv_if = io_srv->make_recv_client( - recv_link, 0, mgmt_recv_cb, send_link_if::sptr(), 0, release_cb); + recv_link, 1, mgmt_recv_cb, send_link_if::sptr(), 0, release_cb); } /*! @@ -143,6 +142,13 @@ void chdr_ctrl_xport::release_recv_buff(frame_buff::uptr buff) _ctrl_recv_if->release_recv_buff(std::move(buff)); } +void chdr_ctrl_xport::release_mgmt_buff(frame_buff::uptr buff) +{ + // FIXME: Remove mutex when have threaded_io_service + std::lock_guard lock(_mutex); + _mgmt_recv_if->release_recv_buff(std::move(buff)); +} + /*! * Get this xport's EPID */ -- cgit v1.2.3