74
74
/*
75
75
* internal functions
76
76
*/
77
- static void rpcrdma_sendctx_put_locked (struct rpcrdma_sendctx * sc );
77
+ static void rpcrdma_sendctx_put_locked (struct rpcrdma_xprt * r_xprt ,
78
+ struct rpcrdma_sendctx * sc );
78
79
static void rpcrdma_reqs_reset (struct rpcrdma_xprt * r_xprt );
79
80
static void rpcrdma_reps_destroy (struct rpcrdma_buffer * buf );
80
81
static void rpcrdma_mrs_create (struct rpcrdma_xprt * r_xprt );
@@ -124,7 +125,7 @@ rpcrdma_qp_event_handler(struct ib_event *event, void *context)
124
125
125
126
/**
126
127
* rpcrdma_wc_send - Invoked by RDMA provider for each polled Send WC
127
- * @cq: completion queue (ignored)
128
+ * @cq: completion queue
128
129
* @wc: completed WR
129
130
*
130
131
*/
@@ -137,7 +138,7 @@ rpcrdma_wc_send(struct ib_cq *cq, struct ib_wc *wc)
137
138
138
139
/* WARNING: Only wr_cqe and status are reliable at this point */
139
140
trace_xprtrdma_wc_send (sc , wc );
140
- rpcrdma_sendctx_put_locked (sc );
141
+ rpcrdma_sendctx_put_locked (( struct rpcrdma_xprt * ) cq -> cq_context , sc );
141
142
}
142
143
143
144
/**
@@ -518,7 +519,7 @@ int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
518
519
init_waitqueue_head (& ep -> rep_connect_wait );
519
520
ep -> rep_receive_count = 0 ;
520
521
521
- sendcq = ib_alloc_cq_any (ia -> ri_id -> device , NULL ,
522
+ sendcq = ib_alloc_cq_any (ia -> ri_id -> device , r_xprt ,
522
523
ep -> rep_attr .cap .max_send_wr + 1 ,
523
524
IB_POLL_WORKQUEUE );
524
525
if (IS_ERR (sendcq )) {
@@ -840,7 +841,6 @@ static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt)
840
841
if (!sc )
841
842
return - ENOMEM ;
842
843
843
- sc -> sc_xprt = r_xprt ;
844
844
buf -> rb_sc_ctxs [i ] = sc ;
845
845
}
846
846
@@ -903,17 +903,18 @@ struct rpcrdma_sendctx *rpcrdma_sendctx_get_locked(struct rpcrdma_xprt *r_xprt)
903
903
904
904
/**
905
905
* rpcrdma_sendctx_put_locked - Release a send context
906
+ * @r_xprt: controlling transport instance
906
907
* @sc: send context to release
907
908
*
908
909
* Usage: Called from Send completion to return a sendctxt
909
910
* to the queue.
910
911
*
911
912
* The caller serializes calls to this function (per transport).
912
913
*/
913
- static void
914
- rpcrdma_sendctx_put_locked ( struct rpcrdma_sendctx * sc )
914
+ static void rpcrdma_sendctx_put_locked ( struct rpcrdma_xprt * r_xprt ,
915
+ struct rpcrdma_sendctx * sc )
915
916
{
916
- struct rpcrdma_buffer * buf = & sc -> sc_xprt -> rx_buf ;
917
+ struct rpcrdma_buffer * buf = & r_xprt -> rx_buf ;
917
918
unsigned long next_tail ;
918
919
919
920
/* Unmap SGEs of previously completed but unsignaled
@@ -931,7 +932,7 @@ rpcrdma_sendctx_put_locked(struct rpcrdma_sendctx *sc)
931
932
/* Paired with READ_ONCE */
932
933
smp_store_release (& buf -> rb_sc_tail , next_tail );
933
934
934
- xprt_write_space (& sc -> sc_xprt -> rx_xprt );
935
+ xprt_write_space (& r_xprt -> rx_xprt );
935
936
}
936
937
937
938
static void
0 commit comments