From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64259C4332F for ; Wed, 20 Apr 2022 05:33:46 +0000 (UTC) Received: from localhost ([::1]:50704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nh2yH-0000GZ-3b for qemu-devel@archiver.kernel.org; Wed, 20 Apr 2022 01:33:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh2vj-0007NJ-DR; Wed, 20 Apr 2022 01:31:13 -0400 Received: from verein.lst.de ([213.95.11.211]:41922) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh2vg-0001W5-8g; Wed, 20 Apr 2022 01:31:05 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 9BAF267373; Wed, 20 Apr 2022 07:30:59 +0200 (CEST) Date: Wed, 20 Apr 2022 07:30:59 +0200 From: Christoph Hellwig To: Klaus Jensen Subject: Re: [PATCH 2/5] hw/nvme: always set eui64 Message-ID: <20220420053059.GB1901@lst.de> References: <20220419121039.1259477-1-its@irrelevant.dk> <20220419121039.1259477-3-its@irrelevant.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220419121039.1259477-3-its@irrelevant.dk> User-Agent: Mutt/1.5.17 (2007-11-01) Received-SPF: none client-ip=213.95.11.211; envelope-from=hch@lst.de; helo=verein.lst.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org, Klaus Jensen , qemu-devel@nongnu.org, Luis Chamberlain , Keith Busch , Christoph Hellwig Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Apr 19, 2022 at 02:10:36PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > 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:. 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? 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. 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.