diff options
author | Samuel O'Brien <sam.obrien@ni.com> | 2020-06-26 08:26:25 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-07-13 15:21:52 -0500 |
commit | b0cb065111dc3f40b89bdda76e9bd98f3e70b72e (patch) | |
tree | 4d08118999692767bc018d0a21758562abe1a300 /host/lib/rfnoc | |
parent | 14d9452a15a6e65b01e19e0d5ce0c67afc060cc2 (diff) | |
download | uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.tar.gz uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.tar.bz2 uhd-b0cb065111dc3f40b89bdda76e9bd98f3e70b72e.zip |
rfnoc: Rename chdr_packet to chdr_packet_writer
It would be confusing to have two classes named chdr_packet. As it makes
more sense to name the new public chdr parser class chdr_packet, the
internal uhd::rfnoc::chdr::chdr_packet class is being renamed to
chdr_packet_writer to better represent its functionality.
Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_ctrl_endpoint.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_packet_writer.cpp (renamed from host/lib/rfnoc/chdr_packet.cpp) | 10 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_rx_data_xport.cpp | 2 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_tx_data_xport.cpp | 4 | ||||
-rw-r--r-- | host/lib/rfnoc/ctrlport_endpoint.cpp | 20 | ||||
-rw-r--r-- | host/lib/rfnoc/mgmt_portal.cpp | 2 |
7 files changed, 19 insertions, 23 deletions
diff --git a/host/lib/rfnoc/CMakeLists.txt b/host/lib/rfnoc/CMakeLists.txt index 7c54a71f6..7d1334e04 100644 --- a/host/lib/rfnoc/CMakeLists.txt +++ b/host/lib/rfnoc/CMakeLists.txt @@ -16,7 +16,7 @@ LIBUHD_APPEND_SOURCES( ${CMAKE_CURRENT_SOURCE_DIR}/block_container.cpp ${CMAKE_CURRENT_SOURCE_DIR}/block_id.cpp ${CMAKE_CURRENT_SOURCE_DIR}/chdr_types.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/chdr_packet.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/chdr_packet_writer.cpp ${CMAKE_CURRENT_SOURCE_DIR}/chdr_ctrl_xport.cpp ${CMAKE_CURRENT_SOURCE_DIR}/chdr_rx_data_xport.cpp ${CMAKE_CURRENT_SOURCE_DIR}/chdr_tx_data_xport.cpp diff --git a/host/lib/rfnoc/chdr_ctrl_endpoint.cpp b/host/lib/rfnoc/chdr_ctrl_endpoint.cpp index bba972186..3b2865c73 100644 --- a/host/lib/rfnoc/chdr_ctrl_endpoint.cpp +++ b/host/lib/rfnoc/chdr_ctrl_endpoint.cpp @@ -9,7 +9,7 @@ #include <uhd/utils/safe_call.hpp> #include <uhd/utils/thread.hpp> #include <uhdlib/rfnoc/chdr_ctrl_endpoint.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <boost/format.hpp> #include <atomic> diff --git a/host/lib/rfnoc/chdr_packet.cpp b/host/lib/rfnoc/chdr_packet_writer.cpp index fc6c24838..c58ffd932 100644 --- a/host/lib/rfnoc/chdr_packet.cpp +++ b/host/lib/rfnoc/chdr_packet_writer.cpp @@ -4,7 +4,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <cassert> #include <functional> #include <memory> @@ -13,14 +13,14 @@ using namespace uhd; using namespace uhd::rfnoc; using namespace uhd::rfnoc::chdr; -chdr_packet::~chdr_packet() = default; +chdr_packet_writer::~chdr_packet_writer() = default; //------------------------------------------------------------ // chdr_packet //------------------------------------------------------------ // endianness is the link endianness, not the host endianness template <size_t chdr_w, endianness_t endianness> -class chdr_packet_impl : public chdr_packet +class chdr_packet_impl : public chdr_packet_writer { public: chdr_packet_impl() = delete; @@ -165,7 +165,7 @@ chdr_packet_factory::chdr_packet_factory(chdr_w_t chdr_w, endianness_t endiannes { } -chdr_packet::uptr chdr_packet_factory::make_generic(size_t mtu_bytes) const +chdr_packet_writer::uptr chdr_packet_factory::make_generic(size_t mtu_bytes) const { if (_endianness == ENDIANNESS_BIG) { switch (_chdr_w) { @@ -198,7 +198,7 @@ chdr_packet::uptr chdr_packet_factory::make_generic(size_t mtu_bytes) const assert(0); } } - return chdr_packet::uptr(); + return chdr_packet_writer::uptr(); } chdr_ctrl_packet::uptr chdr_packet_factory::make_ctrl(size_t mtu_bytes) const diff --git a/host/lib/rfnoc/chdr_rx_data_xport.cpp b/host/lib/rfnoc/chdr_rx_data_xport.cpp index df7162a73..ebfcda2b8 100644 --- a/host/lib/rfnoc/chdr_rx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_rx_data_xport.cpp @@ -106,7 +106,7 @@ chdr_rx_data_xport::fc_params_t chdr_rx_data_xport::configure_sep(io_service::sp const sep_id_t local_epid = epids.second; rx_flow_ctrl_sender fc_sender(pkt_factory, epids); - chdr::chdr_packet::uptr pkt = pkt_factory.make_generic(); + chdr::chdr_packet_writer::uptr pkt = pkt_factory.make_generic(); fc_sender.set_capacity(recv_capacity); chdr::strc_payload strc; diff --git a/host/lib/rfnoc/chdr_tx_data_xport.cpp b/host/lib/rfnoc/chdr_tx_data_xport.cpp index 321b6ea85..a51835a07 100644 --- a/host/lib/rfnoc/chdr_tx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_tx_data_xport.cpp @@ -96,8 +96,8 @@ static chdr_tx_data_xport::fc_params_t configure_flow_ctrl(io_service::sptr io_s const double fc_freq_ratio, const double fc_headroom_ratio) { - chdr::chdr_strc_packet::uptr strc_packet = pkt_factory.make_strc(); - chdr::chdr_packet::uptr recv_packet = pkt_factory.make_generic(); + chdr::chdr_strc_packet::uptr strc_packet = pkt_factory.make_strc(); + chdr::chdr_packet_writer::uptr recv_packet = pkt_factory.make_generic(); // No flow control at initialization, just release all send buffs auto send_cb = [](frame_buff::uptr buff, send_link_if* send_link) { diff --git a/host/lib/rfnoc/ctrlport_endpoint.cpp b/host/lib/rfnoc/ctrlport_endpoint.cpp index 5cff24443..5afb3919e 100644 --- a/host/lib/rfnoc/ctrlport_endpoint.cpp +++ b/host/lib/rfnoc/ctrlport_endpoint.cpp @@ -6,7 +6,7 @@ #include <uhd/exception.hpp> #include <uhd/utils/log.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/chdr_types.hpp> #include <uhdlib/rfnoc/ctrlport_endpoint.hpp> #include <condition_variable> @@ -121,9 +121,8 @@ public: { // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed // command is in the queue - auto timeout_time = start_timeout( - check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout - ); + auto timeout_time = + start_timeout(check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout); // Send request auto request = @@ -174,9 +173,8 @@ public: // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed // command is in the queue - auto timeout_time = start_timeout( - check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout - ); + auto timeout_time = + start_timeout(check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout); // Send request auto request = send_request_packet(OP_POLL, @@ -192,12 +190,10 @@ public: virtual void sleep(uhd::time_spec_t duration, bool ack = false) { - // Compute transaction expiration time, use MASSIVE_TIMEOUT if a timed // command is in the queue - auto timeout_time = start_timeout( - check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout - ); + auto timeout_time = + start_timeout(check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout); // Send request auto request = send_request_packet(OP_SLEEP, @@ -421,7 +417,7 @@ private: // If we can fit the current request in the queue then we can proceed return (_buff_occupied + pyld_size) <= (_buff_capacity - - (ASYNC_MESSAGE_SIZE * _max_outstanding_async_msgs)); + - (ASYNC_MESSAGE_SIZE * _max_outstanding_async_msgs)); }; if (!buff_not_full()) { // If we're sending a timed command or if we have a timed command in the diff --git a/host/lib/rfnoc/mgmt_portal.cpp b/host/lib/rfnoc/mgmt_portal.cpp index 971c9837a..a54efaaf7 100644 --- a/host/lib/rfnoc/mgmt_portal.cpp +++ b/host/lib/rfnoc/mgmt_portal.cpp @@ -8,7 +8,7 @@ #include <uhd/exception.hpp> #include <uhd/utils/log.hpp> #include <uhdlib/rfnoc/chdr_ctrl_xport.hpp> -#include <uhdlib/rfnoc/chdr_packet.hpp> +#include <uhdlib/rfnoc/chdr_packet_writer.hpp> #include <uhdlib/rfnoc/mgmt_portal.hpp> #include <unordered_set> #include <boost/format.hpp> |