Skip to content

Commit c807f64

Browse files
Jack WangNicholas Bellinger
authored andcommitted
ib_srpt: always set response for task management
The SRP specification requires: "Response data shall be provided in any SRP_RSP response that is sent in response to an SRP_TSK_MGMT request (see 6.7). The information in the RSP_CODE field (see table 24) shall indicate the completion status of the task management function." So fix this to avoid the SRP initiator interprets task management functions that succeeded as failed. Signed-off-by: Jack Wang <[email protected]> Cc: [email protected] # 3.3+ Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 8c7f6e9 commit c807f64

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/infiniband/ulp/srpt/ib_srpt.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch,
15881588
int resp_data_len;
15891589
int resp_len;
15901590

1591-
resp_data_len = (rsp_code == SRP_TSK_MGMT_SUCCESS) ? 0 : 4;
1591+
resp_data_len = 4;
15921592
resp_len = sizeof(*srp_rsp) + resp_data_len;
15931593

15941594
srp_rsp = ioctx->ioctx.buf;
@@ -1600,11 +1600,9 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch,
16001600
+ atomic_xchg(&ch->req_lim_delta, 0));
16011601
srp_rsp->tag = tag;
16021602

1603-
if (rsp_code != SRP_TSK_MGMT_SUCCESS) {
1604-
srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1605-
srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1606-
srp_rsp->data[3] = rsp_code;
1607-
}
1603+
srp_rsp->flags |= SRP_RSP_FLAG_RSPVALID;
1604+
srp_rsp->resp_data_len = cpu_to_be32(resp_data_len);
1605+
srp_rsp->data[3] = rsp_code;
16081606

16091607
return resp_len;
16101608
}

0 commit comments

Comments
 (0)