Home
last modified time | relevance | path

Searched +full:xdp +full:- +full:rx +full:- +full:metadata (Results 1 – 25 of 46) sorted by relevance

12

/linux/Documentation/networking/
H A Dxdp-rx-metadata.rst1 .. SPDX-License-Identifier: GPL-2.0
4 XDP RX Metadata
7 This document describes how an eXpress Data Path (XDP) program can access
8 hardware metadata related to a packet using a set of helper functions,
9 and how it can pass that metadata on to other consumers.
14 XDP has access to a set of kfuncs to manipulate the metadata in an XDP frame.
15 Every device driver that wishes to expose additional packet metadata can
16 implement these kfuncs. The set of kfuncs is declared in ``include/net/xdp.h``
20 metadata is supported, this set will grow:
22 .. kernel-doc:: net/core/xdp.c
[all …]
H A Dxsk-tx-metadata.rst1 .. SPDX-License-Identifier: GPL-2.0
4 AF_XDP TX Metadata
8 via :doc:`af_xdp`. Refer to :doc:`xdp-rx-metadata` on how to access similar
9 metadata on the receive side.
14 The headroom for the metadata is reserved via ``tx_metadata_len`` and
15 ``XDP_UMEM_TX_METADATA_LEN`` flag in ``struct xdp_umem_reg``. The metadata
17 The metadata layout is a fixed UAPI, refer to ``union xsk_tx_metadata`` in
25 The headroom and the metadata itself should be located right before
26 ``xdp_desc->addr`` in the umem frame. Within a frame, the metadata
31 +-----------------+---------+----------------------------+
[all …]
/linux/Documentation/netlink/specs/
H A Dnetdev.yaml1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2 ---
9 -
11 name: xdp-act
12 render-max: true
14 -
17 XDP features set supported by all drivers
19 -
23 -
24 name: ndo-xmit
[all …]
H A Drt-link.yaml1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2 ---
3 name: rt-link
4 protocol: netlink-raw
5 uapi-header: linux/rtnetlink.h
12 -
13 name: ifinfo-flags
16 enum-name: net-device-flags
17 name-prefix: iff-
19 -
[all …]
/linux/include/net/libeth/
H A Dxsk.h1 /* SPDX-License-Identifier: GPL-2.0-only */
7 #include <net/libeth/xdp.h>
18 * libeth_xsk_tx_queue_head - internal helper for queueing XSk ``XDP_TX`` head
19 * @bq: XDP Tx bulk to queue the head frag to
20 * @xdp: XSk buffer with the head to queue
25 struct libeth_xdp_buff *xdp) in libeth_xsk_tx_queue_head() argument
27 bq->bulk[bq->count++] = (typeof(*bq->bulk)){ in libeth_xsk_tx_queue_head()
28 .xsk = xdp, in libeth_xsk_tx_queue_head()
29 __libeth_xdp_tx_len(xdp->base.data_end - xdp->data, in libeth_xsk_tx_queue_head()
33 if (likely(!xdp_buff_has_frags(&xdp->base))) in libeth_xsk_tx_queue_head()
[all …]
H A Dxdp.h1 /* SPDX-License-Identifier: GPL-2.0-only */
10 #include <net/libeth/rx.h>
15 * Defined as bits to be able to use them as a mask on Rx.
28 * pick maximum pointer-compatible alignment.
36 * struct libeth_xdp_buff - libeth extension over &xdp_buff
39 * @desc: RQ descriptor containing metadata for this buffer
40 * @priv: driver-private scratchspace
43 * to quickly get frame metadata from xdpmo and driver buff-to-xdp callbacks
45 * Pointer/layout-compatible with &xdp_buff and &xdp_buff_xsk.
58 offsetof(struct xdp_buff_xsk, xdp.data));
[all …]
H A Drx.h1 /* 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
[all …]
/linux/include/net/
H A Dxdp.h1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* include/net/xdp.h
17 * DOC: XDP RX-queue information
19 * The XDP RX
92 xdp_buff_has_frags(const struct xdp_buff * xdp) xdp_buff_has_frags() argument
97 xdp_buff_set_frags_flag(struct xdp_buff * xdp) xdp_buff_set_frags_flag() argument
102 xdp_buff_clear_frags_flag(struct xdp_buff * xdp) xdp_buff_clear_frags_flag() argument
108 xdp_buff_is_frag_pfmemalloc(const struct xdp_buff * xdp) xdp_buff_is_frag_pfmemalloc() argument
113 xdp_buff_set_frag_pfmemalloc(struct xdp_buff * xdp) xdp_buff_set_frag_pfmemalloc() argument
119 xdp_init_buff(struct xdp_buff * xdp,u32 frame_sz,struct xdp_rxq_info * rxq) xdp_init_buff() argument
127 xdp_prepare_buff(struct xdp_buff * xdp,unsigned char * hard_start,int headroom,int data_len,const bool meta_valid) xdp_prepare_buff() argument
144 xdp_data_hard_end(xdp) global() argument
149 xdp_get_shared_info_from_buff(const struct xdp_buff * xdp) xdp_get_shared_info_from_buff() argument
155 xdp_get_buff_len(const struct xdp_buff * xdp) xdp_get_buff_len() argument
190 __xdp_buff_add_frag(struct xdp_buff * xdp,netmem_ref netmem,u32 offset,u32 size,u32 truesize,bool try_coalesce) __xdp_buff_add_frag() argument
244 xdp_buff_add_frag(struct xdp_buff * xdp,netmem_ref netmem,u32 offset,u32 size,u32 truesize) xdp_buff_add_frag() argument
350 xdp_convert_frame_to_buff(const struct xdp_frame * frame,struct xdp_buff * xdp) xdp_convert_frame_to_buff() argument
361 xdp_update_frame_from_buff(const struct xdp_buff * xdp,struct xdp_frame * xdp_frame) xdp_update_frame_from_buff() argument
391 xdp_convert_buff_to_frame(struct xdp_buff * xdp) xdp_convert_buff_to_frame() argument
498 xdp_set_data_meta_invalid(struct xdp_buff * xdp) xdp_set_data_meta_invalid() argument
504 xdp_data_meta_unsupported(const struct xdp_buff * xdp) xdp_data_meta_unsupported() argument
647 bpf_prog_run_xdp(const struct bpf_prog * prog,struct xdp_buff * xdp) bpf_prog_run_xdp() argument
[all...]
H A Dxdp_sock.h1 /* SPDX-License-Identifier: GPL-2.0 */
51 struct xsk_queue *rx ____cacheline_aligned_in_smp;
95 * AF_XDP TX metadata hooks for network devices.
125 int xsk_generic_rcv(struct xdp_sock *xs, struct xdp_buff *xdp);
126 int __xsk_map_redirect(struct xdp_sock *xs, struct xdp_buff *xdp);
130 * xsk_tx_metadata_to_compl - Save enough relevant metadata information
132 * @meta: pointer to AF_XDP metadata area
145 if (meta->flags & XDP_TXMD_FLAGS_TIMESTAMP) in xsk_tx_metadata_to_compl()
146 compl->tx_timestamp = &meta->completion.tx_timestamp; in xsk_tx_metadata_to_compl()
148 compl->tx_timestamp = NULL; in xsk_tx_metadata_to_compl()
[all …]
/linux/include/uapi/linux/
H A Dif_xdp.h1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * if_xdp: XDP socket user-space interface
17 #define XDP_COPY (1 << 1) /* Force copy-mode */
18 #define XDP_ZEROCOPY (1 << 2) /* Force zero-copy mode */
22 * driver with a poll() (Rx and Tx) or sendto() (Tx only). If you are
30 * multi-buffer XDP frames into multiple Rx descriptors. Without this set
44 /* Request to reserve tx_metadata_len bytes of per-chunk metadata.
67 struct xdp_ring_offset rx; member
73 /* XDP socket options */
97 __u64 rx_ring_full; /* Dropped due to rx ring being full */
[all …]
/linux/tools/include/uapi/linux/
H A Dif_xdp.h1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * if_xdp: XDP socket user-space interface
17 #define XDP_COPY (1 << 1) /* Force copy-mode */
18 #define XDP_ZEROCOPY (1 << 2) /* Force zero-copy mode */
22 * driver with a poll() (Rx and Tx) or sendto() (Tx only). If you are
30 * multi-buffer XDP frames into multiple Rx descriptors. Without this set
44 /* Request to reserve tx_metadata_len bytes of per-chunk metadata.
67 struct xdp_ring_offset rx; member
73 /* XDP socket options */
97 __u64 rx_ring_full; /* Dropped due to rx ring being full */
[all …]
/linux/drivers/net/ethernet/intel/libeth/
H A Dxdp.c1 // SPDX-License-Identifier: GPL-2.0-only
8 #include <net/libeth/xdp.h>
22 spin_lock_init(&lock->lock); in __libeth_xdpsq_get()
23 lock->share = true; in __libeth_xdpsq_get()
29 netdev_warn(dev, "XDPSQ sharing enabled, possible XDP Tx slowdown\n"); in __libeth_xdpsq_get()
41 lock->share = false; in __libeth_xdpsq_put()
45 void __acquires(&lock->lock)
48 spin_lock(&lock->lock); in __libeth_xdpsq_lock()
52 void __releases(&lock->lock)
55 spin_unlock(&lock->lock); in __libeth_xdpsq_unlock()
[all …]
/linux/drivers/net/ethernet/engleder/
H A Dtsnep_main.c1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2021 Gerhard Engleder <gerhard@engleder-embedded.com> */
6 * The TSN endpoint Ethernet MAC is a FPGA based network device for real-time
10 * It supports multiple TX/RX queue pairs. The first TX/RX queue pair is used
14 * - www.embedded-experts.at/tsn
15 * - www.engleder-embedded.com
36 #define TSNEP_MAX_RX_BUF_SIZE (PAGE_SIZE - TSNEP_HEADROOM - \
38 /* XSK buffer shall store at least Q-in-Q frame */
52 ECM_INT_DELAY_BASE_US + ECM_INT_DELAY_BASE_US - 1)
78 iowrite32(mask, adapter->addr + ECM_INT_ENABLE); in tsnep_enable_irq()
[all …]
/linux/drivers/net/ethernet/sfc/siena/
H A Drx.c1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright 2005-2006 Fen Systems Ltd.
5 * Copyright 2005-2013 Solarflare Communications Inc.
20 #include <net/xdp.h>
33 /* Maximum rx prefix used by any architecture. */
47 struct efx_nic *efx = rx_queue->efx; in efx_rx_packet__check_len()
48 unsigned max_len = rx_buf->len - efx->type->rx_buffer_padding; in efx_rx_packet__check_len()
56 rx_buf->flags |= EFX_RX_PKT_DISCARD; in efx_rx_packet__check_len()
59 netif_err(efx, rx_err, efx->net_dev, in efx_rx_packet__check_len()
60 "RX queue %d overlength RX event (%#x > %#x)\n", in efx_rx_packet__check_len()
[all …]
/linux/drivers/net/ethernet/amazon/ena/
H A Dena_netdev.h1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
3 * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
17 #include <net/xdp.h>
61 #define ENA_DEFAULT_RX_COPYBREAK (256 - NET_IP_ALIGN)
78 /* Refill Rx queue when number of required descriptors is above
89 #define ENA_TX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1))
91 #define ENA_RX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1))
93 (((idx) + (n)) & ((ring_size) - 1))
98 #define ENA_IO_RXQ_IDX_TO_COMBINED_IDX(q) (((q) - 1) / 2)
138 /* XDP buffer structure which is used for sending packets in
[all …]
/linux/tools/testing/selftests/bpf/
H A Dxdp_hw_metadata.c1 // SPDX-License-Identifier: GPL-2.0
3 /* Reference program for verifying XDP metadata on real HW. Functional test
6 * RX:
7 * - UDP 9091 packets are diverted into AF_XDP
8 * - Metadata verified:
9 * - rx_timestamp
10 * - rx_hash
13 * - UDP 9091 packets trigger TX reply
14 * - TX HW timestamp is requested and reported back upon completion
15 * - TX checksum is requested
[all …]
/linux/tools/net/ynl/samples/
H A Dnetdev.c1 // SPDX-License-Identifier: GPL-2.0
9 #include "netdev-user.h"
24 if (!d->_present.ifindex) in netdev_print_device()
27 name = if_indextoname(d->ifindex, ifname); in netdev_print_device()
30 printf("[%d]\t", d->ifindex); in netdev_print_device()
32 if (!d->_present.xdp_features) in netdev_print_device()
35 printf("xdp-features (%llx):", d->xdp_features); in netdev_print_device()
36 for (int i = 0; d->xdp_features >= 1U << i; i++) { in netdev_print_device()
37 if (d->xdp_features & (1U << i)) in netdev_print_device()
41 printf(" xdp-rx-metadata-features (%llx):", d->xdp_rx_metadata_features); in netdev_print_device()
[all …]
/linux/drivers/net/ethernet/meta/fbnic/
H A Dfbnic_txrx.h1 /* SPDX-License-Identifier: GPL-2.0 */
11 #include <net/xdp.h>
19 * + 2 descriptors for metadata and optional metadata
28 * 1 descriptor for primary metadata
29 * + 1 descriptor for optional metadata
54 (ALIGN(FBNIC_RX_TROOM + NET_SKB_PAD, 128) - FBNIC_RX_TROOM)
56 #define FBNIC_RX_MAX_HDR (1536 - FBNIC_RX_PAD)
88 } rx; member
112 u16 size_mask; /* Size of ring in descriptors - 1 */
171 return nv->v_idx - FBNIC_NON_NAPI_VECTORS; in fbnic_napi_idx()
/linux/tools/testing/selftests/bpf/progs/
H A Dxdp_metadata.c1 // SPDX-License-Identifier: GPL-2.0
37 SEC("xdp") in rx()
38 int rx(struct xdp_md *ctx) in rx()
46 u64 timestamp = -1; in rx()
49 data = (void *)(long)ctx->data; in rx()
50 data_end = (void *)(long)ctx->data_end; in rx()
53 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in rx()
55 if (iph + 1 < data_end && iph->protoco in rx()
31 int rx(struct xdp_md *ctx) rx() function
[all...]
/linux/drivers/net/ethernet/intel/igc/
H A Digc.h1 /* SPDX-License-Identifier: GPL-2.0 */
18 #include <net/xdp.h>
120 struct xsk_tx_metadata_compl xsk_meta; /* ref to xsk Tx metadata */
194 /* RX */
225 /* RX */
322 /* Free-running timer lock */
326 struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
372 /* AF_XDP TX metadata operations */
409 /* RX-desc Write-Back format RSS Type's */
424 #define IGC_RSS_TYPE_MASK GENMASK(3,0) /* 4-bits (3:0) = mask 0x0F */
[all …]
/linux/Documentation/networking/device_drivers/ethernet/meta/
H A Dfbnic.rst1 .. SPDX-License-Identifier: GPL-2.0+
8 -----------------
13 1. fw - The control firmware used to view and modify firmware settings, request
16 2. bootloader - The firmware which validate firmware security and control basic
19 3. undi - This is the UEFI driver which is based on the Linux driver.
32 -------------
34 Ringparams (ethtool -g / -G)
37 fbnic has two submission (host -> device) rings for every completion
38 (device -> host) ring. The three ring objects together form a single
39 "queue" as used by higher layer software (a Rx, or a Tx queue).
[all …]
/linux/drivers/net/ethernet/fungible/funeth/
H A Dfuneth_rx.c1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
4 #include <linux/dma-mapping.h>
22 /* Per packet headroom in non-XDP mode. Present only for 1-frag packets. */
40 if (unlikely(buf->pg_refs < MIN_PAGE_REFS)) { in refresh_refs()
41 buf->pg_refs += EXTRA_PAGE_REFS; in refresh_refs()
42 page_ref_add(buf->page, EXTRA_PAGE_REFS); in refresh_refs()
46 /* Offer a buffer to the Rx buffer cache. The cache will hold the buffer if its
52 struct funeth_rx_cache *c = &q->cache; in cache_offer()
54 if (c->prod_cnt - c->cons_cnt <= c->mask && buf->node == numa_mem_id()) { in cache_offer()
55 c->bufs[c->prod_cnt & c->mask] = *buf; in cache_offer()
[all …]
/linux/drivers/net/ethernet/netronome/nfp/
H A Dnfp_net.h1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2015-2018 Netronome Systems, Inc. */
21 #include <linux/io-64-nonatomic-hi-lo.h>
24 #include <net/xdp.h>
32 if (__nn->dp.netdev) \
33 netdev_printk(lvl, __nn->dp.netdev, fmt, ## args); \
35 dev_printk(lvl, __nn->dp.dev, "ctrl: " fmt, ## args); \
48 if (__dp->netdev) \
49 netdev_warn(__dp->netdev, fmt, ## args); \
51 dev_warn(__dp->dev, fmt, ## args); \
[all …]
/linux/drivers/net/ethernet/qlogic/qede/
H A Dqede.h1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
3 * Copyright (c) 2015-2017 QLogic Corporation
4 * Copyright (c) 2019-2020 Marvell International Ltd.
16 #include <net/xdp.h>
177 &(edev)->flags)
184 #define QEDE_MAX_RSS_CNT(edev) ((edev)->dev_info.num_queues)
185 #define QEDE_MAX_TSS_CNT(edev) ((edev)->dev_info.num_queues)
187 ((edev)->dev_info.common.dev_type == QED_DEV_TYPE_BB)
189 ((edev)->dev_info.common.dev_type == QED_DEV_TYPE_AH)
201 #define QEDE_QUEUE_CNT(edev) ((edev)->num_queues)
[all …]
/linux/drivers/net/
H A Dveth.c1 // SPDX-License-Identifier: GPL-2.0-only
22 #include <net/xdp.h>
45 /* xdp */
124 struct xdp_buff xdp; member
131 cmd->base.speed = SPEED_10000; in veth_get_link_ksettings()
132 cmd->base.duplex = DUPLEX_FULL; in veth_get_link_ksettings()
133 cmd->base.port = PORT_TP; in veth_get_link_ksettings()
134 cmd->base.autoneg = AUTONEG_DISABLE; in veth_get_link_ksettings()
140 strscpy(info->driver, DRV_NAME, sizeof(info->driver)); in veth_get_drvinfo()
141 strscpy(info->version, DRV_VERSION, sizeof(info->version)); in veth_get_drvinfo()
[all …]

12