drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h- Extension
.h- Size
- 7495 bytes
- Lines
- 242
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/indirect_call_wrapper.hnet/xdp_sock.hen.hen/txrx.h
Detected Declarations
struct mlx5e_xsk_paramstruct mlx5e_xdp_wqe_infoenum mlx5e_xdp_xmit_modefunction mlx5e_xdp_tx_enablefunction mlx5e_xdp_tx_disablefunction mlx5e_xdp_tx_is_enabledfunction mlx5e_xdp_is_activefunction mlx5e_xmit_xdp_doorbellfunction cpufunction mlx5e_xdp_mpwqe_is_fullfunction mlx5e_xdp_mpwqe_add_dsegfunction mlx5e_xdpi_fifo_pushfunction mlx5e_xdpi_fifo_pop
Annotated Snippet
struct mlx5e_xdp_wqe_info {
u8 num_wqebbs;
u8 num_pkts;
};
static inline void
mlx5e_xdp_mpwqe_add_dseg(struct mlx5e_xdpsq *sq,
struct mlx5e_xmit_data *xdptxd,
struct mlx5e_xdpsq_stats *stats)
{
struct mlx5e_tx_mpwqe *session = &sq->mpwqe;
struct mlx5_wqe_data_seg *dseg =
(struct mlx5_wqe_data_seg *)session->wqe + session->ds_count;
u32 dma_len = xdptxd->len;
session->pkt_count++;
session->bytes_count += dma_len;
if (session->inline_on && dma_len <= MLX5E_XDP_INLINE_WQE_SZ_THRSD) {
struct mlx5_wqe_inline_seg *inline_dseg =
(struct mlx5_wqe_inline_seg *)dseg;
u16 ds_len = sizeof(*inline_dseg) + dma_len;
u16 ds_cnt = DIV_ROUND_UP(ds_len, MLX5_SEND_WQE_DS);
inline_dseg->byte_count = cpu_to_be32(dma_len | MLX5_INLINE_SEG);
memcpy(inline_dseg->data, xdptxd->data, dma_len);
session->ds_count += ds_cnt;
stats->inlnw++;
return;
}
dseg->addr = cpu_to_be64(xdptxd->dma_addr);
dseg->byte_count = cpu_to_be32(dma_len);
dseg->lkey = sq->mkey_be;
session->ds_count++;
}
static inline void
mlx5e_xdpi_fifo_push(struct mlx5e_xdp_info_fifo *fifo,
union mlx5e_xdp_info xi)
{
u32 i = (*fifo->pc)++ & fifo->mask;
fifo->xi[i] = xi;
}
static inline union mlx5e_xdp_info
mlx5e_xdpi_fifo_pop(struct mlx5e_xdp_info_fifo *fifo)
{
return fifo->xi[(*fifo->cc)++ & fifo->mask];
}
#endif
Annotation
- Immediate include surface: `linux/indirect_call_wrapper.h`, `net/xdp_sock.h`, `en.h`, `en/txrx.h`.
- Detected declarations: `struct mlx5e_xsk_param`, `struct mlx5e_xdp_wqe_info`, `enum mlx5e_xdp_xmit_mode`, `function mlx5e_xdp_tx_enable`, `function mlx5e_xdp_tx_disable`, `function mlx5e_xdp_tx_is_enabled`, `function mlx5e_xdp_is_active`, `function mlx5e_xmit_xdp_doorbell`, `function cpu`, `function mlx5e_xdp_mpwqe_is_full`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.