mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-23 05:31:28 +00:00
ib_srpt: Simplify the code for waking up the srpt thread after login
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1976,7 +1976,7 @@ static void srpt_process_send_completion(struct ib_cq *cq,
|
||||
opcode == SRPT_RDMA_ABORT) {
|
||||
srpt_handle_rdma_comp(ch, ch->ioctx_ring[index], opcode,
|
||||
srpt_xmt_rsp_context);
|
||||
} else if (opcode != SRPT_RDMA_ZEROLENGTH_WRITE) {
|
||||
} else {
|
||||
WARN(true, "unexpected opcode %d", opcode);
|
||||
}
|
||||
} else {
|
||||
@@ -1991,8 +1991,7 @@ static void srpt_process_send_completion(struct ib_cq *cq,
|
||||
opcode, index, wc->status);
|
||||
srpt_handle_rdma_err_comp(ch, ch->ioctx_ring[index],
|
||||
opcode, srpt_xmt_rsp_context);
|
||||
} else if (opcode != SRPT_RDMA_MID &&
|
||||
opcode != SRPT_RDMA_ZEROLENGTH_WRITE) {
|
||||
} else if (opcode != SRPT_RDMA_MID) {
|
||||
WARN(true, "unexpected opcode %d", opcode);
|
||||
}
|
||||
}
|
||||
@@ -2776,25 +2775,6 @@ static void srpt_cm_rej_recv(struct ib_cm_id *cm_id)
|
||||
srpt_drain_channel(cm_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* srpt_zerolength_write() - Perform a zero-length RDMA write.
|
||||
*
|
||||
* A quote from the InfiniBand specification: C9-88: For an HCA responder
|
||||
* using Reliable Connection service, for each zero-length RDMA READ or WRITE
|
||||
* request, the R_Key shall not be validated, even if the request includes
|
||||
* Immediate data.
|
||||
*/
|
||||
static int srpt_zerolength_write(struct srpt_rdma_ch *ch)
|
||||
{
|
||||
struct ib_send_wr wr, *bad_wr;
|
||||
|
||||
memset(&wr, 0, sizeof(wr));
|
||||
wr.opcode = IB_WR_RDMA_WRITE;
|
||||
wr.wr_id = encode_wr_id(SRPT_RDMA_ZEROLENGTH_WRITE, 0xffffffffUL);
|
||||
wr.send_flags = IB_SEND_SIGNALED;
|
||||
return ib_post_send(ch->qp, &wr, &bad_wr);
|
||||
}
|
||||
|
||||
/**
|
||||
* srpt_cm_rtu_recv() - Process IB CM RTU_RECEIVED and USER_ESTABLISHED events.
|
||||
*
|
||||
@@ -2809,7 +2789,7 @@ static void srpt_cm_rtu_recv(struct ib_cm_id *cm_id)
|
||||
ret = srpt_ch_qp_rts(ch, ch->qp);
|
||||
if (ret == 0 && srpt_test_and_set_ch_state(ch, CH_CONNECTING,
|
||||
CH_LIVE)) {
|
||||
WARN_ON(srpt_zerolength_write(ch) < 0);
|
||||
wake_up_process(ch->thread);
|
||||
} else {
|
||||
srpt_close_ch(ch);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,6 @@ enum srpt_opcode {
|
||||
SRPT_RDMA_ABORT,
|
||||
SRPT_RDMA_READ_LAST,
|
||||
SRPT_RDMA_WRITE_LAST,
|
||||
SRPT_RDMA_ZEROLENGTH_WRITE,
|
||||
};
|
||||
|
||||
static inline u64 encode_wr_id(enum srpt_opcode opcode, u32 idx)
|
||||
|
||||
Reference in New Issue
Block a user