Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stephane Thiell" <sthiell@hudson-trading.com>,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-rdma: add a module parameter to disable T10-PI offload
Date: Thu, 12 Nov 2026 20:16:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-211787@kernel.org> (raw)
In-Reply-To: <20261112194838.928882-1-sthiell@hudson-trading.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] nvme-rdma: inaccurate commit message claim on PI namespace
  capacity
--

commit e90985fd114ef929dfa083aabec197dab7d0860a
Author: Stephane Thiell <sthiell@hudson-trading.com>

nvme-rdma: add a module parameter to disable T10-PI offload

This commit adds a pi_enable module parameter to nvme-rdma to allow
disabling T10-PI offload and avoiding integrity MR pool allocations on
RDMA devices that advertise IBK_INTEGRITY_HANDOVER.

>     Add a pi_enable module parameter. With pi_enable=0, pi_capable stays
>     false in nvme_rdma_configure_admin_queue() and the controller is set up
>     as on a device without integrity handover: max_integrity_segments is 0
>     and no integrity MR pool is allocated. As on such a device, a namespace
>     formatted with protection information is not usable (the core gives it
>     a capacity of 0).

[Severity: Low]
Is the commit message accurate about PI-formatted namespaces getting a
capacity of 0 when pi_enable=0?

nvme_rdma_ctrl_ops.flags sets NVME_F_METADATA_SUPPORTED unconditionally,
so nvme_configure_metadata() still populates head->pi_type and
head->pi_size when ctrl->max_integrity_segments is 0, and only omits
NVME_NS_METADATA_SUPPORTED from head->features:

drivers/nvme/host/core.c:nvme_init_integrity() {
	if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY) ||
	    !(head->features & NVME_NS_METADATA_SUPPORTED))
		return nvme_ns_has_pi(head);

For a PI-formatted namespace where ms == pi_size, nvme_ns_has_pi(head) is
true, so nvme_init_integrity() returns true and nvme_update_ns_info_block()
keeps the full namespace capacity (using NVME_RW_PRINFO_PRACT for
controller-side PI insert/strip), only zeroing capacity for metadata
namespaces where !nvme_ns_has_pi(head).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261112194838.928882-1-sthiell@hudson-trading.com?part=1


      reply	other threads:[~2026-11-12 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 19:48 [PATCH] nvme-rdma: add a module parameter to disable T10-PI offload Stephane Thiell
2026-11-12 20:16 ` sashiko-bot [this message]

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=sashiko-outbox-211787@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sthiell@hudson-trading.com \
    /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