Skip to content

Commit 910934d

Browse files
guixinliu1995keithbusch
authored andcommitted
nvmet-rdma: remove NVMET_RDMA_REQ_INVALIDATE_RKEY flag
We can simply use invalidate_rkey to check instead of adding a flag. Signed-off-by: Guixin Liu <kanie@linux.alibaba.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
1 parent 1e1c4bd commit 910934d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/nvme/target/rdma.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ struct nvmet_rdma_cmd {
5353

5454
enum {
5555
NVMET_RDMA_REQ_INLINE_DATA = (1 << 0),
56-
NVMET_RDMA_REQ_INVALIDATE_RKEY = (1 << 1),
5756
};
5857

5958
struct nvmet_rdma_rsp {
@@ -722,7 +721,7 @@ static void nvmet_rdma_queue_response(struct nvmet_req *req)
722721
struct rdma_cm_id *cm_id = rsp->queue->cm_id;
723722
struct ib_send_wr *first_wr;
724723

725-
if (rsp->flags & NVMET_RDMA_REQ_INVALIDATE_RKEY) {
724+
if (rsp->invalidate_rkey) {
726725
rsp->send_wr.opcode = IB_WR_SEND_WITH_INV;
727726
rsp->send_wr.ex.invalidate_rkey = rsp->invalidate_rkey;
728727
} else {
@@ -905,10 +904,8 @@ static u16 nvmet_rdma_map_sgl_keyed(struct nvmet_rdma_rsp *rsp,
905904
goto error_out;
906905
rsp->n_rdma += ret;
907906

908-
if (invalidate) {
907+
if (invalidate)
909908
rsp->invalidate_rkey = key;
910-
rsp->flags |= NVMET_RDMA_REQ_INVALIDATE_RKEY;
911-
}
912909

913910
return 0;
914911

@@ -1047,6 +1044,7 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
10471044
rsp->req.cmd = cmd->nvme_cmd;
10481045
rsp->req.port = queue->port;
10491046
rsp->n_rdma = 0;
1047+
rsp->invalidate_rkey = 0;
10501048

10511049
if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) {
10521050
unsigned long flags;

0 commit comments

Comments
 (0)