Skip to content

Commit 2374807

Browse files
jsmart-ghChristoph Hellwig
authored andcommitted
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 <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent fe5e26a commit 2374807

File tree

1 file changed

+3
-2
lines changed
  • drivers/nvme/host

1 file changed

+3
-2
lines changed

drivers/nvme/host/fc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,8 +3002,9 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
30023002
if (ret)
30033003
goto out_disconnect_admin_queue;
30043004

3005-
ctrl->ctrl.max_hw_sectors =
3006-
(ctrl->lport->ops->max_sgl_segments - 1) << (PAGE_SHIFT - 9);
3005+
ctrl->ctrl.max_segments = ctrl->lport->ops->max_sgl_segments;
3006+
ctrl->ctrl.max_hw_sectors = ctrl->ctrl.max_segments <<
3007+
(ilog2(SZ_4K) - 9);
30073008

30083009
blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
30093010

0 commit comments

Comments
 (0)