aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
Commit message (Collapse)AuthorAgeFilesLines
* rfnoc: Rename thread affinity argsCiro Nishiguchi2019-11-263-73/+73
| | | | | | Rename thread affinity args such that they do not end with an integer. Arg names ending with an integer are interpreted as being targeted at a specific motherboard index in device_addr methods.
* uhd: Allow device args that have an integer in the nameCiro Nishiguchi2019-11-261-1/+5
| | | | | | Allow device args that contain an integer within the name, such as recv_offload_thread_0_cpu. Previously this would cause an invalid format exception.
* lib,tests: Remove old DPDK files from buildAlex Williams2019-11-263-21/+8
| | | | The DPDK files are left behind as a reference, for now.
* transport: Add new base for DPDK links, based on 18.11Alex Williams2019-11-263-0/+956
| | | | | | | | | | | | dpdk_ctx represents the central context and manager of all memory and threads allocated via the DPDK EAL. In this commit, it parses the user's arguments, configures all the ports, and brings them up. dpdk_port represents each DPDK NIC port's configuration, and it manages the allocation of individual queues and their flow rules. It also would provide access to an ARP table and functions for handling ARP requests and responses. The flow rules and ARP functions are not yet implemented.
* docs: Change DPDK version to 18.11 and make args use underscoresAlex Williams2019-11-262-2/+2
| | | | | Swap out hyphens for underscores in the DPDK args. Also update list of distributions with the correct DPDK version in the repos.
* rfnoc_graph: Modify find_blocks() to sort return valueMartin Braun2019-11-262-35/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, the elements of of the return value of find_blocks() are sorted lexicographically (specifically, using uhd::rfnoc::block_id_it::operator<()). The underlying block_container class stores the blocks in an unordered set, so the return value for find_blocks() was always sorted randomly. multi_usrp_rfnoc had to sort the return values every time find_blocks() was used to get a useful return value. Because find_blocks() had no contract for the order of returned blocks, this change simply sorts the return value before returning it. multi_usrp_rfnoc is modified to remove all the sorts that are now superfluous. A good way to see the change is to run uhd_usrp_probe, which will now contain content like this: | _____________________________________________________ | / | | RFNoC blocks on this device: | | | | * 0/DDC#0 | | * 0/DDC#1 | | * 0/DUC#0 | | * 0/DUC#1 | | * 0/DmaFIFO#0 | | * 0/Radio#0 | | * 0/Radio#1 Assuming the blocks don't change, the order of this list will always be the same following this patch. Note that the order is unrelated to the order on the control crossbar, which it never was.
* multi_usrp: Fix GPIO bank selectionMartin Braun2019-11-261-11/+68
| | | | | | | | | | When calling a multi_usrp object like this: usrp->set_gpio_attr("TXB", "CTRL", 0xFFFF); Previously, it would only be able to address daughterboard A. Now, there is a full backward-compatible solution (compatible with 3.15), that will address either daughterboard's GPIOs.
* liberio: porting to I/O servicesBrent Stapleton2019-11-261-11/+2
| | | | Fixes 85f0551 ("rfnoc: Add I/O service manager to X300 and MPMD")
* rfnoc: Make polling I/O service not block on flow controlCiro Nishiguchi2019-11-269-68/+162
| | | | | | 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.
* rfnoc: Make I/O services relinquish CPU while waitingCiro Nishiguchi2019-11-264-25/+140
|
* multi_usrp: Add set_rx_spp() callMartin Braun2019-11-262-2/+34
| | | | | | | | This API call is a more explicit way of setting the spp than passing in an spp value in the args of the stream args when creating streamers. For pre-RFNoC devices, this is done by injecting the spp arg back into the stream args. For RFNoC devices, the set_property() call on the radio is called.
* rfnoc: xports: Count FC bytes as multiples of CHDR widthMartin Braun2019-11-266-17/+43
| | | | | | | | SEPs on the FPGA can only occupy multiples of the CHDR width in their FIFOs, unlike SW, where buffers are stored in RAM and can be aligned anyhow. Therefore, we align the counting of bytes for FC purpose and count multiples of CHDR width instead of the true number of bytes per packet.
* rfnoc: Restrict to inline I/O service based on link restrictionsCiro Nishiguchi2019-11-263-1/+69
| | | | | For links that do not support releasing buffers out of order, restrict the I/O service manager to always select the inline I/O service.
* rfnoc: Use graph_utils in multi_usrp chan generationBrent Stapleton2019-11-261-113/+142
|
* rfnoc: Merge I/O service device args with stream argsCiro Nishiguchi2019-11-266-45/+131
| | | | | This makes it possible for users to put I/O service-related args in either the device args or stream args.
* rfnoc: Split up offload I/O service into multiple filesCiro Nishiguchi2019-11-264-297/+351
|
* uhd: Remove all usages of boost::tuple and friendsMartin Braun2019-11-268-41/+40
| | | | | | | | | | | | | This replaces all of the following with standard C++ features: - boost::tuple - boost::make_tuple - boost::tuple::get - #include <boost/tuple/tuple.hpp> All usages were replaced with search-and-replace scripts (the usages of get could be automatically replaced with a vim macro, the rest was straightforward search-and-replace).
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-2652-530/+530
| | | | | | | | | | | | | | | | | | | | | 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.
* rfnoc: Adding rfnoc_graph utilitiesBrent Stapleton2019-11-262-0/+134
| | | | | | | Adding graph_utils to keep rfnoc_graph utilities to contain helper function and commonly used algorithms for the rfnoc_graph. These functions aren't core to the rfnoc_graph's functionality, so we'll keep them out of its API.
* mpmd: Add skip_oldlog device argMartin Braun2019-11-261-0/+8
| | | | | | | | | | This device arg will avoid printing old log messages by dumping all log messages in the buffer immediately after claiming a device. This can be helpful because reading old log messages can be confusing during debug situations, or simply during situations where we expect errors to contain warnings or errors, but we want to hide them. skip_oldlog defaults to off, i.e., the previous behaviour.
* mpmd: Skip generation of mb_controller and mb_iface for skip_init=1Martin Braun2019-11-261-3/+6
| | | | | | | | | The mpmd_mb_controller requires access to the fully functional FPGA, which in turn assumes flawless initialization. skip_init doesn't init at all, so inializing an mb_controller may not be possible, and shouldn't be attempted. This skips init of both mb_iface and mb_controller for skip_init, leaving it to the other code to figure out if they are initialized.
* uhd: Introduce I/O service managerAaron Rossetto2019-11-2626-176/+1264
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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>
* rfnoc: Make trasnport safe to use with offload threadsCiro Nishiguchi2019-11-266-9/+43
| | | | | | | Make transports safe to use with an offload thread by ensuring that the callbacks and the API methods can execute concurrently. Also, ensure that the transports release their I/O service clients prior to allowing their other member variables be destroyed.
* transport: Implement eov indications for Rx and Tx streamsAaron Rossetto2019-11-267-50/+279
|
* uhd: Replace boost::regex with std::regexMartin Braun2019-11-267-32/+32
| | | | | | | | 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 boost::function with std::functionMartin Braun2019-11-2616-34/+35
| | | | | | | This is mostly a search-and-replace operation, with few exceptions: - boost::function has a clear() method. In C++11, this is achieved by assigning nullptr to the std::function object. - The empty() method is replaced by std::function's bool() operator
* uhd: Replace BOOST_FOREACH(v, c) with for(v : c)Martin Braun2019-11-261-1/+1
| | | | | Also removes all references to boost/foreach.hpp. BOOST_FOREACH is no longer necessary since all headers require C++11 anyway.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-26101-338/+334
| | | | | | | | | | | | | | | | | | | 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-263-0/+1065
| | | | | | | 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.
* rfnoc: Unify endianness of transportsAlex Williams2019-11-264-4/+4
| | | | | Ethernet now uses the same serialization of the RFNoC stream as all the other transports.
* uhd: Check property type at access; error if mismatchAaron Rossetto2019-11-261-1/+24
|
* rfnoc: Port FFT controllerLars Amsel2019-11-262-0/+115
| | | | | | rfnoc used noc-script for FFT controller implementation. Because erfnoc does not support noc-script yet, the implementation is done as a rfnoc controller.
* rfnoc: Add DMA FIFO block controllerMartin Braun2019-11-265-401/+350
|
* Remove proto-RFNoC filesMartin Braun2019-11-2686-14372/+166
| | | | | | | 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-2687-8168/+11173
| | | | | | | 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>
* rfnoc: radio: Add API call to disable timestampsMartin Braun2019-11-262-1/+9
| | | | | By calling radio_control::enable_rx_timestamps(false, chan), the radio will not add timestamps to outgoing packets.
* rfnoc: radio: Interpret MTU as max payload sizeMartin Braun2019-11-261-3/+3
| | | | This matches the streamer code.
* transport: Port liberio to link_ifAlex Williams2019-11-265-315/+333
|
* rfnoc: Fix transport buffer reservationsCiro Nishiguchi2019-11-266-57/+74
| | | | | | | | | 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.
* streamer: Add option to ignore sequence errorsCiro Nishiguchi2019-11-263-8/+9
| | | | Add template parameter to ignore sequence errors, used for testing.
* rfnoc: rfnoc_graph: Safely deinit full graph on any kind of init errorMartin Braun2019-11-261-15/+15
| | | | | | | In the rfnoc_graph, we init blocks, GSM, motherboard controllers, and other things. Since any of these can potentially throw exceptions, we make sure to deinit those components that have already initialized properly before exiting.
* rfnoc: Hold reference to streamers in rfnoc_graphCiro Nishiguchi2019-11-261-2/+11
| | | | | | | Add a shared pointer to the streamers to the rfnoc_graph, so that the streamers are not deallocated before the graph. Nodes in the graph, including the streamers, must remain in memory until the graph is no longer needed.
* rfnoc: Move data xport sep configuration to static methodsCiro Nishiguchi2019-11-269-417/+597
| | | | | | | Move the configuration logic for stream endpoints to static methods of the chdr data transports. This separates those interactions from the main transport code, simplifying both. It also makes it easier to use the transports with mock link objects.
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-269-395/+2418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* rfnoc: radio/streamer: Handle late commands and burst ACKsMartin Braun2019-11-265-7/+52
| | | | | | | - Burst ACKs are already handled by the TX streamer, but the radio now also sends an action upstream on reception of a burst ACK - Late commands were only acquitted by an 'L', now an action gets sent downstream and is handled in the rx streamer
* rfnoc: Add MTU property to RX streamerCiro Nishiguchi2019-11-265-18/+90
|
* rfnoc: Implement flushing on overrunCiro Nishiguchi2019-11-266-72/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies the overrun handling such that the RX streamer does not restart the radios until the packets that were buffered prior to the overrun are read by the user. When an RX streamer receives an overrun, it will run the following algorithm: 1. Stop all upstream producers. 2. Set an internal flag in the streamer that indicates that the producers have stopped due to an overrun. 3. Continue servicing calls to recv until it runs out of packets in the host buffer (packets that can be read from the transport using a 0 timeout). 4. Once the packets are exhausted, return an overrun error from recv. The radio, if it was in continuous streaming mode before the overrun, includes a flag in its initial action whether or not to restart streaming. 5. If the radio requested a restart, the streamer submits a restart request action upstream. This action will be received by the radio. The radio will then check the current time, and send a stream command action back downstream. 6. The RX streamer receives the stream command action, and uses it to send another stream command to all upstream producers. This way, all upstream producers receive a start command for the same time.
* rfnoc: Allow MB controllers to init after blocks have initializedMartin Braun2019-11-262-6/+164
| | | | | | | | | | | | | | | | | | | | | This allows mb_controller childs to implement an init() call which rfnoc_graph will call after the block initialization is complete. rfnoc: graph/mb_controller: Add synchronization routine This adds two new API calls: * rfnoc_graph::synchronize_devices() and * mb_controller::synchronize(). The purpose is to synchronize devices in time and/or phase, depending on device capabilities. mb_controller childs can override or extend the default implementation, which is to simply set time next PPS and verify (similar to the set_time_unknown_pps() call in multi_usrp). rfnoc: mb_controller: Add gpio_src API Adds new API calls (get_gpio_src, get_gpio_srcs, set_gpio_src, get_gpio_banks) to mb_controllers
* rfnoc: Add nirio_link link objectMartin Braun2019-11-263-0/+576
|
* rfnoc: Use adapter_id_t for balancing load across linksAlex Williams2019-11-267-101/+145
| | | | | | | Since the mb_iface allocates local device IDs, also have it track the associated adapter IDs and provide a facility to retrieve them. Incorporate the adapter IDs in the user API to select the adapter for streamers.