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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 331F2C47082 for ; Mon, 31 May 2021 20:55:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8010360FEF for ; Mon, 31 May 2021 20:55:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8010360FEF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnowy-0000xf-Da for qemu-devel@archiver.kernel.org; Mon, 31 May 2021 16:55:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnou5-0006ZI-R9; Mon, 31 May 2021 16:52:53 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:41727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnou3-00032O-RA; Mon, 31 May 2021 16:52:53 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1656919A5; Mon, 31 May 2021 16:52:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 31 May 2021 16:52:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Xsg5BmmCZ47yke2CVFVVlCpeggj cDjdh/1VX18joHTY=; b=K69hA9alCb19u47WgpOU+aF6rixCOtJLKdmy/xI9rHG +jdWKDd4aErHvoHZ9iDxrEPFe1XDmhGp45Mt8R6A25LOhVnq0JvKCcsQAFwpKNvw fgfh9EsiVgk+d9pYPhriZ4qVYXLZ2H98zt2H4+sjLDARR5ozGmZBFXsYueyVyei0 EGVVqL7035tfoEtimCr+ii+nUVjdCxrmU3VuYEAT/E7Xw1u7P/by0RiCeNdVEjQP 1iqGrwgeigZLgib78ipMHXwJEBrSusdDAMuY1hFPgSiIpBXGeu/2jbveHVvf7v+g s9ukF112ZLjajs0R5daYqh2fvBEslgrc6aZvh2WSkfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Xsg5Bm mCZ47yke2CVFVVlCpeggjcDjdh/1VX18joHTY=; b=K4yDFIaan5gBptEUhHmorZ XI71+aYhXp2ayLQcATm6lWSJKsWzd/lYcSqkzCXMxdsMRFej+tbjqCLiPwn4ywGr u191uPK9ZDscREi0vO6ehTQ47rxZwG3c+lWEsNN/XaulQJdWymAvwK5KW71Bxq75 6QjhiMFg8n71Hz5OPI6FUEc7/DzoQVz8cUU/J8A59CbhSqk3DOOzyJ3K6VNDfUYt AmktsICWvra05+RxXdnfy8AlHkLzMBClf8XssAezfkr7YYyeykr3bOc2U/SrQi1C PLFTpp1Zy3g4v3jcbFVI217wOHBuvM+5U9qxgmzTHqEBoJq0cNXdkqNPDdXQJCKw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdelfedgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehgtd erredttdejnecuhfhrohhmpefmlhgruhhsucflvghnshgvnhcuoehithhssehirhhrvghl vghvrghnthdrughkqeenucggtffrrghtthgvrhhnpeejgeduffeuieetkeeileekvdeule etveejudeileduffefjeegfffhuddvudffkeenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 May 2021 16:52:45 -0400 (EDT) Date: Mon, 31 May 2021 22:52:44 +0200 From: Klaus Jensen To: Gollu Appalanaidu Subject: Re: [PATCH 1/3] hw/nvme/ctrl: add controller list cns 0x13 Message-ID: References: <20210517100736.17063-1-anaidu.gollu@samsung.com> <20210517100736.17063-2-anaidu.gollu@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mqnSYLs3tjCMsVBP" Content-Disposition: inline In-Reply-To: <20210517100736.17063-2-anaidu.gollu@samsung.com> Received-SPF: pass client-ip=64.147.123.21; envelope-from=its@irrelevant.dk; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, kbusch@kernel.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --mqnSYLs3tjCMsVBP Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On May 17 15:37, Gollu Appalanaidu wrote: >Add the controller identifiers list available in NVM Subsystem >that may or may not be attached to namespaces. > >Signed-off-by: Gollu Appalanaidu >--- > hw/nvme/ctrl.c | 25 +++++++++++++++---------- > hw/nvme/trace-events | 2 +- > include/block/nvme.h | 1 + > 3 files changed, 17 insertions(+), 11 deletions(-) > >diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c >index 2e7498a73e..d08a3350e2 100644 >--- a/hw/nvme/ctrl.c >+++ b/hw/nvme/ctrl.c >@@ -4251,7 +4251,8 @@ static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeRe= quest *req, bool active) > return NVME_INVALID_CMD_SET | NVME_DNR; > } > >-static uint16_t nvme_identify_ns_attached_list(NvmeCtrl *n, NvmeRequest *= req) >+static uint16_t nvme_identify_ctrl_list(NvmeCtrl *n, NvmeRequest *req, >+ bool attached) > { > NvmeIdentify *c =3D (NvmeIdentify *)&req->cmd; > uint16_t min_id =3D le16_to_cpu(c->ctrlid); >@@ -4261,15 +4262,17 @@ static uint16_t nvme_identify_ns_attached_list(Nvm= eCtrl *n, NvmeRequest *req) > NvmeCtrl *ctrl; > int cntlid, nr_ids =3D 0; > >- trace_pci_nvme_identify_ns_attached_list(min_id); >+ trace_pci_nvme_identify_ctrl_list(c->cns, min_id); > >- if (c->nsid =3D=3D NVME_NSID_BROADCAST) { >- return NVME_INVALID_FIELD | NVME_DNR; >- } >+ if (attached) { >+ if (c->nsid =3D=3D NVME_NSID_BROADCAST) { >+ return NVME_INVALID_FIELD | NVME_DNR; >+ } > >- ns =3D nvme_subsys_ns(n->subsys, c->nsid); >- if (!ns) { >- return NVME_INVALID_FIELD | NVME_DNR; >+ ns =3D nvme_subsys_ns(n->subsys, c->nsid); >+ if (!ns) { >+ return NVME_INVALID_FIELD | NVME_DNR; >+ } > } > > for (cntlid =3D min_id; cntlid < ARRAY_SIZE(n->subsys->ctrls); cntlid= ++) { >@@ -4278,7 +4281,7 @@ static uint16_t nvme_identify_ns_attached_list(NvmeC= trl *n, NvmeRequest *req) > continue; > } > >- if (!nvme_ns(ctrl, c->nsid)) { >+ if (attached && !nvme_ns(ctrl, c->nsid)) { > continue; > } > >@@ -4493,7 +4496,9 @@ static uint16_t nvme_identify(NvmeCtrl *n, NvmeReque= st *req) > case NVME_ID_CNS_NS_PRESENT: > return nvme_identify_ns(n, req, false); > case NVME_ID_CNS_NS_ATTACHED_CTRL_LIST: >- return nvme_identify_ns_attached_list(n, req); >+ return nvme_identify_ctrl_list(n, req, true); >+ case NVME_ID_CNS_CTRL_LIST: >+ return nvme_identify_ctrl_list(n, req, false); > case NVME_ID_CNS_CS_NS: > return nvme_identify_ns_csi(n, req, true); > case NVME_ID_CNS_CS_NS_PRESENT: >diff --git a/hw/nvme/trace-events b/hw/nvme/trace-events >index ea33d0ccc3..7ba3714671 100644 >--- a/hw/nvme/trace-events >+++ b/hw/nvme/trace-events >@@ -55,7 +55,7 @@ pci_nvme_identify(uint16_t cid, uint8_t cns, uint16_t ct= rlid, uint8_t csi) "cid > pci_nvme_identify_ctrl(void) "identify controller" > pci_nvme_identify_ctrl_csi(uint8_t csi) "identify controller, csi=3D0x%"P= RIx8"" > pci_nvme_identify_ns(uint32_t ns) "nsid %"PRIu32"" >-pci_nvme_identify_ns_attached_list(uint16_t cntid) "cntid=3D%"PRIu16"" >+pci_nvme_identify_ctrl_list(uint8_t cns, uint16_t cntid) "cns 0x%"PRIx8" = cntid=3D%"PRIu16"" Inconsistency here. Please use "field value", not "field=3Dvalue" for=20 cntid. > pci_nvme_identify_ns_csi(uint32_t ns, uint8_t csi) "nsid=3D%"PRIu32", csi= =3D0x%"PRIx8"" > pci_nvme_identify_nslist(uint32_t ns) "nsid %"PRIu32"" > pci_nvme_identify_nslist_csi(uint16_t ns, uint8_t csi) "nsid=3D%"PRIu16",= csi=3D0x%"PRIx8"" >diff --git a/include/block/nvme.h b/include/block/nvme.h >index 0ff9ce17a9..188ab460df 100644 >--- a/include/block/nvme.h >+++ b/include/block/nvme.h >@@ -980,6 +980,7 @@ enum NvmeIdCns { > NVME_ID_CNS_NS_PRESENT_LIST =3D 0x10, > NVME_ID_CNS_NS_PRESENT =3D 0x11, > NVME_ID_CNS_NS_ATTACHED_CTRL_LIST =3D 0x12, >+ NVME_ID_CNS_CTRL_LIST =3D 0x13, > NVME_ID_CNS_CS_NS_PRESENT_LIST =3D 0x1a, > NVME_ID_CNS_CS_NS_PRESENT =3D 0x1b, > NVME_ID_CNS_IO_COMMAND_SET =3D 0x1c, >--=20 >2.17.1 > --=20 One of us - No more doubt, silence or taboo about mental illness. --mqnSYLs3tjCMsVBP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmC1TJoACgkQTeGvMW1P DekYhQf/Tsy5EdGFlbFNRLOJlRTwPkoZD6cWY8rlSxN3to+jPtGfGHOiANlnKZM5 b463ia4onHvz53oAP1tkVJxmlIcLDmMEyVLHl6uvs2M7I78pEUaQ/oBiKrtgiMir hu7zmrVlaczbsdeuw6igshSMxyhbecHnitaPi75BadM1zkvvtoCLNW0iAwyzbDGK KGqa/ymp3CEWfyCvthdtUa+siVapo4ZhwnilPAKEqpJ9jKAjWQcaY9iuhY7A5He9 4NW1x9I0KfSD+Jmkp7NG8h+UEmY0QTUr6/Ri2lMQf+SLrcFR7AkRVKLGeulfT1uP 6k2woNiVI5RvYMy2F/svDQRfH3Jx4w== =XUjh -----END PGP SIGNATURE----- --mqnSYLs3tjCMsVBP--