drivers/infiniband/core/ud_header.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/core/ud_header.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/core/ud_header.c- Extension
.c- Size
- 12594 bytes
- Lines
- 465
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- 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/errno.hlinux/string.hlinux/export.hlinux/if_ether.hlinux/ip.hrdma/ib_pack.h
Detected Declarations
function ib_ud_ip4_csumfunction ib_ud_header_initfunction ib_ud_header_packexport ib_ud_ip4_csumexport ib_ud_header_initexport ib_ud_header_pack
Annotated Snippet
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/export.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <rdma/ib_pack.h>
#define STRUCT_FIELD(header, field) \
.struct_offset_bytes = offsetof(struct ib_unpacked_ ## header, field), \
.struct_size_bytes = sizeof_field(struct ib_unpacked_ ## header, field), \
.field_name = #header ":" #field
static const struct ib_field lrh_table[] = {
{ STRUCT_FIELD(lrh, virtual_lane),
.offset_words = 0,
.offset_bits = 0,
.size_bits = 4 },
{ STRUCT_FIELD(lrh, link_version),
.offset_words = 0,
.offset_bits = 4,
.size_bits = 4 },
{ STRUCT_FIELD(lrh, service_level),
.offset_words = 0,
.offset_bits = 8,
.size_bits = 4 },
{ RESERVED,
.offset_words = 0,
.offset_bits = 12,
.size_bits = 2 },
{ STRUCT_FIELD(lrh, link_next_header),
.offset_words = 0,
.offset_bits = 14,
.size_bits = 2 },
{ STRUCT_FIELD(lrh, destination_lid),
.offset_words = 0,
.offset_bits = 16,
.size_bits = 16 },
{ RESERVED,
.offset_words = 1,
.offset_bits = 0,
.size_bits = 5 },
{ STRUCT_FIELD(lrh, packet_length),
.offset_words = 1,
.offset_bits = 5,
.size_bits = 11 },
{ STRUCT_FIELD(lrh, source_lid),
.offset_words = 1,
.offset_bits = 16,
.size_bits = 16 }
};
static const struct ib_field eth_table[] = {
{ STRUCT_FIELD(eth, dmac_h),
.offset_words = 0,
.offset_bits = 0,
.size_bits = 32 },
{ STRUCT_FIELD(eth, dmac_l),
.offset_words = 1,
.offset_bits = 0,
.size_bits = 16 },
{ STRUCT_FIELD(eth, smac_h),
.offset_words = 1,
.offset_bits = 16,
.size_bits = 16 },
{ STRUCT_FIELD(eth, smac_l),
.offset_words = 2,
.offset_bits = 0,
.size_bits = 32 },
{ STRUCT_FIELD(eth, type),
.offset_words = 3,
.offset_bits = 0,
.size_bits = 16 }
};
static const struct ib_field vlan_table[] = {
{ STRUCT_FIELD(vlan, tag),
.offset_words = 0,
.offset_bits = 0,
.size_bits = 16 },
{ STRUCT_FIELD(vlan, type),
.offset_words = 0,
.offset_bits = 16,
.size_bits = 16 }
};
static const struct ib_field ip4_table[] = {
{ STRUCT_FIELD(ip4, ver),
.offset_words = 0,
.offset_bits = 0,
Annotation
- Immediate include surface: `linux/errno.h`, `linux/string.h`, `linux/export.h`, `linux/if_ether.h`, `linux/ip.h`, `rdma/ib_pack.h`.
- Detected declarations: `function ib_ud_ip4_csum`, `function ib_ud_header_init`, `function ib_ud_header_pack`, `export ib_ud_ip4_csum`, `export ib_ud_header_init`, `export ib_ud_header_pack`.
- Atlas domain: Driver Families / drivers/infiniband.
- 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.