public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Anuj Gupta <anuj20.g@samsung.com>
Cc: jack@suse.cz, anuj1072538@gmail.com, axboe@kernel.dk,
	viro@zeniv.linux.org.uk, brauner@kernel.org, hch@infradead.org,
	martin.petersen@oracle.com, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, joshi.k@samsung.com
Subject: Re: [RFC] fs: add ioctl to query protection info capabilities
Date: Wed, 28 May 2025 23:02:32 -0400	[thread overview]
Message-ID: <yq1jz60gmyv.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20250527104237.2928-1-anuj20.g@samsung.com> (Anuj Gupta's message of "Tue, 27 May 2025 16:12:37 +0530")


Hi Anuj!

Thanks for working on this!

> 4. tuple_size: size (in bytes) of the protection information tuple.
> 6. pi_offset: offset of protection info within the tuple.

I find this a little confusing. The T10 PI tuple is <guard, app, ref>.

I acknowledge things currently are a bit muddy in the block layer since
tuple_size has been transmogrified to hold the NVMe metadata size.

But for a new user-visible interface I think we should make the
terminology clear. The tuple is the PI and not the rest of the metadata.

So I think you'd want:

4. metadata_size: size (in bytes) of the metadata associated with each interval.
6. pi_offset: offset of protection information tuple within the metadata.

> +#define	FILE_PI_CAP_INTEGRITY		(1 << 0)
> +#define	FILE_PI_CAP_REFTAG		(1 << 1)

You'll also need to have corresponding uapi defines for:

enum blk_integrity_checksum {
        BLK_INTEGRITY_CSUM_NONE         = 0,
        BLK_INTEGRITY_CSUM_IP           = 1,
        BLK_INTEGRITY_CSUM_CRC          = 2,
        BLK_INTEGRITY_CSUM_CRC64        = 3,
} __packed ;

> +
> +/*
> + * struct fs_pi_cap - protection information(PI) capability descriptor
> + * @flags:			Bitmask of capability flags
> + * @interval:		Number of bytes of data per PI tuple
> + * @csum_type:		Checksum type
> + * @tuple_size:		Size in bytes of the PI tuple
> + * @tag_size:		Size of the tag area within the tuple
> + * @pi_offset:		Offset in bytes of the PI metadata within the tuple
> + * @rsvd:			Reserved for future use

See above for distinction between metadata and PI tuple. The question is
whether we need to report the size of those two separately (both in
kernel and in this structure). Otherwise how do we know how big the PI
tuple is? Or do we infer that from the csum_type?

Also, for the extended NVMe PI types we'd probably need to know the size
of the ref tag and the storage tag.

-- 
Martin K. Petersen

  reply	other threads:[~2025-05-29  3:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250527105950epcas5p1b53753ab614bf6bde4ffbf5165c7d263@epcas5p1.samsung.com>
2025-05-27 10:42 ` [RFC] fs: add ioctl to query protection info capabilities Anuj Gupta
2025-05-29  3:02   ` Martin K. Petersen [this message]
2025-05-29  7:12     ` Anuj Gupta/Anuj Gupta
2025-05-29 17:59       ` Eric Biggers
2025-05-30  5:24         ` Christian Brauner
2025-06-03 18:43           ` Anuj gupta
2025-06-04  7:53             ` Christian Brauner
2025-06-04  7:57               ` Christoph Hellwig
2025-06-05  8:24                 ` Christian Brauner
2025-05-29 21:14       ` [RFC] " Andreas Dilger
2025-06-03  3:12       ` [RFC] fs: " Martin K. Petersen
2025-06-03  6:30         ` Christoph Hellwig
2025-06-04  1:48           ` Martin K. Petersen

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=yq1jz60gmyv.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=anuj1072538@gmail.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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