drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_send.c- Extension
.c- Size
- 34349 bytes
- Lines
- 1319
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/smp.hdr_types.h
Detected Declarations
struct dr_data_segstruct postsend_infostruct dr_qp_rtr_attrstruct dr_qp_rts_attrstruct dr_qp_init_attrstruct mlx5dr_send_info_pool_objstruct mlx5dr_send_info_poolenum send_info_typefunction dr_send_info_pool_fillfunction dr_send_info_pool_destroyfunction list_for_each_entry_safefunction mlx5dr_send_info_pool_destroyfunction mlx5dr_send_info_pool_createfunction mlx5dr_send_info_freefunction dr_parse_cqefunction dr_cq_poll_onefunction dr_poll_cqfunction dr_destroy_qpfunction dr_cmd_notify_hwfunction dr_rdma_handle_flow_access_arg_segmentsfunction dr_rdma_handle_icm_write_segmentsfunction dr_set_ctrl_segfunction dr_rdma_segmentsfunction dr_post_sendfunction mlx5dr_send_fill_and_append_ste_send_infofunction dr_handle_pending_wcfunction dr_fill_write_args_segsfunction dr_fill_write_icm_segsfunction dr_fill_data_segsfunction dr_postsend_icm_datafunction dr_get_tbl_copy_detailsfunction mlx5dr_send_postsend_stefunction mlx5dr_send_postsend_htblfunction mlx5dr_send_postsend_formatted_htblfunction mlx5dr_send_postsend_actionfunction mlx5dr_send_postsend_patternfunction mlx5dr_send_postsend_argsfunction dr_modify_qp_rst2initfunction dr_cmd_modify_qp_rtr2rtsfunction dr_cmd_modify_qp_init2rtrfunction dr_send_allow_flfunction dr_prepare_qp_to_rtsfunction dr_destroy_cqfunction dr_create_mkeyfunction dr_dereg_mrfunction mlx5dr_send_ring_allocfunction mlx5dr_send_ring_free
Annotated Snippet
struct dr_data_seg {
u64 addr;
u32 length;
u32 lkey;
unsigned int send_flags;
};
enum send_info_type {
WRITE_ICM = 0,
GTA_ARG = 1,
};
struct postsend_info {
enum send_info_type type;
struct dr_data_seg write;
struct dr_data_seg read;
u64 remote_addr;
u32 rkey;
};
struct dr_qp_rtr_attr {
struct mlx5dr_cmd_gid_attr dgid_attr;
enum ib_mtu mtu;
u32 qp_num;
u16 port_num;
u8 min_rnr_timer;
u8 sgid_index;
u16 udp_src_port;
u8 fl:1;
};
struct dr_qp_rts_attr {
u8 timeout;
u8 retry_cnt;
u8 rnr_retry;
};
struct dr_qp_init_attr {
u32 cqn;
u32 pdn;
u32 max_send_wr;
struct mlx5_uars_page *uar;
u8 isolate_vl_tc:1;
};
struct mlx5dr_send_info_pool_obj {
struct mlx5dr_ste_send_info ste_send_info;
struct mlx5dr_send_info_pool *pool;
struct list_head list_node;
};
struct mlx5dr_send_info_pool {
struct list_head free_list;
};
static int dr_send_info_pool_fill(struct mlx5dr_send_info_pool *pool)
{
struct mlx5dr_send_info_pool_obj *pool_obj, *tmp_pool_obj;
int i;
for (i = 0; i < DR_SEND_INFO_POOL_SIZE; i++) {
pool_obj = kzalloc_obj(*pool_obj);
if (!pool_obj)
goto clean_pool;
pool_obj->pool = pool;
list_add_tail(&pool_obj->list_node, &pool->free_list);
}
return 0;
clean_pool:
list_for_each_entry_safe(pool_obj, tmp_pool_obj, &pool->free_list, list_node) {
list_del(&pool_obj->list_node);
kfree(pool_obj);
}
return -ENOMEM;
}
static void dr_send_info_pool_destroy(struct mlx5dr_send_info_pool *pool)
{
struct mlx5dr_send_info_pool_obj *pool_obj, *tmp_pool_obj;
list_for_each_entry_safe(pool_obj, tmp_pool_obj, &pool->free_list, list_node) {
list_del(&pool_obj->list_node);
kfree(pool_obj);
}
kfree(pool);
Annotation
- Immediate include surface: `linux/smp.h`, `dr_types.h`.
- Detected declarations: `struct dr_data_seg`, `struct postsend_info`, `struct dr_qp_rtr_attr`, `struct dr_qp_rts_attr`, `struct dr_qp_init_attr`, `struct mlx5dr_send_info_pool_obj`, `struct mlx5dr_send_info_pool`, `enum send_info_type`, `function dr_send_info_pool_fill`, `function dr_send_info_pool_destroy`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.