From: Anastasia Kovaleva <a.kovaleva@yadro.com>
To: <target-devel@vger.kernel.org>
Cc: <linux-scsi@vger.kernel.org>, <linux@yadro.com>
Subject: [v2,PATCH 0/3] Make target send correct io limits
Date: Fri, 14 Oct 2022 14:45:46 +0300 [thread overview]
Message-ID: <20221014114549.32888-1-a.kovaleva@yadro.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 2580 bytes --]
Currently iblock always reports MAXIMUM TRANSFER LENGTH in 512b units
regardless of the LU block size.
Target block size:
target:~ # fdisk -l /dev/nullb0
Disk /dev/nullb0: 250 GiB, 268435456000 bytes, 65536000 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Initiator block size:
initiator:~ # fdisk -l /dev/sdc
Disk /dev/sdc: 250 GiB, 268435456000 bytes, 65536000 sectors
Disk model: nullb0
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 131072 bytes
target max transfer length limit:
target:~ # cat /sys/block/nullb0/queue/max_hw_sectors_kb
128
So the maximum transfer length should be 128 * 1024 / 4096 = 32 blocks
But the target sends MTL in 512b units, so the initiators see 256 blocks
instead.
initiator:~ # sg_inq -p 0xb0 /dev/sdc
VPD INQUIRY: Block limits page (SBC)
Maximum compare and write length: 1 blocks
Optimal transfer length granularity: 1 blocks
Maximum transfer length: 256 blocks
Optimal transfer length: 32 blocks
Maximum prefetch transfer length: 0 blocks [ignored]
This happens because MAXIMUM TRANSFER LENGTH field in VPD Block Limits
page is derived from dev->dev_attrib.hw_max_sectors which happens to be
in 512b units for iblock. This patch series fixes this issue and removes
some special-casing for other backstores.
The last time this patch set was sent, a kernel bot found some issues
with building a kernel for i586 and m68k using a cross-compiler. I tried
to reproduce this issues locally but didn't succeed. Even with given
configs all things are built correctly without errors. For m68k I used
m68k-linux-gnu-gcc version 11.2.0, for i586 I used
i586-unknown-linux-gnu-gcc version 8.3.0. It would be great if you could
share the kernel bot’s cross-compilers.
Anastasia Kovaleva (3):
target: core: Send mtl in blocks
target: core: make hw_max_sectors store the sectors amount in blocks
target: core: Change the way target_xcopy_do_work sets restiction on
max io
drivers/target/target_core_configfs.c | 2 -
drivers/target/target_core_file.c | 1 -
drivers/target/target_core_iblock.c | 4 +-
drivers/target/target_core_spc.c | 6 +-
drivers/target/target_core_xcopy.c | 96 ++++++++++++++-------------
drivers/target/target_core_xcopy.h | 2 +-
include/target/target_core_base.h | 1 -
7 files changed, 59 insertions(+), 53 deletions(-)
--
2.30.2
next reply other threads:[~2022-10-14 11:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-14 11:45 Anastasia Kovaleva [this message]
2022-10-14 11:45 ` [v2,PATCH 1/3] target: core: Send mtl in blocks Anastasia Kovaleva
2022-10-17 6:05 ` Christoph Hellwig
2022-10-14 11:45 ` [v2,PATCH 2/3] target: core: make hw_max_sectors store the sectors amount " Anastasia Kovaleva
2022-10-17 6:05 ` Christoph Hellwig
2022-10-14 11:45 ` [v2,PATCH 3/3] target: core: Change the way target_xcopy_do_work sets restiction on max io Anastasia Kovaleva
2022-10-17 6:06 ` Christoph Hellwig
2022-10-18 10:22 ` kernel test robot
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=20221014114549.32888-1-a.kovaleva@yadro.com \
--to=a.kovaleva@yadro.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@yadro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox