Lines Matching +full:rx +full:- +full:queues +full:- +full:to +full:- +full:use

1 .. SPDX-License-Identifier: GPL-2.0
4 io_uring zero copy Rx
10 io_uring zero copy Rx (ZC Rx) is a feature that removes kernel-to-user copy on
11 the network receive path, allowing packet data to be received directly into
12 userspace memory. This feature is different to TCP_ZEROCOPY_RECEIVE in that
13 there are no strict alignment requirements and no need to mmap()/munmap().
14 Compared to kernel bypass solutions such as e.g. DPDK, the packet headers are
20 Several NIC HW features are required for io_uring ZC Rx to work. For now the
24 -----------------
26 Required to split packets at the L4 boundary into a header and a payload.
31 -------------
33 Specific HW Rx queues are configured for this feature, but modern NICs
34 typically distribute flows across all HW Rx queues. Flow steering is required
35 to ensure that only desired flows are directed towards HW queues that are
36 configured for io_uring ZC Rx.
39 ---
41 In addition to flow steering above, RSS is required to steer all other non-zero
42 copy flows away from queues that are configured for io_uring ZC Rx.
48 ---------
52 Ensure there are at least two queues::
54 ethtool -L eth0 combined 2
58 ethtool -G eth0 tcp-data-split on
60 Carve out half of the HW Rx queues for zero copy using RSS::
62 ethtool -X eth0 equal 1
64 Set up flow steering, bearing in mind that queues are 0-indexed::
66 ethtool -N eth0 flow-type tcp6 ... action 1
69 --------------
71 This section describes the low level io_uring kernel API. Please refer to
72 liburing documentation for how to use the higher level API.
81 ------------------
91 ------------------
105 /* align to page size */
106 ring_size = (ring_size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
108 Register ZC Rx
109 --------------
139 ---------------
154 --------------
162 sqe->ioprio |= IORING_RECV_MULTISHOT;
177 unsigned long mask = (1ULL << IORING_ZCRX_AREA_SHIFT) - 1;
178 unsigned char *data = area_ptr + (rcqe->off & mask);
186 -----------------
188 Return buffers back to the kernel to be used again::
191 unsigned mask = refill_ring.ring_entries - 1;
194 unsigned long area_offset = rcqe->off & ~IORING_ZCRX_AREA_MASK;
195 rqe->off = area_offset | area_reg.rq_area_token;
196 rqe->len = cqe->res;
202 See ``tools/testing/selftests/drivers/net/hw/iou-zcrx.c``