qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: alan.adamson@oracle.com
To: Klaus Jensen <its@irrelevant.dk>
Cc: qemu-devel@nongnu.org, foss@defmacro.it, kbusch@kernel.org,
	qemu-block@nongnu.org
Subject: Re: [PATCH 0/1] hw/nvme: create parameter to enable/disable cmic on subsystem
Date: Wed, 9 Apr 2025 16:37:22 -0700	[thread overview]
Message-ID: <e0e94b1e-e422-4c77-b162-598a95872458@oracle.com> (raw)
In-Reply-To: <Z_YX_0KLEfcjWHNh@AALNPWKJENSEN.aal.scsc.local>


On 4/8/25 11:47 PM, Klaus Jensen wrote:
> On Apr  8 15:56, Alan Adamson wrote:
>> While testing Linux atomic writes with qemu-nvme v10.0.0-rc1, Linux was
>> incorrectly displaying atomic_write_max_bytes
>> # cat /sys/block/nvme0n1/queue/atomic_write_max_bytes
>> 0
>> # nvme id-ctrl /dev/nvme0n1 | grep awupf
>> awupf     : 15
>> #
>> Since AWUPF was set to 15, it was expected atomic_write_max_bytes would
>> be set to 8192.
>>
>> The commit cd59f50ab017 ("hw/nvme: always initialize a subsystem")
>> introduced this behavior. The commit hardcodes the subsystem cmic bit
>> to ON which caused the Linux NVMe driver to treat the namespace as
>> multi-pathed which uncovered a bug with how Atomic Write Queue Limits
>> were being inherited.  This Linux issue is being addressed, but the
>> question was asked of why the subsystem cmic bit was hardcoded to ON.
>> Most NVMe devices today don't set cmic to ON. Shouldn't the setting of
>> this bit be a settable parameter?
>>
>> <subsystem>,cmic=BOOLEAN (default: off)
>>
>> Example:
>>      -device nvme-subsys,id=subsys0,cmic=on \
>>      -device nvme,serial=deadbeef,id=nvme0,subsys=subsys0,atomic.dn=off,atomic.awun=31,atomic.awupf=15 \
>>      -drive id=ns1,file=/dev/nullb3,if=none \
>>      -device nvme-ns,drive=ns1,bus=nvme0,nsid=1,shared=false
>>
>> Alan Adamson (1):
>>    hw/nvme: create parameter to enable/disable cmic on subsystem
>>
>>   hw/nvme/ctrl.c   | 5 ++++-
>>   hw/nvme/nvme.h   | 1 +
>>   hw/nvme/subsys.c | 1 +
>>   3 files changed, 6 insertions(+), 1 deletion(-)
>>
>> -- 
>> 2.43.5
>>
>>
> Hi Alan,
>
> I agree that it would be better for CMIC.MCTRS to remain zero for
> single-controller subsystems, but I'd rather not add the parameter
> without verifying it (it would be invalid to have a multi-controller
> subsystem with CMIC.MCTRS zeroed).
>
> An improvement would be to just set it if the subsystems contains
> multiple controllers.
>
> Prior to commit cd59f50ab017 we would also statically set CMIC.MCTRS to
> 1 if a subsystem was configured, regardless of the number of
> controllers.

Klaus,

I'll send out a v2 that automatically sets CMIC.MCTRS for each 
controller of a multi-controller subsystem.  For single controller 
subsystems, CMIC.MCTRS will default to off and the cmic parameter can be 
used to change CMIC.MCTRS to on.

Thanks!

Alan



      reply	other threads:[~2025-04-09 23:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 22:56 [PATCH 0/1] hw/nvme: create parameter to enable/disable cmic on subsystem Alan Adamson
2025-04-08 22:56 ` [PATCH 1/1] " Alan Adamson
2025-04-09  6:47 ` [PATCH 0/1] " Klaus Jensen
2025-04-09 23:37   ` alan.adamson [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=e0e94b1e-e422-4c77-b162-598a95872458@oracle.com \
    --to=alan.adamson@oracle.com \
    --cc=foss@defmacro.it \
    --cc=its@irrelevant.dk \
    --cc=kbusch@kernel.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).