drivers/net/ethernet/mellanox/mlx5/core/transobj.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/transobj.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/transobj.c- Extension
.c- Size
- 13937 bytes
- Lines
- 506
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/mlx5/driver.hmlx5_core.hlinux/mlx5/transobj.h
Detected Declarations
function Copyrightfunction mlx5_core_dealloc_transport_domainfunction mlx5_core_create_rqfunction mlx5_core_modify_rqfunction mlx5_core_destroy_rqfunction mlx5_core_query_rqfunction mlx5_core_create_sqfunction mlx5_core_modify_sqfunction mlx5_core_destroy_sqfunction mlx5_core_query_sqfunction mlx5_core_query_sq_statefunction mlx5_core_create_tirfunction mlx5_core_modify_tirfunction mlx5_core_destroy_tirfunction mlx5_core_create_tisfunction mlx5_core_modify_tisfunction mlx5_core_destroy_tisfunction mlx5_core_create_rqtfunction mlx5_core_modify_rqtfunction mlx5_core_destroy_rqtfunction mlx5_hairpin_create_rqfunction mlx5_hairpin_create_sqfunction mlx5_hairpin_create_queuesfunction mlx5_hairpin_destroy_queuesfunction mlx5_hairpin_modify_rqfunction mlx5_hairpin_modify_sqfunction mlx5_hairpin_pair_queuesfunction mlx5_hairpin_unpair_peer_sqfunction mlx5_hairpin_unpair_queuesfunction mlx5_core_hairpin_createfunction mlx5_core_hairpin_destroyfunction mlx5_core_hairpin_clear_dead_peerexport mlx5_core_alloc_transport_domainexport mlx5_core_dealloc_transport_domainexport mlx5_core_create_rqexport mlx5_core_modify_rqexport mlx5_core_destroy_rqexport mlx5_core_query_rqexport mlx5_core_modify_sqexport mlx5_core_query_sqexport mlx5_core_query_sq_stateexport mlx5_core_create_tirexport mlx5_core_destroy_tirexport mlx5_core_create_tisexport mlx5_core_modify_tisexport mlx5_core_destroy_tisexport mlx5_core_create_rqtexport mlx5_core_destroy_rqt
Annotated Snippet
#include <linux/mlx5/driver.h>
#include "mlx5_core.h"
#include <linux/mlx5/transobj.h>
int mlx5_core_alloc_transport_domain(struct mlx5_core_dev *dev, u32 *tdn)
{
u32 out[MLX5_ST_SZ_DW(alloc_transport_domain_out)] = {};
u32 in[MLX5_ST_SZ_DW(alloc_transport_domain_in)] = {};
int err;
MLX5_SET(alloc_transport_domain_in, in, opcode,
MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN);
err = mlx5_cmd_exec_inout(dev, alloc_transport_domain, in, out);
if (!err)
*tdn = MLX5_GET(alloc_transport_domain_out, out,
transport_domain);
return err;
}
EXPORT_SYMBOL(mlx5_core_alloc_transport_domain);
void mlx5_core_dealloc_transport_domain(struct mlx5_core_dev *dev, u32 tdn)
{
u32 in[MLX5_ST_SZ_DW(dealloc_transport_domain_in)] = {};
MLX5_SET(dealloc_transport_domain_in, in, opcode,
MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN);
MLX5_SET(dealloc_transport_domain_in, in, transport_domain, tdn);
mlx5_cmd_exec_in(dev, dealloc_transport_domain, in);
}
EXPORT_SYMBOL(mlx5_core_dealloc_transport_domain);
int mlx5_core_create_rq(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rqn)
{
u32 out[MLX5_ST_SZ_DW(create_rq_out)] = {};
int err;
MLX5_SET(create_rq_in, in, opcode, MLX5_CMD_OP_CREATE_RQ);
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
if (!err)
*rqn = MLX5_GET(create_rq_out, out, rqn);
return err;
}
EXPORT_SYMBOL(mlx5_core_create_rq);
int mlx5_core_modify_rq(struct mlx5_core_dev *dev, u32 rqn, u32 *in)
{
MLX5_SET(modify_rq_in, in, rqn, rqn);
MLX5_SET(modify_rq_in, in, opcode, MLX5_CMD_OP_MODIFY_RQ);
return mlx5_cmd_exec_in(dev, modify_rq, in);
}
EXPORT_SYMBOL(mlx5_core_modify_rq);
void mlx5_core_destroy_rq(struct mlx5_core_dev *dev, u32 rqn)
{
u32 in[MLX5_ST_SZ_DW(destroy_rq_in)] = {};
MLX5_SET(destroy_rq_in, in, opcode, MLX5_CMD_OP_DESTROY_RQ);
MLX5_SET(destroy_rq_in, in, rqn, rqn);
mlx5_cmd_exec_in(dev, destroy_rq, in);
}
EXPORT_SYMBOL(mlx5_core_destroy_rq);
int mlx5_core_query_rq(struct mlx5_core_dev *dev, u32 rqn, u32 *out)
{
u32 in[MLX5_ST_SZ_DW(query_rq_in)] = {};
MLX5_SET(query_rq_in, in, opcode, MLX5_CMD_OP_QUERY_RQ);
MLX5_SET(query_rq_in, in, rqn, rqn);
return mlx5_cmd_exec_inout(dev, query_rq, in, out);
}
EXPORT_SYMBOL(mlx5_core_query_rq);
int mlx5_core_create_sq(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *sqn)
{
u32 out[MLX5_ST_SZ_DW(create_sq_out)] = {};
int err;
MLX5_SET(create_sq_in, in, opcode, MLX5_CMD_OP_CREATE_SQ);
err = mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
if (!err)
*sqn = MLX5_GET(create_sq_out, out, sqn);
return err;
}
Annotation
- Immediate include surface: `linux/mlx5/driver.h`, `mlx5_core.h`, `linux/mlx5/transobj.h`.
- Detected declarations: `function Copyright`, `function mlx5_core_dealloc_transport_domain`, `function mlx5_core_create_rq`, `function mlx5_core_modify_rq`, `function mlx5_core_destroy_rq`, `function mlx5_core_query_rq`, `function mlx5_core_create_sq`, `function mlx5_core_modify_sq`, `function mlx5_core_destroy_sq`, `function mlx5_core_query_sq`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.