include/linux/sunrpc/svc_rdma.h
Source file repositories/reference/linux-study-clean/include/linux/sunrpc/svc_rdma.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/sunrpc/svc_rdma.h- Extension
.h- Size
- 11605 bytes
- Lines
- 342
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/llist.hlinux/sunrpc/xdr.hlinux/sunrpc/svcsock.hlinux/sunrpc/rpc_rdma.hlinux/sunrpc/rpc_rdma_cid.hlinux/sunrpc/svc_rdma_pcl.hlinux/sunrpc/rdma_rn.hlinux/percpu_counter.hrdma/ib_verbs.hrdma/rdma_cm.h
Detected Declarations
struct svcxprt_rdmastruct svc_rdma_chunk_ctxtstruct svc_rdma_recv_ctxtstruct svc_rdma_write_infostruct svc_rdma_send_ctxtfunction svc_rdma_recv_cid_initfunction svc_rdma_send_cid_init
Annotated Snippet
struct svcxprt_rdma {
struct svc_xprt sc_xprt; /* SVC transport structure */
struct rdma_cm_id *sc_cm_id; /* RDMA connection id */
struct list_head sc_accept_q; /* Conn. waiting accept */
struct rpcrdma_notification sc_rn; /* removal notification */
int sc_ord; /* RDMA read limit */
int sc_max_send_sges;
bool sc_snd_w_inv; /* OK to use Send With Invalidate */
atomic_t sc_sq_avail; /* SQEs ready to be consumed */
unsigned int sc_sq_depth; /* Depth of SQ */
atomic_t sc_sq_ticket_head; /* Next ticket to issue */
atomic_t sc_sq_ticket_tail; /* Ticket currently serving */
wait_queue_head_t sc_sq_ticket_wait; /* Ticket ordering waitlist */
__be32 sc_fc_credits; /* Forward credits */
u32 sc_max_requests; /* Max requests */
u32 sc_max_bc_requests;/* Backward credits */
int sc_max_req_size; /* Size of each RQ WR buf */
u8 sc_port_num;
struct ib_pd *sc_pd;
spinlock_t sc_send_lock;
struct llist_head sc_send_ctxts;
spinlock_t sc_rw_ctxt_lock;
struct llist_head sc_rw_ctxts;
u32 sc_pending_recvs;
u32 sc_recv_batch;
struct list_head sc_rq_dto_q;
struct list_head sc_read_complete_q;
spinlock_t sc_rq_dto_lock;
struct ib_qp *sc_qp;
struct ib_cq *sc_rq_cq;
struct ib_cq *sc_sq_cq;
spinlock_t sc_lock; /* transport lock */
wait_queue_head_t sc_send_wait; /* SQ exhaustion waitlist */
unsigned long sc_flags;
struct work_struct sc_work;
struct llist_head sc_recv_ctxts;
struct llist_head sc_send_release_list;
atomic_t sc_completion_ids;
};
/* sc_flags */
#define RDMAXPRT_CONN_PENDING 3
static inline struct svcxprt_rdma *svc_rdma_rqst_rdma(struct svc_rqst *rqstp)
{
struct svc_xprt *xprt = rqstp->rq_xprt;
return container_of(xprt, struct svcxprt_rdma, sc_xprt);
}
/*
* Default connection parameters
*/
enum {
RPCRDMA_LISTEN_BACKLOG = 10,
RPCRDMA_MAX_REQUESTS = 128,
RPCRDMA_MAX_BC_REQUESTS = 2,
};
#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
/**
* svc_rdma_send_cid_init - Initialize a Receive Queue completion ID
* @rdma: controlling transport
* @cid: completion ID to initialize
*/
static inline void svc_rdma_recv_cid_init(struct svcxprt_rdma *rdma,
struct rpc_rdma_cid *cid)
{
cid->ci_queue_id = rdma->sc_rq_cq->res.id;
cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids);
}
/**
* svc_rdma_send_cid_init - Initialize a Send Queue completion ID
* @rdma: controlling transport
* @cid: completion ID to initialize
*/
static inline void svc_rdma_send_cid_init(struct svcxprt_rdma *rdma,
struct rpc_rdma_cid *cid)
{
cid->ci_queue_id = rdma->sc_sq_cq->res.id;
Annotation
- Immediate include surface: `linux/llist.h`, `linux/sunrpc/xdr.h`, `linux/sunrpc/svcsock.h`, `linux/sunrpc/rpc_rdma.h`, `linux/sunrpc/rpc_rdma_cid.h`, `linux/sunrpc/svc_rdma_pcl.h`, `linux/sunrpc/rdma_rn.h`, `linux/percpu_counter.h`.
- Detected declarations: `struct svcxprt_rdma`, `struct svc_rdma_chunk_ctxt`, `struct svc_rdma_recv_ctxt`, `struct svc_rdma_write_info`, `struct svc_rdma_send_ctxt`, `function svc_rdma_recv_cid_init`, `function svc_rdma_send_cid_init`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.