drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/lib/gid.c- Extension
.c- Size
- 5224 bytes
- Lines
- 153
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mlx5/driver.hlinux/etherdevice.hlinux/idr.hmlx5_core.hlib/mlx5.h
Detected Declarations
function Copyrightfunction mlx5_cleanup_reserved_gidsfunction mlx5_core_reserve_gidsfunction mlx5_core_unreserve_gidsfunction mlx5_core_reserved_gid_allocfunction mlx5_core_reserved_gid_freefunction mlx5_core_reserved_gids_countfunction mlx5_core_roce_gid_setexport mlx5_core_reserved_gids_countexport mlx5_core_roce_gid_set
Annotated Snippet
if (vlan) {
MLX5_SET_RA(in_addr, vlan_valid, 1);
MLX5_SET_RA(in_addr, vlan_id, vlan_id);
}
ether_addr_copy(addr_mac, mac);
memcpy(addr_l3_addr, gid, gidsz);
}
MLX5_SET_RA(in_addr, roce_version, roce_version);
MLX5_SET_RA(in_addr, roce_l3_type, roce_l3_type);
if (MLX5_CAP_GEN(dev, num_vhca_ports) > 0)
MLX5_SET(set_roce_address_in, in, vhca_port_num, port_num);
MLX5_SET(set_roce_address_in, in, roce_address_index, index);
MLX5_SET(set_roce_address_in, in, opcode, MLX5_CMD_OP_SET_ROCE_ADDRESS);
return mlx5_cmd_exec_in(dev, set_roce_address, in);
}
EXPORT_SYMBOL(mlx5_core_roce_gid_set);
Annotation
- Immediate include surface: `linux/mlx5/driver.h`, `linux/etherdevice.h`, `linux/idr.h`, `mlx5_core.h`, `lib/mlx5.h`.
- Detected declarations: `function Copyright`, `function mlx5_cleanup_reserved_gids`, `function mlx5_core_reserve_gids`, `function mlx5_core_unreserve_gids`, `function mlx5_core_reserved_gid_alloc`, `function mlx5_core_reserved_gid_free`, `function mlx5_core_reserved_gids_count`, `function mlx5_core_roce_gid_set`, `export mlx5_core_reserved_gids_count`, `export mlx5_core_roce_gid_set`.
- 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.