diff options
author | James Smart <jsmart2021@gmail.com> | 2020-07-14 22:03:36 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-07-29 08:45:20 +0300 |
commit | 237480760c5050e8e897846b93ba9ffdb6444301 (patch) | |
tree | d1b0268adfb7cc6b18ed1846b09c45616c99de00 /drivers | |
parent | fe5e26a70cc544004b9aa9c3b96cb1d1cc132e09 (diff) | |
download | linux-237480760c5050e8e897846b93ba9ffdb6444301.tar.xz |
nvme-fc: set max_segments to lldd max value
Currently the FC transport is set max_hw_sectors based on the lldds
max sgl segment count. However, the block queue max segments is
set based on the controller's max_segments count, which the transport
does not set. As such, the lldd is receiving sgl lists that are
exceeding its max segment count.
Set the controller max segment count and derive max_hw_sectors from
the max segment count.
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/fc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index b27c54dc6683..eae43bb444e0 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -3002,8 +3002,9 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) if (ret) goto out_disconnect_admin_queue; - ctrl->ctrl.max_hw_sectors = - (ctrl->lport->ops->max_sgl_segments - 1) << (PAGE_SHIFT - 9); + ctrl->ctrl.max_segments = ctrl->lport->ops->max_sgl_segments; + ctrl->ctrl.max_hw_sectors = ctrl->ctrl.max_segments << + (ilog2(SZ_4K) - 9); blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); |