All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Nikos Tsironis <ntsironis@arrikto.com>,
	Christoph Hellwig <hch@infradead.org>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org
Subject: Re: [PATCH] tcm_loop: Increase maximum request size
Date: Mon, 19 Dec 2022 12:49:09 -0600	[thread overview]
Message-ID: <6ae8a2b8-9720-8e60-4431-072218e57e28@oracle.com> (raw)
In-Reply-To: <da4f53f3-4e13-1259-b0a6-cc28160be23b@arrikto.com>

On 12/19/22 8:39 AM, Nikos Tsironis wrote:
> On 12/7/22 20:35, Christoph Hellwig wrote:
>> On Wed, Dec 07, 2022 at 12:29:56PM -0600, Mike Christie wrote:
>>> I think you need to make this configurable.
>>>
>>> If you use loop with pscsi, then the sgl that loop now gets might be too
>>> big for the backend device so we now fail in:
>>>
>>> pscsi_map_sg -> blk_rq_append_bio -> ll_back_merge_fn
>>>
>>> So some users might be relying on the smaller limit.
>>
>> Note that this could happen even now, you just need sufficiently
>> horrible hardware to pass through for it.  But yes, for pscsi
>> this needs to look at the underlying device, and increasing the
>> limit might be a good point to do that.  I'm not sure it's worth
>> to add user configuration, though.
> 
> Thanks for the feedback.
> 
> What should I do? Change pscsi to look at the underlying device limits?

Yes. I think there might be 2 things to do here:

1. SCSI VPD values.

I think we would do something similar to iblock_configure_device
where when we setup the device we look at the underlying device's limits
and then set the se_device's limits. Those values then get reported to
the initiator in the VPD info, so that would be useful for normal drivers
like iscsi and FC.

For the max segments there's not a SCSI VPD value, but we have this code:

        /*
         * Set MAXIMUM TRANSFER LENGTH
         *
         * XXX: Currently assumes single PAGE_SIZE per scatterlist for fabrics
         * enforcing maximum HW scatter-gather-list entry limit
         */
        if (cmd->se_tfo->max_data_sg_nents) {
                mtl = (cmd->se_tfo->max_data_sg_nents * PAGE_SIZE) /
                       dev->dev_attrib.block_size;
        }
        put_unaligned_be32(min_not_zero(mtl, dev->dev_attrib.hw_max_sectors), &buf[8]);

which would limit the IO size. max_data_sg_nents is only currently a fabric
driver (front end drivers like iscsi, fc, etc) limit, so we would need to make
that more generic so backends like pscsi can set it.


2. For loop we have the sg_tablesize setting like you saw, but the problem is
that it's host level and we don't know the devices when we add the host.

I think we would have to modify tcm_loop_port_link so if adds the device
successfully, we call blk_queue_max_segments.

Christoph is that what you were thinking?








  reply	other threads:[~2022-12-19 18:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 11:55 [PATCH] tcm_loop: Increase maximum request size Nikos Tsironis
2022-10-02 21:09 ` Bart Van Assche
2022-10-12 14:19   ` Nikos Tsironis
2022-10-12 16:32     ` Bart Van Assche
2022-12-07 10:29 ` Nikos Tsironis
2022-12-07 18:29 ` Mike Christie
2022-12-07 18:35   ` Christoph Hellwig
2022-12-19 14:39     ` Nikos Tsironis
2022-12-19 18:49       ` Mike Christie [this message]
2022-12-21  8:30         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ae8a2b8-9720-8e60-4431-072218e57e28@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ntsironis@arrikto.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.