mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
svcrdma: De-duplicate completion ID initialization helpers
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
018f34051b
commit
28ee0ec894
4 changed files with 25 additions and 22 deletions
|
@ -134,6 +134,30 @@ enum {
|
||||||
|
|
||||||
#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
|
#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;
|
||||||
|
cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A chunk context tracks all I/O for moving one Read or Write
|
* A chunk context tracks all I/O for moving one Read or Write
|
||||||
* chunk. This is a set of rdma_rw's that handle data movement
|
* chunk. This is a set of rdma_rw's that handle data movement
|
||||||
|
|
|
@ -115,13 +115,6 @@ svc_rdma_next_recv_ctxt(struct list_head *list)
|
||||||
rc_list);
|
rc_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct svc_rdma_recv_ctxt *
|
static struct svc_rdma_recv_ctxt *
|
||||||
svc_rdma_recv_ctxt_alloc(struct svcxprt_rdma *rdma)
|
svc_rdma_recv_ctxt_alloc(struct svcxprt_rdma *rdma)
|
||||||
{
|
{
|
||||||
|
|
|
@ -146,13 +146,6 @@ static int svc_rdma_rw_ctx_init(struct svcxprt_rdma *rdma,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void svc_rdma_cc_cid_init(struct svcxprt_rdma *rdma,
|
|
||||||
struct rpc_rdma_cid *cid)
|
|
||||||
{
|
|
||||||
cid->ci_queue_id = rdma->sc_sq_cq->res.id;
|
|
||||||
cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* svc_rdma_cc_init - Initialize an svc_rdma_chunk_ctxt
|
* svc_rdma_cc_init - Initialize an svc_rdma_chunk_ctxt
|
||||||
* @rdma: controlling transport instance
|
* @rdma: controlling transport instance
|
||||||
|
@ -161,7 +154,7 @@ static void svc_rdma_cc_cid_init(struct svcxprt_rdma *rdma,
|
||||||
void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
|
void svc_rdma_cc_init(struct svcxprt_rdma *rdma,
|
||||||
struct svc_rdma_chunk_ctxt *cc)
|
struct svc_rdma_chunk_ctxt *cc)
|
||||||
{
|
{
|
||||||
svc_rdma_cc_cid_init(rdma, &cc->cc_cid);
|
svc_rdma_send_cid_init(rdma, &cc->cc_cid);
|
||||||
|
|
||||||
INIT_LIST_HEAD(&cc->cc_rwctxts);
|
INIT_LIST_HEAD(&cc->cc_rwctxts);
|
||||||
cc->cc_sqecount = 0;
|
cc->cc_sqecount = 0;
|
||||||
|
|
|
@ -113,13 +113,6 @@
|
||||||
|
|
||||||
static void svc_rdma_wc_send(struct ib_cq *cq, struct ib_wc *wc);
|
static void svc_rdma_wc_send(struct ib_cq *cq, struct ib_wc *wc);
|
||||||
|
|
||||||
static 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;
|
|
||||||
cid->ci_completion_id = atomic_inc_return(&rdma->sc_completion_ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct svc_rdma_send_ctxt *
|
static struct svc_rdma_send_ctxt *
|
||||||
svc_rdma_send_ctxt_alloc(struct svcxprt_rdma *rdma)
|
svc_rdma_send_ctxt_alloc(struct svcxprt_rdma *rdma)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue