Home
last modified time | relevance | path

Searched +full:xdp +full:- +full:rx +full:- +full:metadata (Results 1 – 25 of 39) 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/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;
94 * AF_XDP TX metadata hooks for network devices.
124 int xsk_generic_rcv(struct xdp_sock *xs, struct xdp_buff *xdp);
125 int __xsk_map_redirect(struct xdp_sock *xs, struct xdp_buff *xdp);
129 * xsk_tx_metadata_to_compl - Save enough relevant metadata information
131 * @meta: pointer to AF_XDP metadata area
144 if (meta->flags & XDP_TXMD_FLAGS_TIMESTAMP) in xsk_tx_metadata_to_compl()
145 compl->tx_timestamp = &meta->completion.tx_timestamp; in xsk_tx_metadata_to_compl()
147 compl->tx_timestamp = NULL; in xsk_tx_metadata_to_compl()
[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 an
67 struct xdp_ring_offset rx; global() member
[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 an
67 struct xdp_ring_offset rx; global() member
[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>
60 #define ENA_DEFAULT_RX_COPYBREAK (256 - NET_IP_ALIGN)
77 /* Refill Rx queue when number of required descriptors is above
88 #define ENA_TX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1))
90 #define ENA_RX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1))
92 (((idx) + (n)) & ((ring_size) - 1))
97 #define ENA_IO_RXQ_IDX_TO_COMBINED_IDX(q) (((q) - 1) / 2)
135 /* 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/Documentation/translations/zh_CN/networking/
H A Dindex.rst1 .. SPDX-License-Identifier: GPL-2.0
3 .. include:: ../disclaimer-zh_CN.rst
16 有关网络设备(netdev)开发过程的详细指南,请参考::ref:`netdev-FAQ`
29 * batman-adv
37 * ethtool-netlink
39 * iso15765-2
47 * sfp-phylink
51 * checksum-offloads
52 * segmentation-offloads
55 * tls-offload
[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/intel/igc/
H A Digc.h1 /* SPDX-License-Identifier: GPL-2.0 */
18 #include <net/xdp.h>
119 struct xsk_tx_metadata_compl xsk_meta; /* ref to xsk Tx metadata */
192 /* RX */
223 /* RX */
320 /* Free-running timer lock */
324 struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
370 /* AF_XDP TX metadata operations */
410 /* RX-desc Write-Back format RSS Type's */
425 #define IGC_RSS_TYPE_MASK GENMASK(3,0) /* 4-bits (3:0) = mask 0x0F */
[all …]
/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/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
114 u16 size_mask; /* Size of ring in descriptors - 1 */
176 return nv->v_idx - FBNIC_NON_NAPI_VECTORS; in fbnic_napi_idx()
/linux/Documentation/netlink/specs/
H A Drt-link.yaml1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
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 -
21 -
[all …]
/linux/tools/testing/selftests/net/
H A Dnl_netdev.py2 # SPDX-License-Identifier: GPL-2.0
10 def empty_check(nf) -> None:
15 def lo_check(nf) -> None:
17 ksft_eq(len(lo_info['xdp-features']), 0)
18 ksft_eq(len(lo_info['xdp-rx-metadata-features']), 0)
21 def napi_list_check(nf) -> None:
38 def nsim_rxq_reset_down(nf) -> None:
53 def page_pool_check(nf) -> None:
96 attached = [pp for pp in pp_list if "detach-time" not in pp]
102 attached = [pp for pp in pp_list if "detach-time" not in pp]
[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 …]
H A Dnfp_net_common.c1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 /* Copyright (C) 2015-2019 Netronome Systems, Inc. */
59 * nfp_net_get_fw_version() - Read and parse the FW version
74 queue &= dev_info->qc_idx_mask; in nfp_qcp_queue_offset()
75 return dev_info->qc_addr_offset + NFP_QCP_QUEUE_ADDR_SZ * queue; in nfp_qcp_queue_offset()
80 * Firmware reconfig may take a while so we have two versions of it -
89 nfp_qcp_wr_ptr_add(nn->qcp_cfg, 1); in nfp_net_reconfig_start()
90 nn->reconfig_in_progress_update = update; in nfp_net_reconfig_start()
96 update |= nn->reconfig_posted; in nfp_net_reconfig_start_async()
97 nn->reconfig_posted = 0; in nfp_net_reconfig_start_async()
[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 …]
H A Dxen-netfront.c4 * Copyright (c) 2002-2005, K A Fraser
81 #define NETFRONT_SKB_CB(skb) ((struct netfront_cb *)((skb)->cb))
88 /* Minimum number of Rx slots (includes slot for GSO metadata). */
91 /* Queue name is interface name with "-qNNN" appended */
94 /* IRQ name is queue name with "-tx" or "-rx" appended */
108 unsigned int id; /* Queue ID, 0-based */
109 char name[QUEUE_NAME_SIZE]; /* DEVNAME-qN */
122 char tx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-tx */
123 char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */
130 * {tx,rx}_skbs store outstanding skbuffs. Free tx_skb entries
[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/ethernet/google/gve/
H A Dgve.h1 /* SPDX-License-Identifier: (GPL-2.0 OR MIT)
4 * Copyright (C) 2015-2024 Google LLC
10 #include <linux/dma-mapping.h>
17 #include <net/xdp.h>
33 /* 1 for management, 1 for rx, 1 for tx */
36 /* Numbers of gve tx/rx stats in stats report. */
43 /* Numbers of NIC tx/rx stats in stats report. */
49 #define GVE_DATA_SLOT_ADDR_PAGE_MASK (~(PAGE_SIZE - 1))
71 (GVE_ADMINQ_BUFFER_SIZE / sizeof(((struct gve_adminq_queried_flow_rule *)0)->location))
89 /* 2K buffers for DQO-QPL */
[all …]
H A Dgve_tx.c1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
4 * Copyright (C) 2015-2021 Google, Inc.
20 iowrite32be(val, &priv->db_bar2[be32_to_cpu(q_resources->db_index)]); in gve_tx_put_doorbell()
26 struct gve_tx_ring *tx = &priv->tx[tx_qid]; in gve_xdp_tx_flush()
28 gve_tx_put_doorbell(priv, tx->q_resources, tx->req); in gve_xdp_tx_flush()
35 * gve_tx_fifo_* manages the Registered Segment as a FIFO - clients must
41 fifo->base = vmap(fifo->qpl->pages, fifo->qpl->num_entries, VM_MAP, in gve_tx_fifo_init()
43 if (unlikely(!fifo->base)) { in gve_tx_fifo_init()
44 netif_err(priv, drv, priv->dev, "Failed to vmap fifo, qpl_id = %d\n", in gve_tx_fifo_init()
45 fifo->qpl->id); in gve_tx_fifo_init()
[all …]

12