aboutsummaryrefslogtreecommitdiffstats
path: root/host/tests
Commit message (Collapse)AuthorAgeFilesLines
* uhd: fixing MSVC warningsBrent Stapleton2020-01-091-1/+2
| | | | | | | | | | | Small changes to remove various compiler warnings found in MSVC - Adding uhd::narrow_cast to verious spots - wavetable.hpp: all floats literals in the wavetable. - paths_test: unnecessary character escape - replay example: remove unreferenced noc_id - adfXXXX: Fixing qualifiers to match between parent and derived classes - rpc, block_id: Removing unused name in try...catch
* tests: fixup compiler warningBrent Stapleton2019-12-301-1/+1
| | | | Fixes cb40069b ("tests: Port polling-mode dpdk_test to new DPDK...")
* tests: Port polling-mode dpdk_test to new DPDK frameworkAlex Williams2019-12-203-83/+121
| | | | | | The mock_send_transport and mock_recv_transport are used, which ends up with two layers of flow control. More work may be needed here for comparisons with the old data.
* dpdk: Add new DPDK stack to integrate with I/O servicesAlex Williams2019-12-202-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs: Update DPDK docs with new parameters: Parameter names have had their hyphens changed to underscores, and the I/O CPU argument is now named after the lcores and reflects the naming used by DPDK. transport: Add new udp_dpdk_link, based atop the new APIs: This link is tightly coupled with the DPDK I/O service. The link class carries all the address information to communicate with the other host, and it can send packets directly through the DPDK NIC ports. However, for receiving packets, the I/O service must pull the packets from the DMA queue and attach them to the appropriate link object. The link object merely formats the frame_buff object underneath, which is embedded in the rte_mbuf container. For get_recv_buff, the link will pull buffers only from its internal queue (the one filled by the I/O service). transport: Add DPDK-specific I/O service: The I/O service is split into two parts, the user threads and the I/O worker threads. The user threads submit requests through various appropriate queues, and the I/O threads perform all the I/O on their behalf. This includes routing UDP packets to the correct receiver and getting the MAC address of a destination (by performing the ARP request and handling the ARP replies). The DPDK context stores I/O services. The context spawns all I/O services on init(), and I/O services can be fetched from the dpdk_ctx object by using a port ID. I/O service clients: The clients have two lockless ring buffers. One is to get a buffer from the I/O service; the other is to release a buffer back to the I/O service. Threads sleeping on buffer I/O are kept in a separate list from the service queue and are processed in the course of doing RX or TX. The list nodes are embedded in the dpdk_io_if, and the head of the list is on the dpdk_io_service. The I/O service will transfer the embedded wait_req to the list if it cannot acquire the mutex to complete the condition for waking. Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
* tests: Add more tests for max rate streamingCiro Nishiguchi2019-12-184-89/+469
| | | | | Add more tests to compare streaming rates with previous releases. Changed the output string to a table.
* tests: Install all stream performance scriptsBrent Stapleton2019-12-061-1/+3
| | | | | | | Install all of the streaming performance tests scripts, not just the X300 one. Fixes: 2bf1f0acaa35 ("tests: Add script to execute batch of bench...")
* tests: Add tests to exercise max streaming rates and report resultsCiro Nishiguchi2019-12-063-0/+1008
|
* tests: Add script to execute batch of benchmark_rate runsCiro Nishiguchi2019-12-065-0/+424
| | | | | Script runs benchmark_rate repeatedly, parses results, and calculates average, min, and max of each value reported.
* lib: Add DPDK service queueAlex Williams2019-11-261-0/+65
| | | | | | | This is a data structure intended for use by the DPDK I/O service. It uses DPDK's lockless ring in multi-producer, single-consumer mode to allow clients to submit requests to the DPDK I/O service's worker thread. Clients can specify a timeout for the requests to be fulfilled.
* devtest: Add test_messages_test to X310Martin Braun2019-11-263-12/+14
| | | | | | - Fixes issues with test_messages_test (it had inverted the pass/fail condition) - Improve Pylint scores in affected files
* devtest: Use with() statement to open filesMartin Braun2019-11-261-5/+9
| | | | | | | | | | | | | | This fixes warnings such as this during devtest: /home/mbr0wn/src/uhddev/host/tests/devtest/uhd_test_base.py:112: ResourceWarning: unclosed file <_io.TextIOWrapper name='./results_x300_F457AD.log' mode='r' encoding='UTF-8'> self.results = yaml.safe_load(open(self.results_file).read()) or {} /path/to/uhd/host/tests/devtest/uhd_test_base.py:150: ResourceWarning: unclosed file <_io.TextIOWrapper name='./results_x300_F457AD.log' mode='w' encoding='UTF-8'> yaml.dump(self.results, default_flow_style=False)) ok
* tests: Add check for life on DPDK portAlex Williams2019-11-262-0/+62
|
* lib,tests: Remove old DPDK files from buildAlex Williams2019-11-261-19/+0
| | | | The DPDK files are left behind as a reference, for now.
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-262-18/+31
| | | | | | Add a new method to io_service::send_io to check whether the destination is ready for data, to make it possible to poll send_io rather than block waiting for flow control credits.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-264-20/+21
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* uhd: Introduce I/O service managerAaron Rossetto2019-11-261-7/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | - Implement I/O service detach link methods - The I/O service manager instantiates new I/O services or connects links to existing I/O services based on options provided by the user in stream_args. - Add a streamer ID parameter to methods to create transports so that the I/O service manager can group transports appropriately when using offload threads. - Change X300 and MPMD to use I/O service manager to connect links to I/O services. - There is now a single I/O service manager per rfnoc_graph (and it is also stored in the graph) - The I/O service manager now also knows the device args for the rfnoc_graph it was created with, and can make decisions based upon those (e.g, use a specific I/O service for DPDK, share cores between streamers, etc.) - The I/O Service Manager does not get any decision logic with this commit, though - The MB ifaces for mpmd and x300 now access this global I/O service manager - Add configuration of link parameters with overrides Co-Authored-By: Martin Braun <martin.braun@ettus.com> Co-Authored-By: Aaron Rossetto <aaron.rossetto@ni.com>
* transport: Implement eov indications for Rx and Tx streamsAaron Rossetto2019-11-263-0/+384
|
* tests: Change Python YAML moduleBrent Stapleton2019-11-261-1/+6
| | | | Use Python's `ruamel.yaml` module instead of `yaml`
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-261-3/+0
| | | | | | | | boost::regex was a requirement until the minimum version of gcc was increased. Since it is at version 5.3 now, using Boost.Regex is no longer necessary. This change is a pure search-and-replace; Boost and std versions of regex are compatible and use the same syntax.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-268-38/+38
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* transport: Implement an I/O service that uses an offload threadCiro Nishiguchi2019-11-262-0/+284
| | | | | | | The offload_io_service executes another I/O service instance within an offload thread, and provides synchronization mechanisms to communicate with clients. Frame buffers are passed from the offload thread to the client and back via single-producer, single-consumer queues.
* uhd: Check property type at access; error if mismatchAaron Rossetto2019-11-261-1/+19
|
* Remove proto-RFNoC filesMartin Braun2019-11-2618-1982/+6
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* x300/mpmd: Port all RFNoC devices to the new RFNoC frameworkMartin Braun2019-11-261-5/+13
| | | | | | | Co-Authored-By: Alex Williams <alex.williams@ni.com> Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com> Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com> Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
* tests: Add benchmark of streamer and chdr xportsCiro Nishiguchi2019-11-262-7/+534
|
* tests: Make packet handler benchmark include flow controlCiro Nishiguchi2019-11-262-229/+228
| | | | | Add mock flow control to the packet handler benchmark to make it a better comparison to streamer_benchmark.
* rfnoc: client_zero can track num SEPs and num ctrl EPs separatelyMartin Braun2019-11-261-0/+1
|
* transport: Add modeling of physical adaptersAlex Williams2019-11-261-0/+10
| | | | | | | Now link instances must have the ability to report the corresponding physical adapter that is used for the local side of the link. This information can be used to help identify when multiple links share the same adapter.
* rfnoc: node: Add set_properties()Martin Braun2019-11-261-0/+5
| | | | | node_t::set_properties() is a convenience function that lets you set multiple properties at once from a device_addr_t.
* rfnoc: property: Add option to set properties from stringsMartin Braun2019-11-261-0/+27
|
* rfnoc: tx_streamer: add support for async messagesCiro Nishiguchi2019-11-261-0/+6
| | | | | | Add an async message queue that aggregates errors from multiple sources. Errors can come from the strs packets originating from the stream endpoint or from the radio block through control packets to the host.
* rfnoc: graph: Optimize property propagation algorithmMartin Braun2019-11-261-3/+2
| | | | | | | | | | | | | | | | | | | | | This introduces the concept of a resolution context, because the property propagation algorithm needs to behave differently when called during an initialization step (e.g. when the graph is committed), or when the user changes a property on one of the nodes after it was committed. The algorithm is modified as follows: - When called during an initialization step, then all nodes get resolved at least once. If nodes added new properties, then all nodes get touched again until the max number of iterations is reached. - When called because a node modified one of its properties, then that node is always resolved first. From there, all other nodes are resolved in topological order. However, the algorithm immediately terminates as soon as there are no more dirty nodes. - When called because a node modified one of its properties, but the graph is currently not in a committed state, then that node will do a local property resolution.
* utils: remove thread priority elevationCiro Nishiguchi2019-11-261-2/+0
| | | | | | | | Remove UHD call to elevate thread priority to realtime from utils, and add warning in documentation of set_thread_priority function. Setting all threads to the same realtime priority can cause the threads to not share access to the network interface fairly, which adversely affects operation of the worker threads in UHD.
* rfnoc: tests: Let block unit tests use regular factoryMartin Braun2019-11-262-49/+53
| | | | | | | Up until now, these unit tests were bypassing the factory, and directly linking against the relevant block factories. This can cause linker issues, but it also doesn't test code paths. This change makes the unit tests look more like the actual usage.
* rfnoc: ctrlport: Separately validate and handle async messagesMartin Braun2019-11-261-0/+5
| | | | | | | | | | | This introduces the concept of an async message validator, an optional callback for functions to check if an async message has a valid payload. After validation, the async message is ack'd. Then, the async message handler is executed. This makes sure that an async message is ack'd as soon as possible, rather than after the async message handling, which can itself have all sorts of communication going on to the device.
* rfnoc: Add DUC block controllerMartin Braun2019-11-263-3/+170
|
* rfnoc: Add MTU trackingMartin Braun2019-11-261-1/+20
| | | | | | | | | | | | | | | | | MTUs are now tracked through the framework for all childs of noc_block_base. Every edge gets an 'mtu' property. MTU can be set and get either through the prop API, or through new API calls (get_mtu(), set_mtu()). It is also possible to create custom properties that depend on the MTU by asking for a reference to the MTU property, and then adding that to the input list of a property resolver. The radio_control_impl includes a change in this commit where it sets the spp based on the MTU. Blocks can also set an MTU forwarding policy. The DDC block includes a change in this commit that sets a forwarding policy of ONE_TO_ONE, meaning that the MTU on an input edge is forwarded to the corresponding output edge (but not the other edges, as with the tick rate).
* rfnoc: actions: Allow sending actions to selfMartin Braun2019-11-261-2/+5
| | | | | | | | Sending actions to self is useful because calling post_action() from within an action handler will not actually trigger the action. Instead, it will defer delivery of the action. Allowing sending actions to self will allow to add another action, in deterministic order, and the execution of another action handler.
* rfnoc: actions: Add dictionary to all actionsMartin Braun2019-11-261-0/+6
| | | | | | This can be used to set arbitrary key/value pairs on the action object. Easier to use than serialization, but doesn't require custom types, either.
* rfnoc: Introduce device-specific blocksLars Amsel2019-11-261-3/+3
| | | | | | | | | | | | | - Add device ID constants (e.g., E310 == 0xE310, X300 == 0xA300). These are stored in the device FPGA, and can be used for decisions later - Blocks can be specific to a device. For example, x300_radio_control can only work on an X300 series device. - Because blocks can be device-specific, all radio blocks can now share a common Noc-ID (0x12AD1000). - The registry and factory functions are modified to acommodate for this. - The motherboard access is now also factored into the same registry macro.
* rfnoc: DDC: Fix property propagationMartin Braun2019-11-263-9/+135
| | | | | | | | | - Combine scaling and samp_rate resolvers - Prioritize decim when user has set it for DDC: When samp_rate_in changes, either the samp_rate_out or the decim values may change to accommodate it. If decim has been set by the user (which can be determined by the valid flag), prefer changing samp_rate_out over decim.
* rfnoc: add rx and tx transports, and amend rfnoc_graphCiro Nishiguchi2019-11-265-0/+1193
| | | | | | | | | | | | | | | | | | | | | | | transports: Transports build on I/O service and implements flow control and sequence number checking. The rx streamer subclass extends the streamer implementation to connect it to the rfnoc graph. It receives configuration values from property propagation and configures the streamer accordingly. It also implements the issue_stream_cmd rx_streamer API method. Add implementation of rx streamer creation and method to connect it to an rfnoc block. rfnoc_graph: Cache more connection info, clarify contract Summary of changes: - rfnoc_graph stores more information about static connections at the beginning. Some search algorithms are replaced by simpler lookups. - The contract for connect() was clarified. It is required to call connect, even for static connections.
* rfnoc: Enable users to query connections in the graphAlex Williams2019-11-261-0/+8
| | | | Implement uhd::rfnoc::rfnoc_graph::enumerate_*_connections()
* rfnoc: Add clock selection to blocksMartin Braun2019-11-261-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | During registration, blocks must now specify which clock they are using for the timebase (i.e., for timed commands) and for the ctrlport (this is used to determine the length of sleeps and polls). For example, the X300 provides bus_clk and radio_clk; typically, the former is used for the control port, and the latter for the timebase clock. Another virtual clock is called "__graph__", and it means the clock is derived from property propagation via the graph. The actual clocks are provided by the mb_iface. It has two new API calls: get_timebase_clock() and get_ctrlport_clock(), which take an argument as to which clock exactly is requested. On block initialization, those clock_iface objects are copied into the block controller. The get_tick_rate() API call for blocks now exclusively checks the timebase clock_iface, and will no longer cache the current tick rate in a separate _tick_rate member variable. Block controllers can't manually modify the clock_iface, unless they also have access to the mb_controller (like the radio block), and that mb_controller has provided said access. This commit also adds the clock selection API changes to the DDC block, the Null block, and the default block.
* rfnoc: Add shutdown feature to blocksMartin Braun2019-11-262-0/+7
| | | | | | | | On destruction, the rfnoc_graph will call shutdown() on all blocks. This allows a safe de-initialization of blocks independent of the lifetime of the noc_block_base::sptr. Also adds the shutdown feature to null_block_control.
* rfnoc: Add null block controllerMartin Braun2019-11-262-0/+88
|
* rfnoc: noc_block_base: Pass args into block on constructionMartin Braun2019-11-261-0/+2
| | | | | These args come from the framework, e.g., because the UHD session was launched with them.
* rfnoc: graph: Add commit/release APIMartin Braun2019-11-263-7/+14
|
* rfnoc: Add mb_controller APIMartin Braun2019-11-262-0/+156
| | | | | | | | | The mb_controller is an interface to hardware-specific functions of the motherboard. The API works in two ways: - The user can request access to it, and thus interact directly with the motherboard - RFNoC blocks can request access to it, if they need to interact with the motherboard themselves.
* rfnoc: Add radio block controllerMartin Braun2019-11-261-0/+1
|