diff options
author | Israel Rukshin <israelr@mellanox.com> | 2019-10-13 19:57:34 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-11-04 20:56:41 +0300 |
commit | 59534b9d606e7f566970a6f8621c6022f7c19ff1 (patch) | |
tree | c8bbe262d1f014b9c7bca2142b03535446995196 /drivers | |
parent | e522f446027845e3c8b563d021f37e8f3d30c9d9 (diff) | |
download | linux-59534b9d606e7f566970a6f8621c6022f7c19ff1.tar.xz |
nvmet-rdma: add unlikely check at nvmet_rdma_map_sgl_keyed
The calls to nvmet_req_alloc_sgl and rdma_rw_ctx_init should usually
succeed, so add this simple optimization to the fast path.
Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/target/rdma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c index 36d906a7f70d..ccf982164136 100644 --- a/drivers/nvme/target/rdma.c +++ b/drivers/nvme/target/rdma.c @@ -672,13 +672,13 @@ static u16 nvmet_rdma_map_sgl_keyed(struct nvmet_rdma_rsp *rsp, return 0; ret = nvmet_req_alloc_sgl(&rsp->req); - if (ret < 0) + if (unlikely(ret < 0)) goto error_out; ret = rdma_rw_ctx_init(&rsp->rw, cm_id->qp, cm_id->port_num, rsp->req.sg, rsp->req.sg_cnt, 0, addr, key, nvmet_data_dir(&rsp->req)); - if (ret < 0) + if (unlikely(ret < 0)) goto error_out; rsp->n_rdma += ret; |