scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE
authorBodo Stroesser <bostroesser@gmail.com>
Wed, 24 Mar 2021 19:57:55 +0000 (20:57 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Apr 2021 02:40:55 +0000 (22:40 -0400)
commitf5ce815f34bc97b92f5605eced806f1d32e1d602
tree776557b906bfa9faf1ebbc02b07f611851ebeb88
parent8b084d9dfb0158362c3be6ee7fdc8c8320a0ba30
scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE

Change tcmu to support DATA_BLOCK_SIZE being a multiple of PAGE_SIZE. There
are two reasons why one would like to have a bigger DATA_BLOCK_SIZE:

 1) If userspace - e.g. due to data compression, encryption or
    deduplication - needs to have receive or transmit data in a consecutive
    buffer, we can define DATA_BLOCK_SIZE to the maximum size of a SCSI
    READ/WRITE to enforce that userspace sees just one consecutive
    buffer. That way we can avoid the need for doing data copy in
    userspace.

 2) Using a bigger data block size can speed up command processing in
    tcmu. The number of free data blocks to look up in bitmap is reduced
    substantially. The lookup for data pages in radix_tree can be done more
    efficiently if there are multiple pages in a data block. The maximum
    number of IOVs to set up is lower so cmd entries in the ring become
    smaller.

Link: https://lore.kernel.org/r/20210324195758.2021-4-bostroesser@gmail.com
Signed-off-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_user.c