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

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 12 12:16:47 PST 2026


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 at 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



More information about the Linux-nvme mailing list