Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "alan.adamson@oracle.com" <alan.adamson@oracle.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: Issue with AWUPF when using multiple controllers in a subsystem
Date: Tue, 8 Apr 2025 21:08:18 +0000	[thread overview]
Message-ID: <90792c66-d0ca-401d-b171-57faea2c2cab@nvidia.com> (raw)
In-Reply-To: <4a2e4561-9311-40c9-aa65-87e7a2e5b041@oracle.com>

On 4/4/25 15:42, alan.adamson@oracle.com wrote:
> While testing atomic write parameters with multiple controllers within 
> a subsystem, I found an issue:
>
> QEMU-NVME Configuartion
> =================
> -device nvme-subsys,id=subsys0 \
> -device 
> nvme,serial=deadbeef,id=nvme0,subsys=subsys0,atomic.dn=off,atomic.awun=31,atomic.awupf=15 
> \
> -device 
> nvme,serial=deadbeef,id=nvme1,subsys=subsys0,atomic.dn=off,atomic.awun=127,atomic.awupf=63 
> \
> -drive id=ns1,file=/dev/nullb3,if=none \
> -drive id=ns2,file=/dev/nullb2,if=none \
> -device nvme-ns,drive=ns1,bus=nvme0,nsid=1,shared=false \
> -device nvme-ns,drive=ns2,bus=nvme1,nsid=2,shared=false \
>
> [root@localhost ~]# nvme id-ctrl /dev/nvme1n2 | grep awupf
> awupf     : 63
> [root@localhost ~]# cat /sys/block/nvme1n2/queue/atomic_write_max_bytes
> 32768
> [root@localhost ~]# nvme id-ctrl /dev/nvme1n1 | grep awupf
> awupf     : 15
> [root@localhost ~]# cat /sys/block/nvme1n1/queue/atomic_write_max_bytes
> 32768
> [root@localhost ~]#
>
> When dumping the awupf value with nvme-cli, the values match what was 
> setup in qemu, but when each devices atomic queue limits was 
> displayed, it didn't match its awupf. Currently the awupf is saved in 
> the nvme_subsystem, but the awupf is specific to the controller, not 
> the subsystem. Two controllers in a subsystem can have different 
> atomic parameters.
>
> The commit 81adb8633491 ("nvme: set physical block size and optimal 
> I/O size") added subsys->awupf.
>
> I think the awupf belongs in the nvme_ctrl structure. 

AWUPF is a part of Identify controller data structure so Ideally
it should be part of the controller attribute.

 From NVM Express® Base Specification, Revision 2.2, March 11th,
2025 Page 319 :-

Figure 313: Identify – Identify Controller Data Structure,
I/O Command Set Independent

529:528

Atomic Write Unit Power Fail (AWUPF): This field is specific
to namespaces that are associated with command sets that
specify logical blocks (i.e., Command Set Identifier 0h or 2h),
and shall be cleared to 0h for namespaces that are not associated
with command sets that specify logical blocks. Refer to the
applicable I/O Command Set specification (e.g., the Atomic Operation
section of the NVM Command Set Specification).

-ck



  reply	other threads:[~2025-04-08 21:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04 22:42 Issue with AWUPF when using multiple controllers in a subsystem alan.adamson
2025-04-08 21:08 ` Chaitanya Kulkarni [this message]
2025-04-09  9:01   ` Christoph Hellwig
2025-04-10  9:09     ` John Garry
2025-04-10  9:19       ` Christoph Hellwig
2025-04-10 10:11         ` John Garry
2025-04-08 21:08 ` Chaitanya Kulkarni
2025-04-09  9:05 ` Christoph Hellwig
2025-04-10  1:33   ` Chaitanya Kulkarni
2025-04-10  8:32     ` Christoph Hellwig
2025-04-10  9:07       ` Keith Busch
2025-04-10  9:17         ` Christoph Hellwig

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=90792c66-d0ca-401d-b171-57faea2c2cab@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=alan.adamson@oracle.com \
    --cc=linux-nvme@lists.infradead.org \
    /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