drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h- Extension
.h- Size
- 16207 bytes
- Lines
- 586
- 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
en.hlinux/indirect_call_wrapper.hnet/ip6_checksum.hnet/tcp.h
Detected Declarations
struct mlx5e_xmit_datastruct mlx5e_xmit_data_fragsstruct mlx5e_tx_wqe_infostruct mlx5e_shampo_umrstruct mlx5e_icosq_wqe_infostruct mlx5e_swp_specenum mlx5e_icosq_wqe_typefunction mlx5e_cqe_ts_to_nsfunction mlx5e_skb_is_multicastfunction mlx5e_rx_hw_stampfunction mlx5e_skb_fifo_has_roomfunction mlx5e_wqc_has_room_forfunction mlx5e_post_nopfunction mlx5e_post_nop_fencefunction mlx5e_txqsq_get_next_pifunction mlx5e_txqsq_get_next_pi_anysizefunction mlx5e_shampo_get_cqe_header_indexfunction mlx5e_icosq_get_next_pifunction mlx5e_notify_hwfunction mlx5e_cq_armfunction mlx5e_dma_getfunction mlx5e_dma_push_singlefunction mlx5e_dma_push_netmemfunction mlx5e_skb_fifo_pushfunction mlx5e_tx_dma_unmapfunction mlx5e_tx_mpwqe_is_fullfunction mlx5e_rqwq_resetfunction mlx5e_dump_error_cqefunction mlx5e_rqwq_get_sizefunction mlx5e_rqwq_get_cur_szfunction mlx5e_rqwq_get_headfunction mlx5e_rqwq_get_wqe_counterfunction mlx5e_eseg_swp_offsets_add_vlanfunction mlx5e_set_eseg_swpfunction mlx5e_swp_encap_csum_partialfunction mlx5e_stop_room_for_wqefunction mlx5e_stop_room_for_max_wqefunction mlx5e_stop_room_for_mpwqefunction mlx5e_icosq_can_post_wqe
Annotated Snippet
struct mlx5e_xmit_data {
dma_addr_t dma_addr;
void *data;
u32 len : 31;
u32 has_frags : 1;
};
struct mlx5e_xmit_data_frags {
struct mlx5e_xmit_data xd;
struct skb_shared_info *sinfo;
dma_addr_t *dma_arr;
};
netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev);
bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget);
void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq);
static inline bool
mlx5e_skb_fifo_has_room(struct mlx5e_skb_fifo *fifo)
{
return (u16)(*fifo->pc - *fifo->cc) <= fifo->mask;
}
static inline bool
mlx5e_wqc_has_room_for(struct mlx5_wq_cyc *wq, u16 cc, u16 pc, u16 n)
{
return (mlx5_wq_cyc_ctr2ix(wq, cc - pc) >= n) || (cc == pc);
}
static inline void *mlx5e_fetch_wqe(struct mlx5_wq_cyc *wq, u16 pi, size_t wqe_size)
{
void *wqe;
wqe = mlx5_wq_cyc_get_wqe(wq, pi);
memset(wqe, 0, wqe_size);
return wqe;
}
#define MLX5E_TX_FETCH_WQE(sq, pi) \
((struct mlx5e_tx_wqe *)mlx5e_fetch_wqe(&(sq)->wq, pi, sizeof(struct mlx5e_tx_wqe)))
static inline struct mlx5e_tx_wqe *
mlx5e_post_nop(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc)
{
u16 pi = mlx5_wq_cyc_ctr2ix(wq, *pc);
struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi);
struct mlx5_wqe_ctrl_seg *cseg = &wqe->ctrl;
memset(cseg, 0, sizeof(*cseg));
cseg->opmod_idx_opcode = cpu_to_be32((*pc << 8) | MLX5_OPCODE_NOP);
cseg->qpn_ds = cpu_to_be32((sqn << 8) | 0x01);
(*pc)++;
return wqe;
}
static inline struct mlx5e_tx_wqe *
mlx5e_post_nop_fence(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc)
{
u16 pi = mlx5_wq_cyc_ctr2ix(wq, *pc);
struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi);
struct mlx5_wqe_ctrl_seg *cseg = &wqe->ctrl;
memset(cseg, 0, sizeof(*cseg));
cseg->opmod_idx_opcode = cpu_to_be32((*pc << 8) | MLX5_OPCODE_NOP);
cseg->qpn_ds = cpu_to_be32((sqn << 8) | 0x01);
cseg->fm_ce_se = MLX5_FENCE_MODE_INITIATOR_SMALL;
(*pc)++;
return wqe;
}
struct mlx5e_tx_wqe_info {
struct sk_buff *skb;
u32 num_bytes;
u8 num_wqebbs;
u8 num_dma;
u8 num_fifo_pkts;
#ifdef CONFIG_MLX5_EN_TLS
struct page *resync_dump_frag_page;
#endif
};
static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size)
{
Annotation
- Immediate include surface: `en.h`, `linux/indirect_call_wrapper.h`, `net/ip6_checksum.h`, `net/tcp.h`.
- Detected declarations: `struct mlx5e_xmit_data`, `struct mlx5e_xmit_data_frags`, `struct mlx5e_tx_wqe_info`, `struct mlx5e_shampo_umr`, `struct mlx5e_icosq_wqe_info`, `struct mlx5e_swp_spec`, `enum mlx5e_icosq_wqe_type`, `function mlx5e_cqe_ts_to_ns`, `function mlx5e_skb_is_multicast`, `function mlx5e_rx_hw_stamp`.
- 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.