Editing
Core Offloads
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Functional === Some features are covered by open source functional tests. This testsuite is partial. We strongly encourage organizations to open source their test suites and suggest these for inclusion here. <span id="receive-header-split-1"></span> ===== Receive Header-Split ===== Header-split is not a user-facing feature. But, we can verify its implementation by testing a feature that is dependent on HS. Linux TCP_RECEIVE_ZEROCOPY, as described in the MTU section, depends on header-split to store payload page-aligned in page-sized buffers. TCP_ZEROCOPY_RECEIVE further requires the administrator to choose MTU such that MSS is 4KB plus room for expected TCP options, and by posting 4KB pages as buffers to the device receive queue. Linux v6.3 '''tools/testing/selftests/net/tcp_mmap''' tests this feature. Limitations are that the test does not differentiate between header-split and fixed-prefix split, and does not cover all possible TCP options. The '''hsplit_packets''' device counter must also match the expected packet rate of the test. <span id="toeplitz-receive-hash"></span> ===== Toeplitz Receive Hash ===== Linux v6.3 '''tools/testing/selftests/net/toeplitz.sh '''verifies the Toeplitz hash implementation by receiving whole packets up to userspace (using PF_PACKET sockets), along with the hash as returned by the device. The test manually recomputes the hash in software and compares the two. Microsoft RSS documentation~[ref_id:ms_rss] lists a set of example inputs with expected output hash values. The software implementation in Linux kernel tools/testing/selftests/toeplitz.c and the example code in this spec have been verified to pass that test. A vendor may test these exact packets, or test arbitrary packets against the toeplitz.c software implementation. <span id="receive-side-scaling-2"></span> ===== Receive Side Scaling ===== Linux v6.3 '''tools/testing/selftests/net/toeplitz.sh''' also verifies RSS queue selection if argument -rss is passed. In this mode it uses Linux PACKET_FANOUT_CPU to detect the CPU on which packets arrive. Beyond the Toeplitz algorithm, this test also verifies the modulo operation that the device must use to convert the 32-bit Toeplitz hash value into a queue number. <span id="checksum-offload"></span> ===== Checksum Offload ===== Linux v6.3 '''tools/testing/selftests/net/csum.c''' verifies receive and transmit checksum offload. On receive, it tests both correct and corrupted checksums. On transmit, it tests checksum offload, UDP zero checksum conversion, checksum disabled and transport mode encapsulation. The test covers IPv4 and IPv6, TCP and UDP. The process is started on two machines. See comments in the source file header for invocation details. <span id="tcp-segmentation-offload-1"></span> ===== TCP Segmentation Offload ===== '''github.com/wdebruij/kerneltools/blob/master/tests/tso.c''' can deterministically craft TSO packets of specific size and content. A full testsuite that uses this to test all interesting cases is a work in progress. Common case TSO packets can be tested by generating a TCP stream and measuring byte- and packet counts. This requires care: packet count as reported by the device must report counts after segmentation, so cannot be used to report the number of TSO packets. On Linux, packets observed with tcpdump or similar tools are observed before TSO, but also before possible software segmentation, so cannot be trusted. The correct counter is the device '''lso_counter'''. Additionally it is possible to count the number of ndo_start_xmit invocations using ftrace. <span id="udp-segmentation-offload-1"></span> ===== UDP Segmentation Offload ===== Linux v6.3 '''tools/testing/selftests/net/udpgso_bench_[rt]x.c''' implements both a sender and receiver side for a two-machine test. It can send UDP traffic with and without USO and thus can be used to exercise the USO hardware block. Tests can be performed with various optional features at multiple segmentation sizes. We recommend testing boundary conditions along with common MSS (1500B, 4K, jumbo). The accompanying '''udpgso.sh''' and '''udpgso_bench.sh''' scripts list the relevant boundary test cases (but exercise the software implementation themselves). <span id="receive-segment-coalescing"></span> ===== Receive Segment Coalescing ===== Linux v6.3 '''tools/testing/selftests/net/gro.c''' implements both a sender and receiver side for a two-machine test. The sender sends a train of packets in quick succession, the receiver verifies that they are coalesced or not, in accordance with the RSC rules. Test cases cover IP (e.g., ToS), TCP (e.g., sequence number) and more. RSC tests are inherently timing dependent. We recommend testing with the maximum RSC context timeout available. <span id="earliest-departure-time-1"></span> ===== Earliest Departure Time ===== Linux v6.3 '''tools/testing/selftests/net/so_txtime.c '''implements both a sender and receiver side for a transmit test. The sender transmits UDP packets with an earliest delivery time configured with the SO_TXTIME socket option. The receiver validates arrival rate against expectations. Testing delivery time requires tight clock synchronization. The test can be run on a single machine. Either with two devices, or with a single device by configuring two IPVLAN virtual devices in separate network namespaces. Aside from exercising physical hardware, the setup is similar to that in the accompanying '''so_txtime.sh''', which only differs by using entirely virtual devices to test software pacing. Testing delivery time requires packets arriving with EDT timestamp unmodified at the driver. This requires EDT support from the Linux queueing discipline (qdisc). '''so_txtime.sh''' demonstrates software EDT with the FQ and ETF qdiscs. ETF also supports hardware offload in Linux v6.3. At the time of writing hardware offload for FQ is in development. <span id="timestamping"></span> ===== Timestamping ===== Linux v6.3 '''tools/testing/selftests/net''' contains multiple tests that exercise the control and datapath Linux timestamping APIs, SIOC[GS]HWTSTAMP and SO_TIMESTAMPING. But it currently lacks a true regression test for hardware timestamps. This is a gap in this test suite that still needs to be completed. '''github.com/wdebruij/kerneltools/blob/master/tests/tstamp.c''' requests and parses software and hardware, receive and transmit, IPv4 and IPv6, TCP and UDP timestamps. It needs to be run for all these cases. <span id="correctness"></span> ====== Correctness ====== Failure to maintain causality can be detected, both for multiple packets at the same measurement point, and for a single packet at multiple measurement points. Clock drift can be measured. Open source conformance tests for these invariants are also future work. <span id="telemetry"></span> ===== Telemetry ===== Packet and byte counters can be observed with <code>ip -s -s link show dev $DEV</code>. At a minimum, these counters must be verified to match the actual data transmission. One way is to compare this data with data obtained with ftrace instrumentation on ndo_start_xmit. <span id="performance"></span>
Summary:
Please note that all contributions to OpenCompute may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
OpenCompute:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information