Lines Matching +full:xdp +full:- +full:rx +full:- +full:metadata
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2024-2025 Intel Corporation */
10 #include <net/xdp.h>
12 /* Rx buffer management */
18 /* Maximum headroom for worst-case calculations */
22 /* Maximum supported L2-L4 header length */
25 /* Always use order-0 pages */
29 /* HW-writeable space in one buffer: truesize - headroom/tailroom, aligned */
35 * struct libeth_fqe - structure representing an Rx buffer (fill queue element)
40 * Depending on the MTU, API switches between one-page-per-frame and shared
41 * page model (to conserve memory on bigger-page platforms). In case of the
51 * enum libeth_fqe_type - enum representing types of Rx buffers
54 * @LIBETH_FQE_HDR: buffer size is ```LIBETH_MAX_HEAD```-sized, for headers
63 * struct libeth_fq - structure representing a buffer (fill) queue
66 * @fqes: array of Rx buffers
71 * @xdp: flag indicating whether XDP is enabled
72 * @buf_len: HW-writeable length per each buffer
87 bool xdp:1; member
97 * libeth_rx_alloc - allocate a new Rx buffer
101 * Return: DMA address to be passed to HW for Rx on successful allocation,
106 struct libeth_fqe *buf = &fq->fqes[i]; in libeth_rx_alloc()
108 buf->truesize = fq->truesize; in libeth_rx_alloc()
109 buf->netmem = page_pool_dev_alloc_netmem(fq->pp, &buf->offset, in libeth_rx_alloc()
110 &buf->truesize); in libeth_rx_alloc()
111 if (unlikely(!buf->netmem)) in libeth_rx_alloc()
114 return page_pool_get_dma_addr_netmem(buf->netmem) + buf->offset + in libeth_rx_alloc()
115 fq->pp->p.offset; in libeth_rx_alloc()
121 * libeth_rx_sync_for_cpu - synchronize or recycle buffer post DMA
134 netmem_ref netmem = fqe->netmem; in libeth_rx_sync_for_cpu()
146 fqe->offset, len); in libeth_rx_sync_for_cpu()
152 * the packet parameters to do O(1) lookup on Rx.
208 * struct libeth_rx_csum - checksum offload bits decoded from the Rx descriptor
237 * struct libeth_rqe_info - receive queue element info
242 * @vlan: C-VLAN or S-VLAN tag depending on the VLAN offload configuration
257 * libeth_rx_pt_get_ip_ver - get IP version from a packet type structure
263 * Return: @pt.outer_ip or stub for IPv6 when not compiled-in.
279 /* libeth_has_*() can be used to quickly check whether the HW metadata is
282 * thus can be used as drop-in replacements.
288 /* Non-zero _INNER* is only possible when _OUTER_IPV* is set, in libeth_rx_pt_has_checksum()
292 (dev->features & NETIF_F_RXCSUM)); in libeth_rx_pt_has_checksum()
299 (dev->features & NETIF_F_RXHASH)); in libeth_rx_pt_has_hash()
303 * libeth_rx_pt_set_hash - fill in skb hash value basing on the PT
305 * @hash: 32-bit hash value from the descriptor