net/rds/ib.h
Source file repositories/reference/linux-study-clean/net/rds/ib.h
File Facts
- System
- Linux kernel
- Corpus path
net/rds/ib.h- Extension
.h- Size
- 14052 bytes
- Lines
- 456
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
rdma/ib_verbs.hrdma/rdma_cm.hlinux/interrupt.hlinux/pci.hlinux/slab.hrds.hrdma_transport.h
Detected Declarations
struct rds_page_fragstruct rds_ib_incomingstruct rds_ib_cache_headstruct rds_ib_refill_cachestruct rds_ib_conn_priv_cmnstruct rds_ib_connect_privatestruct rds6_ib_connect_privatestruct rds_ib_send_workstruct rds_ib_recv_workstruct rds_ib_work_ringstruct rds_ib_ack_statestruct rds_ib_devicestruct rds_ib_connectionstruct rds_ib_ipaddrstruct rds_ib_devicestruct rds_ib_statisticsfunction rds_ib_dma_sync_sg_for_cpufunction for_each_sgfunction rds_ib_dma_sync_sg_for_devicefunction for_each_sg
Annotated Snippet
struct rds_page_frag {
struct list_head f_item;
struct list_head f_cache_entry;
struct scatterlist f_sg;
};
struct rds_ib_incoming {
struct list_head ii_frags;
struct list_head ii_cache_entry;
struct rds_incoming ii_inc;
};
struct rds_ib_cache_head {
struct list_head *first;
unsigned long count;
};
struct rds_ib_refill_cache {
struct rds_ib_cache_head __percpu *percpu;
struct list_head *xfer;
struct list_head *ready;
};
/* This is the common structure for the IB private data exchange in setting up
* an RDS connection. The exchange is different for IPv4 and IPv6 connections.
* The reason is that the address size is different and the addresses
* exchanged are in the beginning of the structure. Hence it is not possible
* for interoperability if same structure is used.
*/
struct rds_ib_conn_priv_cmn {
u8 ricpc_protocol_major;
u8 ricpc_protocol_minor;
__be16 ricpc_protocol_minor_mask; /* bitmask */
u8 ricpc_dp_toss;
u8 ripc_reserved1;
__be16 ripc_reserved2;
__be64 ricpc_ack_seq;
__be32 ricpc_credit; /* non-zero enables flow ctl */
};
struct rds_ib_connect_private {
/* Add new fields at the end, and don't permute existing fields. */
__be32 dp_saddr;
__be32 dp_daddr;
struct rds_ib_conn_priv_cmn dp_cmn;
};
struct rds6_ib_connect_private {
/* Add new fields at the end, and don't permute existing fields. */
struct in6_addr dp_saddr;
struct in6_addr dp_daddr;
struct rds_ib_conn_priv_cmn dp_cmn;
};
#define dp_protocol_major dp_cmn.ricpc_protocol_major
#define dp_protocol_minor dp_cmn.ricpc_protocol_minor
#define dp_protocol_minor_mask dp_cmn.ricpc_protocol_minor_mask
#define dp_ack_seq dp_cmn.ricpc_ack_seq
#define dp_credit dp_cmn.ricpc_credit
union rds_ib_conn_priv {
struct rds_ib_connect_private ricp_v4;
struct rds6_ib_connect_private ricp_v6;
};
struct rds_ib_send_work {
void *s_op;
union {
struct ib_send_wr s_wr;
struct ib_rdma_wr s_rdma_wr;
struct ib_atomic_wr s_atomic_wr;
};
struct ib_sge s_sge[RDS_IB_MAX_SGE];
unsigned long s_queued;
};
struct rds_ib_recv_work {
struct rds_ib_incoming *r_ibinc;
struct rds_page_frag *r_frag;
struct ib_recv_wr r_wr;
struct ib_sge r_sge[2];
};
struct rds_ib_work_ring {
u32 w_nr;
u32 w_alloc_ptr;
u32 w_alloc_ctr;
u32 w_free_ptr;
atomic_t w_free_ctr;
};
Annotation
- Immediate include surface: `rdma/ib_verbs.h`, `rdma/rdma_cm.h`, `linux/interrupt.h`, `linux/pci.h`, `linux/slab.h`, `rds.h`, `rdma_transport.h`.
- Detected declarations: `struct rds_page_frag`, `struct rds_ib_incoming`, `struct rds_ib_cache_head`, `struct rds_ib_refill_cache`, `struct rds_ib_conn_priv_cmn`, `struct rds_ib_connect_private`, `struct rds6_ib_connect_private`, `struct rds_ib_send_work`, `struct rds_ib_recv_work`, `struct rds_ib_work_ring`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.