qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>,
	Klaus Jensen <k.jensen@samsung.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 2/5] hw/nvme: always set eui64
Date: Wed, 20 Apr 2022 07:48:59 +0200	[thread overview]
Message-ID: <Yl+ey8yiaSrYY0CB@apples> (raw)
In-Reply-To: <20220420053059.GB1901@lst.de>

[-- Attachment #1: Type: text/plain, Size: 2148 bytes --]

On Apr 20 07:30, Christoph Hellwig wrote:
> On Tue, Apr 19, 2022 at 02:10:36PM +0200, Klaus Jensen wrote:
> > From: Klaus Jensen <k.jensen@samsung.com>
> > 
> > Unconditionally set an EUI64 for namespaces. The nvme-ns device defaults
> > to auto-generating a persistent EUI64 if not specified, but for single
> > namespace setups (-device nvme,drive=...), this does not happen.
> > 
> > Since the EUI64 has previously been zeroed it is not considered valid,
> > so it should be safe to add this now.
> > 
> > The generated EUI64 is of the form 52:54:00:<namespace counter>. Note,
> > this is NOT the namespace identifier since that is not unique across
> > subsystems; it is a global namespace counter. This has the effect that
> > the value of this auto-generated EUI64 is dependent on the order with
> > which the namespaces are created. If a more flexible setup is required,
> > the eui64 namespace parameter should be explicitly set. Update the
> > documentation to make this clear.
> 
> How is this actually globally unique given that it uses a start value
> that is incremented for each created namespace?

I think it is as good as we can do when we cannot store the EUI64
persistently anywhere. The EUI64s will be unique to a single QEMU
instance. If someone wants to simulate a fabrics setup or something like
that, then, as per the documentation, set the EUI explicitly.

> Also EUI64 values are based on a OUI, while NVME_EUI64_DEFAULT seems
> to have the OUI values cleared to all zero as far as I can tell.
> 

It really should be a u8 array, yes, but won't the integer approach
work? The "template" is byte swapped to big endian, or am I off here?

> I would strongly advise againt autogenerating eui64 values.  They are
> small and have little entropy, and require at least three bytes (for
> new allocations more) to be set to a IEEE assigned OUI.

52:54:00 is a "private" OUI if I am not mistaken (something about some
bit being 1 or 0, cant remember the specifics) and is what QEMU uses
when an IEEE OUI is needed (MAC-addresses etc.). This is also what the
device uses in the IEEE field.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-04-20  6:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 12:10 [PATCH 0/5] hw/nvme: fix namespace identifiers Klaus Jensen
2022-04-19 12:10 ` [PATCH 1/5] hw/nvme: enforce common serial per subsystem Klaus Jensen
2022-04-20  5:20   ` Christoph Hellwig
2022-04-19 12:10 ` [PATCH 2/5] hw/nvme: always set eui64 Klaus Jensen
2022-04-20  5:30   ` Christoph Hellwig
2022-04-20  5:48     ` Klaus Jensen [this message]
2022-04-20  6:02       ` Klaus Jensen
2022-04-19 12:10 ` [PATCH 3/5] hw/nvme: do not report null uuid Klaus Jensen
2022-04-20  5:31   ` Christoph Hellwig
2022-04-19 12:10 ` [PATCH 4/5] hw/nvme: do not auto-generate uuid Klaus Jensen
2022-04-20  5:33   ` Christoph Hellwig
2022-04-20  5:51     ` Klaus Jensen
2022-04-20  6:53       ` Christoph Hellwig
2022-04-20  6:58         ` Klaus Jensen
2022-04-19 12:10 ` [PATCH 5/5] hw/nvme: bump firmware revision Klaus Jensen
2022-04-19 14:32 ` [PATCH 0/5] hw/nvme: fix namespace identifiers Keith Busch

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=Yl+ey8yiaSrYY0CB@apples \
    --to=its@irrelevant.dk \
    --cc=hch@lst.de \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=mcgrof@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).