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>
This commit is contained in:
parent
1e1c4bd16e
commit
910934da94
@ -53,7 +53,6 @@ struct nvmet_rdma_cmd {
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
NVMET_RDMA_REQ_INLINE_DATA = (1 << 0),
|
NVMET_RDMA_REQ_INLINE_DATA = (1 << 0),
|
||||||
NVMET_RDMA_REQ_INVALIDATE_RKEY = (1 << 1),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nvmet_rdma_rsp {
|
struct nvmet_rdma_rsp {
|
||||||
@ -722,7 +721,7 @@ static void nvmet_rdma_queue_response(struct nvmet_req *req)
|
|||||||
struct rdma_cm_id *cm_id = rsp->queue->cm_id;
|
struct rdma_cm_id *cm_id = rsp->queue->cm_id;
|
||||||
struct ib_send_wr *first_wr;
|
struct ib_send_wr *first_wr;
|
||||||
|
|
||||||
if (rsp->flags & NVMET_RDMA_REQ_INVALIDATE_RKEY) {
|
if (rsp->invalidate_rkey) {
|
||||||
rsp->send_wr.opcode = IB_WR_SEND_WITH_INV;
|
rsp->send_wr.opcode = IB_WR_SEND_WITH_INV;
|
||||||
rsp->send_wr.ex.invalidate_rkey = rsp->invalidate_rkey;
|
rsp->send_wr.ex.invalidate_rkey = rsp->invalidate_rkey;
|
||||||
} else {
|
} else {
|
||||||
@ -905,10 +904,8 @@ static u16 nvmet_rdma_map_sgl_keyed(struct nvmet_rdma_rsp *rsp,
|
|||||||
goto error_out;
|
goto error_out;
|
||||||
rsp->n_rdma += ret;
|
rsp->n_rdma += ret;
|
||||||
|
|
||||||
if (invalidate) {
|
if (invalidate)
|
||||||
rsp->invalidate_rkey = key;
|
rsp->invalidate_rkey = key;
|
||||||
rsp->flags |= NVMET_RDMA_REQ_INVALIDATE_RKEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1047,6 +1044,7 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
|
|||||||
rsp->req.cmd = cmd->nvme_cmd;
|
rsp->req.cmd = cmd->nvme_cmd;
|
||||||
rsp->req.port = queue->port;
|
rsp->req.port = queue->port;
|
||||||
rsp->n_rdma = 0;
|
rsp->n_rdma = 0;
|
||||||
|
rsp->invalidate_rkey = 0;
|
||||||
|
|
||||||
if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) {
|
if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) {
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
Loading…
Reference in New Issue
Block a user