aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
Commit message (Collapse)AuthorAgeFilesLines
* Remove proto-RFNoC filesMartin Braun2019-11-268-563/+0
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* transport: Port liberio to link_ifAlex Williams2019-11-264-315/+153
|
* rfnoc: Fix transport buffer reservationsCiro Nishiguchi2019-11-261-38/+47
| | | | | | | | | 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.
* rfnoc: Add nirio_link link objectMartin Braun2019-11-262-0/+366
|
* transport: Add modeling of physical adaptersAlex Williams2019-11-263-5/+33
| | | | | | | 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: Add chdr_ctrl_xportAlex Williams2019-11-261-4/+0
| | | | | | | | | | | | | | chdr_ctrl_xport is a dumb-pipe transport for RFNoC control transactions and management frames. Also remove the I/O service's check on num_recv_frames and num_send_frames. The transports may request additional virtual channels, so the send_io_if and recv_io_if may not reserve additional frames, as they are shared with a previously-allocated instance. Note: this uses a mutex to force sequentual access to the chdr_ctrl_xport. This is supposed to go away when the multi threaded xport is done.
* uhd: add udp boost asio implementation of transport interfaceCiro Nishiguchi2019-11-267-195/+176
|
* transport: Implement a single-threaded I/O serviceAlex Williams2019-11-262-0/+416
| | | | | | | | | | | | | | | | | | | | The inline_io_service connects transports to links without any worker threads. Send operations go directly to the link, and recv will perform the I/O as part of the get_recv_buffer() call. The inline_io_service also supports muxed links natively. The receive mux is entirely inline. There is no separate thread for the inline_io_service, and that continues here. A queue is created for each client of the mux, and packets are processed as they come in. If a packet is to go up to a different client, the packet is queued up for later. When that client attempts to recv(), the queue is checked first, and the attempts to receive from the link happen ONLY if no packet was found. Also add mock transport to test I/O service APIs. Tests I/O service construction and some basic packet transmision. One case will also uses a single link that is shared between the send and recv transports. That link is muxed between two compatible but different transports.
* niusrpio: Apply formattingMartin Braun2019-11-261-59/+69
|
* libusb: fix global session race conditionMark Meserve2019-10-161-0/+5
| | | | | - It was possible for two threads to generate a global session, which would cause one of them to become invalid.
* Device3: Fix MTU and default frame sizesMichael West2019-07-181-0/+5
| | | | | | | | | | The latest changes to the get_*x_stream() functions to calculate the MTU for the channel caused default frame size values to be ignored. This change fixes that by changing the key from "send/recv_frame_size" to "mtu" and then changing the implementations of make_transport() constrain the frame size values based on the "mtu" value as well as any device and/or transport-specific limits. Signed-off-by: Michael West <michael.west@ettus.com>
* nirio: Fix typo in nirio_zero_copyMichael West2019-07-181-1/+1
| | | | Signed-off-by: Michael West <michael.west@ettus.com>
* transport: usb: Allow to cancel USB requests without throwingBehnam Sabaghi2019-07-181-1/+3
|
* x310: fixed udp WSA buffer size assignment issueMatthew Crymble2019-07-171-3/+21
|
* transport: fixed a pre-mature buffer resetmcrymble2019-06-141-2/+3
| | | | | | In the PACKET_INLINE_MESSAGE case, we need to extract the error code from the packet buffer. But the buffer was being released before that happens, resulting in garbage values for metadata.error_code.
* transport: Remove warning for memset in super_recv_packet_handlerAlex Williams2019-06-071-4/+4
| | | | Should use value initialization for non-trivial classes.
* liberio: Release context holder on destruction of last liberio xportSugandha Gupta2019-05-011-3/+24
| | | | | | This will make sure that the context holder for the liberio context is destroyed when the last liberio transport is destroyed, and not on termination of the program.
* uhdlib: Add dpdk_zero_copy.hppAlex Williams2019-04-102-46/+1
| | | | | dpdk_zero_copy.hpp was referenced in multiple places using relative paths. Let's throw it in uhdlib for easy access.
* transport: Make dpdk_simple subclass udp_simpleAlex Williams2019-04-101-58/+63
| | | | With the same APIs, this will make it easier to add support for X310.
* uhd-dpdk: Wait for links to come up before poking MPMAlex Williams2019-04-021-4/+12
| | | | | | | | | | Occasionally, MPM would check its links before the kernel would report link up, and it would then shave those ports off the CHDR link list prematurely. This commit adds a second of wait to allow the kernel time to respond. It also includes some additional reporting of link status, since Intel PMDs may report a misleading initial state upon bring-up.
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-085-5/+5
| | | | Updating all SPDX license identifiers to include "-or-later"
* transport: udp: Fix buffer size warningLars Amsel2019-02-271-2/+2
| | | | | | When using a buffer size smaller than recommended, a warning would be printed with the wrong value (it would print the default value, not the actual value).
* uhd: Replace all usage of boost::noncopyable with uhd::noncopyableMartin Braun2019-02-152-7/+7
| | | | | | This fixes the build errors that occur due to switching locations of noncopyable.hpp within Boost, and also allows us to remove boost::noncopyable in one fell swoop.
* uhd-dpdk: Cover all paths to request TX offloadsAlex Williams2019-01-253-11/+61
| | | | | Some NICs were not enabling TX IP checksum offloads. This fixes that issue.
* uhd-dpdk: Delete useless test folderAlex Williams2019-01-252-356/+0
| | | | This was old code that wouldn't compile or run anymore.
* mpmd,transport,prefs: Add xport_mgr for dpdk_zero_copyAlex Williams2019-01-2510-285/+558
| | | | | | | | | | | | | | | | | | | | | | | Add configuration sections to the UHD config file for NIC entries. Keys are based on MAC addresses, and the entries beneath the section describe which CPU and I/O thread to use for the NIC and its IPv4 address. Make ring sizes configurable for uhd-dpdk. Ring size is now an argument for packet buffers. Note that the maximum number of available buffers is still determined at init! Add ability to receive broadcasts to uhd-dpdk. This is controllable by a boolean in the sockarg during socket creation. dpdk_zero_copy will filter broadcast packets out. Add dpdk_simple transport (to mirror udp_simple). This transport allows receiving from broadcast addresses, but it only permits one outstanding buffer at a time. Fix IP checksum handling in UHD-DPDK. TX checksums were not being calculated in the NIC, and in RX, the check for IP checksums allowed values of zero (reported as none). Now packets with bad IP checksums will be dropped.
* transport: muxed_zero_copy_if fixesmichael-west2019-01-211-2/+2
| | | | | | | | | | Changed muxed_zero_copy_if to make each stream buffer the same number of frames as the underlying transport and changed the size of the underlying control transport for X300 and MPMD devices to match the size of the command FIFO in order to prevent starvation of any single control transport. Added some constants to remove hard coded values. Signed-off-by: michael-west <michael.west@ettus.com>
* endianness: Replace Boost macros with custom onesMartin Braun2019-01-212-3/+3
| | | | | | | | Boost changed the macros for endianness identification in 1.69, and the deprecation warning is a pretty noisy one during compilation. This abstracts away the Boost macro, so we have two UHD macros, UHD_BIG_ENDIAN and UHD_LITTLE_ENDIAN. They indicate big and little endian byte order.
* lib: transport: Revert to boost instead of std sleepSugandha Gupta2019-01-181-3/+1
| | | | | | std::sleep_for causes issues with priority threading when running examples in embedded mode on some devices (E310). boost::sleep_for does not have this problem.
* lib: transport: apply clang-formatBrent Stapleton2019-01-1825-2326/+2745
| | | | | | | | | | This is a continuation of 967be2a4. $ find host/lib/transport -iname *.hpp -o -iname *.cpp |\ xargs clang-format -i -style=file Skipping host/lib/transport/nirio/ because of build errors. $ git checkout host/lib/transport/nirio
* transport: Move uhd-dpdk header to uhdlibAlex Williams2019-01-153-3/+3
|
* transport: Add dpdk_zero_copy transportAlex Williams2019-01-153-0/+527
| | | | | This transport is based on uhd-dpdk, and it includes a global context that must be initialized prior to creating any dpdk_zero_copy objects.
* transport: Add blocking recv calls to uhd-dpdkAlex Williams2019-01-1510-218/+690
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an internal wait queue API to uhd-dpdk. Socket configuration requests had their blocking calls re-implemented on top of this API, and it is also used to service requests to wait on RX packets (w/ timeout). The wait API involves a multi-producer, single-consumer queue per I/O thread (waiter_ring), with a condition variable used for sleeping. The data structure is shared between user thread and I/O thread, and because timeouts make resource release time non-deterministic, we use reference counting on the shared resource. One reference is generated by the user thread and passed to the I/O thread to consume. A user thread that still needs the data after waking must get() another reference, to postpone the destruction of the resource until it is done. Timeouts are based on CLOCK_MONOTONIC. For recv, a timeout of 0 indicates blocking indefinitely, and a negative timeout indicates no timeout is desired. Also drop timeout for closing sockets in uhd-dpdk. The timeout would allow a user thread to pre-empt the I/O thread's cleanup process. The user thread would free data structures the I/O thread still needed to function. Since this timeout is superfluous anyway, let's just get rid of it. Also add some more input checking and error reporting.
* uhd-dpdk: Add ARP responder, set MTU, and clean up APIAlex Williams2019-01-154-5/+73
| | | | | | | | | | | | Set MTU of Ethernet ports: Some NICs (like the Mellanox ones) require this to work. Add ARP responder to uhd-dpdk. Clean up pending ARP request list when done: Threads waiting for an ARP request to complete would be woken up when the request completed, but they wouldn't get removed from the list of pending requests. This fixes the issue.
* udp_wsa_zero_copy: add default xport paramsThomas Vogel2019-01-091-1/+25
|
* transport: Fix MSVC warning by replacing size_t with uint32_tMartin Braun2019-01-031-1/+1
| | | | This fixes a C4267 which pops up a lot when compiling UHD with MSVC.
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-143-67/+67
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* UHD: Fix RX streamer SOB and EOB handlingMichael West2018-10-241-2/+9
|
* usb: fix dummy compilation in msvcMark Meserve2018-09-141-0/+8
|
* udp_zero_copy: add default xport params.Trung Tran2018-09-131-14/+58
|
* uhd-dpdk: Add DPDK-based sockets-like libraryAlex Williams2018-08-2912-2/+2252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This library makes available a userspace network stack with a socket-like interface for applications (except the sockets pass around pointers to buffers and use the buffers directly--It's sockets + a put/get for buffer management). Supported services are ARP and UDP. Destinations can be unicast or broadcast. Multicast is not currently supported. The implementation has two driver layers. The upper layer runs within the caller's context. The caller will make requests through lockless ring buffers (including socket creation and packet transmission), and the lower layer will implement the requests and provide a response. Currently, the lower layer runs in a separate I/O thread, and the caller will block until it receives a response. The I/O thread's main body is in src/uhd_dpdk_driver.c. You'll find that all I/O thread functions are prefixed by an underscore, and user thread functions do not. src/uhd_dpdk.c is used to initialize uhd-dpdk and bring up the network interfaces. src/uhd_dpdk_fops.c and src/uhd_dpdk_udp.c are for network services. The test is a benchmark of a flow control loop using a certain made-up protocol with credits and sequence number tracking.
* uhd: udp: 'all_matching' endpoint resolutionBrent Stapleton2018-08-291-1/+2
| | | | | | | | By default, Boost.ASIO uses 'address_configured' mode for UDP endpoint resolution, which "only return[s] IPv4 addresses if a non-loopback IPv4 address is configured for the system". This changes the resolver to use 'all_matching', which instead returns "all matching IPv6 and IPv4 addresses".
* nirio: Demote RPC client cancel/abort to TRACEMartin Braun2018-08-211-1/+1
| | | | | | This is a common message that will always occur during device init when there is no RIO device available. Because it looks like an error, it confuses people and was thus reduced to TRACE.
* X300: Change Ethernet bufferingMichael West2018-07-254-29/+44
| | | | | | | Ethernet buffering is now done so that most of the buffering is done in the socket buffers and multiple frames are only used to support the receive side offload of the socket I/O. Eliminates dropped packets at high full duplex rates.
* rx_streamer: Release buffers no longer neededMichael West2018-07-251-9/+26
| | | | | This is to allow for num_recv_frames=1 and reduce conversions from ticks to time_spec_t to improve critical path performance.
* Device3: Change packet-based flow control to byte-based flow controlMartin Braun2018-07-255-105/+92
|
* liberio_zero_copy: add tx and rx mutexesTrung Tran2018-06-181-1/+6
|
* lib: Purge all references to boost::this_thread::sleep()Martin Braun2018-04-307-15/+21
| | | | Replace with std::this_thread::sleep_for().
* Correctly set end of burst flag in metadata.Vidush2018-04-301-0/+2
|
* lib: Unbreak build against Boost 1.67Jan Beich2018-04-181-1/+1
| | | | | Some uses of boost::posix_time were incorrect and would cause compiler errors on Boost 1.67.