mbox series

[0/3] Block integrity with flexibile-offset PI

Message ID 20240130171206.4845-1-joshi.k@samsung.com (mailing list archive)
Headers show
Series Block integrity with flexibile-offset PI | expand

Message

Kanchan Joshi Jan. 30, 2024, 5:12 p.m. UTC
The block integrity subsystem can only work with PI placed in the first
bytes of the metadata buffer.

The series makes block-integrity support the flexible placement of PI.
And changes NVMe driver to make use of the new capability.

This helps to
(i) enable the more common case for NVMe (PI in last bytes is the norm)
(ii) reduce nop profile users (tried by Jens recently [1]).

/* For NS 4K+16b, 8b PI, last bytes */
Before:
# cat /sys/block/nvme0n1/integrity/format
nop

After:
# cat /sys/block/nvme0n1/integrity/format
T10-DIF-TYPE1-CRC

[1] https://lore.kernel.org/linux-block/20240111160226.1936351-1-axboe@kernel.dk/

Kanchan Joshi (3):
  block: refactor guard helpers
  block: support PI at non-zero offset within metadata
  nvme: allow integrity when PI is not in first bytes

 block/bio-integrity.c         |  1 +
 block/blk-integrity.c         |  1 +
 block/t10-pi.c                | 72 +++++++++++++++++++++++------------
 drivers/nvme/host/core.c      |  8 +++-
 drivers/nvme/host/nvme.h      |  1 +
 include/linux/blk-integrity.h |  1 +
 include/linux/blkdev.h        |  1 +
 7 files changed, 60 insertions(+), 25 deletions(-)

Comments

Keith Busch Jan. 31, 2024, 5:44 p.m. UTC | #1
On Tue, Jan 30, 2024 at 10:42:03PM +0530, Kanchan Joshi wrote:
> The block integrity subsystem can only work with PI placed in the first
> bytes of the metadata buffer.
> 
> The series makes block-integrity support the flexible placement of PI.
> And changes NVMe driver to make use of the new capability.
> 
> This helps to
> (i) enable the more common case for NVMe (PI in last bytes is the norm)
> (ii) reduce nop profile users (tried by Jens recently [1]).
> 
> /* For NS 4K+16b, 8b PI, last bytes */
> Before:
> # cat /sys/block/nvme0n1/integrity/format
> nop
> 
> After:
> # cat /sys/block/nvme0n1/integrity/format
> T10-DIF-TYPE1-CRC

Your series looks good to me.

Reviewed-by: Keith Busch <kbusch@kernel.org>

While reviewing, I realized O_DIRECT with DMA aligned offsets smaller
than block sized offsets can create segments that break PI iterations.
Not your problem, just mentioning it because I noticed ... and since I
introduced DMA aligned offsets, I should probably take a shot at fixing
that.
Martin K. Petersen Jan. 31, 2024, 5:48 p.m. UTC | #2
Kanchan,

> The block integrity subsystem can only work with PI placed in the
> first bytes of the metadata buffer.
>
> The series makes block-integrity support the flexible placement of PI.
> And changes NVMe driver to make use of the new capability.
>
> This helps to
> (i) enable the more common case for NVMe (PI in last bytes is the norm)
> (ii) reduce nop profile users (tried by Jens recently [1]).

Looks OK to me.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>