[PATCH v4 3/4] nvme-rdma: wait for local invalidation before completing a request

Max Gurtovoy maxg at mellanox.com
Wed Nov 22 08:45:26 PST 2017


> @@ -1337,8 +1335,19 @@ static int nvme_rdma_process_nvme_rsp(struct nvme_rdma_queue *queue,
>   	req->result = cqe->result;
>   
>   	if ((wc->wc_flags & IB_WC_WITH_INVALIDATE) &&
> -	    wc->ex.invalidate_rkey == req->mr->rkey)
> +	    wc->ex.invalidate_rkey == req->mr->rkey) {
>   		req->mr->need_inval = false;
> +	} else if (req->mr->need_inval) {
> +		ret = nvme_rdma_inv_rkey(queue, req);
> +		if (unlikely(ret < 0)) {
> +			dev_err(queue->ctrl->ctrl.device,
> +				"Queueing INV WR for rkey %#x failed (%d)\n",
> +				req->mr->rkey, ret);
> +			nvme_rdma_error_recovery(queue->ctrl);
> +		}
> +		/* the local invalidation completion will end the request */

inv completion or nvme_rdma_error_recovery will end the request...

> +		return 0;
> +	}
>   
>   	if (refcount_dec_and_test(&req->ref)) {
>   		if (rq->tag == tag)
> 



More information about the Linux-nvme mailing list