aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport
Commit message (Collapse)AuthorAgeFilesLines
* liberio: Release context holder on destruction of last liberio xportSugandha Gupta2019-05-211-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-05-212-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-05-211-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-05-211-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.
* transport: udp: Fix buffer size warningLars Amsel2019-03-051-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-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.
* niusrprio: Move a const from header to implMartin Braun2018-04-181-0/+5
| | | | This avoids having to redeclare the static const to avoid linker errors.
* x300: Replace all references to boost::this_thread::sleep()Martin Braun2018-04-171-1/+4
| | | | Use std::this_thread::sleep_for() instead.
* niusrprio: Refactor niusrprio_session, move out static constsMartin Braun2018-04-171-3/+7
| | | | | | Static const attributes were causing linker issues the way there were being used, but they were only used in niusrprio_session.cpp and thus could be factored out.
* lib: move atomic.hpp and system_time.hpp to uhdlibMartin Braun2018-04-063-3/+3
|
* transport: Demote UDP socket buffer size log message to TRACEMartin Braun2018-03-301-1/+1
| | | | | Note: When socket buffers are incorrectly size, a WARNING is still printed.
* uhd: Move internal headers to uhdlib/Martin Braun2018-03-142-2/+2
| | | | | | | | | | | | | | | | To avoid the proliferation of additional include directories and multiple ways of including project-local headers, we now default to moving all headers that are used across UHD into the uhdlib/ subdirectory. Some #include statements were also reordered as they were modified for closer compliance with the coding guidelines. Internal cpp source files should now include files like this: #include <uhdlib/rfnoc/ctrl_iface.hpp> Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
* x300: improve lvbitx bitstream md5 read timeMark Meserve2018-03-131-10/+20
| | | | | - Reading line by line avoids loading the entire 25 MB bitstream into memory since the MD5 hash usually occurs within the first 1% of the file stream
* uhd: Update license headersMartin Braun2018-02-1941-37/+78
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* Move all license headers to SPDX format.Martin Braun2017-12-2239-682/+253
|
* Fix build with Boost 1.66ilovezfs2017-12-193-3/+3
| | | | Thanks to FX Coudert for suggesting this fix.
* transport: nirio_zero_copy: Remove redundant buffer poolsMoritz Fischer2017-10-111-5/+0
| | | | | | | Remove the redundant send/recv buffer_pools from nirio_zero_copy_impl class as no one is using them. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* transport: liberio: Check return values for liberio_chan_set_fixed_size()Moritz Fischer2017-10-101-4/+10
| | | | | | | Check return value of liberio_chan_set_fixed_size() since it can fail, and bad things happen if one just proceeds. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* transport: liberio: Fix bug with recv timeout conversionMoritz Fischer2017-10-051-3/+3
| | | | | | | | | | | | | The timeout value passed in by UHD would get multiplied by USEC, to convert from the UHD value in seconds to the liberio value in microseconds. The bug manifested itself by calling liberio_dequeue_buf() with a timeout equivalent to 100s. Fixes ed1c64c81 ('transport: Added liberio_zero_copy transport ...') Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Cc: Alex Williams <alex.williams@ni.com>
* transport: liberio: Fix indentsMoritz Fischer2017-10-051-4/+4
| | | | | | | Remove stray tabs from liberio_zero_copy transport and clarify actual code flow by fixing indent. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* udp: Modify log messages of UDP transportMartin Braun2017-10-042-10/+27
| | | | | - Remove multi-line log message for socket creation - Include local addr and port in trace messages
* udp: Added option to query local address of socketMartin Braun2017-10-042-1/+25
|
* transport: Added liberio_zero_copy transport implementationMoritz Fischer2017-08-073-0/+304
| | | | | | | | | | | | This adds a zero copy transport using the liberio library. Currently supported API version for liberio is 0.3, this might still very much break, since the library is still in development. So far nobody uses it UHD so we might as well merge it. Signed-off-by: Alex Williams <alex.williams@ni.com> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
* utils: add set_thread_name API call, move thread_priority to threadAndrej Rode2017-06-292-0/+3
|