drivers/infiniband/sw/rxe/rxe_hdr.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/rxe/rxe_hdr.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/sw/rxe/rxe_hdr.h- Extension
.h- Size
- 21784 bytes
- Lines
- 978
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct rxe_pkt_infostruct rxe_bthstruct rxe_rdethstruct rxe_dethstruct rxe_rethstruct rxe_fethstruct rxe_atmethstruct rxe_aethstruct rxe_atmackstruct rxe_immdtstruct rxe_iethenum aeth_syndromeenum rxe_hdr_lengthfunction __bth_opcodefunction __bth_set_opcodefunction __bth_sefunction __bth_set_sefunction __bth_migfunction __bth_set_migfunction __bth_padfunction __bth_set_padfunction __bth_tverfunction __bth_set_tverfunction __bth_pkeyfunction __bth_set_pkeyfunction __bth_qpnfunction __bth_set_qpnfunction __bth_fecnfunction __bth_set_fecnfunction __bth_becnfunction __bth_set_becnfunction __bth_resv6afunction __bth_set_resv6afunction __bth_ackfunction __bth_set_ackfunction __bth_set_resv7function __bth_psnfunction __bth_set_psnfunction bth_opcodefunction bth_set_opcodefunction bth_sefunction bth_set_sefunction bth_migfunction bth_set_migfunction bth_padfunction bth_set_padfunction bth_tverfunction bth_set_tver
Annotated Snippet
struct rxe_pkt_info {
struct rxe_dev *rxe; /* device that owns packet */
struct rxe_qp *qp; /* qp that owns packet */
struct rxe_send_wqe *wqe; /* send wqe */
u8 *hdr; /* points to bth */
u32 mask; /* useful info about pkt */
u32 psn; /* bth psn of packet */
u16 pkey_index; /* partition of pkt */
u16 paylen; /* length of bth - icrc */
u8 port_num; /* port pkt received on */
u8 opcode; /* bth opcode of packet */
};
/* Macros should be used only for received skb */
static inline struct rxe_pkt_info *SKB_TO_PKT(struct sk_buff *skb)
{
BUILD_BUG_ON(sizeof(struct rxe_pkt_info) > sizeof(skb->cb));
return (void *)skb->cb;
}
static inline struct sk_buff *PKT_TO_SKB(struct rxe_pkt_info *pkt)
{
return container_of((void *)pkt, struct sk_buff, cb);
}
/*
* IBA header types and methods
*
* Some of these are for reference and completeness only since
* rxe does not currently support RD transport
* most of this could be moved into IB core. ib_pack.h has
* part of this but is incomplete
*
* Header specific routines to insert/extract values to/from headers
* the routines that are named __hhh_(set_)fff() take a pointer to a
* hhh header and get(set) the fff field. The routines named
* hhh_(set_)fff take a packet info struct and find the
* header and field based on the opcode in the packet.
* Conversion to/from network byte order from cpu order is also done.
*/
#define RXE_ICRC_SIZE (4)
#define RXE_MAX_HDR_LENGTH (80)
/******************************************************************************
* Base Transport Header
******************************************************************************/
struct rxe_bth {
u8 opcode;
u8 flags;
__be16 pkey;
__be32 qpn;
__be32 apsn;
};
#define BTH_TVER (0)
#define BTH_DEF_PKEY (0xffff)
#define BTH_SE_MASK (0x80)
#define BTH_MIG_MASK (0x40)
#define BTH_PAD_MASK (0x30)
#define BTH_TVER_MASK (0x0f)
#define BTH_FECN_MASK (0x80000000)
#define BTH_BECN_MASK (0x40000000)
#define BTH_RESV6A_MASK (0x3f000000)
#define BTH_QPN_MASK (0x00ffffff)
#define BTH_ACK_MASK (0x80000000)
#define BTH_RESV7_MASK (0x7f000000)
#define BTH_PSN_MASK (0x00ffffff)
static inline u8 __bth_opcode(void *arg)
{
struct rxe_bth *bth = arg;
return bth->opcode;
}
static inline void __bth_set_opcode(void *arg, u8 opcode)
{
struct rxe_bth *bth = arg;
bth->opcode = opcode;
}
static inline u8 __bth_se(void *arg)
{
struct rxe_bth *bth = arg;
return 0 != (BTH_SE_MASK & bth->flags);
}
Annotation
- Detected declarations: `struct rxe_pkt_info`, `struct rxe_bth`, `struct rxe_rdeth`, `struct rxe_deth`, `struct rxe_reth`, `struct rxe_feth`, `struct rxe_atmeth`, `struct rxe_aeth`, `struct rxe_atmack`, `struct rxe_immdt`.
- Atlas domain: Driver Families / drivers/infiniband.
- 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.