提交 79a76a7b 编写于 作者: B Baolin Wang 提交者: Caspar Zhang

alinux: nvme-pci: Improve mapping single segment requests using PRP

fix #29327388

Now the blk-mq did not support multi-page bvec, which means each bvec
can only contain one page. For simple PRP, it just support one bvec
in the bio though the physical segment is only 1, otherwise it can
not map the whole request.

In future if we support multi-page bvecs, this patch can be dropped.
Signed-off-by: NBaolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 c201c72d
......@@ -852,8 +852,9 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
if (blk_rq_nr_phys_segments(req) == 1) {
struct bio_vec bv = req_bvec(req);
unsigned int bio_pages = bio_pages_all(req->bio);
if (bv.bv_offset + bv.bv_len <= dev->ctrl.page_size * 2)
if (bio_pages == 1 && bv.bv_offset + bv.bv_len <= dev->ctrl.page_size * 2)
return nvme_setup_prp_simple(dev, req,
&cmnd->rw, &bv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册