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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 3E505C433E0 for ; Tue, 16 Jun 2020 17:01:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10F5D2098B for ; Tue, 16 Jun 2020 17:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592326900; bh=EKyYHXK56kGXUHZvZEG6MdiO03J4tJGKnPinUlkYWWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=sqRaTwEVENv39bFuxfVzEjtRDxFMn6Z7SWNYhqghFDCSYcfXkZ9s1uZpaFVFItERS bjcKulJKLD9Qu4eTf2nCP12WVu8f4ylsheS6Yu4o5NP1be+yLl6PI12n7CBFqQYZEJ l9AGwY1r/+DbCZQKDedzuCPHSmWgrMaNWzbLlJjg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729811AbgFPRBj (ORCPT ); Tue, 16 Jun 2020 13:01:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:54290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728861AbgFPRBj (ORCPT ); Tue, 16 Jun 2020 13:01:39 -0400 Received: from dhcp-10-100-145-180.wdl.wdc.com (unknown [199.255.45.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D019E208E4; Tue, 16 Jun 2020 17:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592326898; bh=EKyYHXK56kGXUHZvZEG6MdiO03J4tJGKnPinUlkYWWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KjhgnnDoC0n2mREAdtWxwM7yLVLHZpLio6Cc2TqswBr0RJX6OtIQiOkSZiFvhA+74 eaFCNmfDRXiOjwZQOxeq/rPkOL4lz20M8kbRzQyGOlQ2MYmsnIbPg/R6DkqHGoQVyJ Sz4nq+YZmJ2v5qGUmGa4ZnVzQ9BlhkROF2tCFBXc= Date: Tue, 16 Jun 2020 10:01:35 -0700 From: Keith Busch To: "Martin K. Petersen" Cc: Keith Busch , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Damien Le Moal , Matias =?iso-8859-1?Q?Bj=F8rling?= , Christoph Hellwig , Sagi Grimberg , Jens Axboe , Niklas Cassel Subject: Re: [PATCH 3/5] nvme: implement I/O Command Sets Command Set support Message-ID: <20200616170135.GC521206@dhcp-10-100-145-180.wdl.wdc.com> References: <20200615233424.13458-1-keith.busch@wdc.com> <20200615233424.13458-4-keith.busch@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Tue, Jun 16, 2020 at 11:58:59AM -0400, Martin K. Petersen wrote: > > @@ -1113,8 +1126,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, > > status = nvme_submit_sync_cmd(ctrl->admin_q, &c, data, > > NVME_IDENTIFY_DATA_SIZE); > > if (status) { > > - dev_warn(ctrl->device, > > - "Identify Descriptors failed (%d)\n", status); > > + if (ctrl->vs >= NVME_VS(1, 3, 0)) > > + dev_warn(ctrl->device, > > + "Identify Descriptors failed (%d)\n", status); > > Not a biggie but maybe this should be a separate patch? Actually I think we can just get rid of this check before the warning. We only call this function if the version is >= 1.3 or if multi-css was selected. Both of those require this identification be supported. > > @@ -1808,7 +1828,8 @@ static bool nvme_ns_ids_equal(struct > > nvme_ns_ids *a, struct nvme_ns_ids *b) { return uuid_equal(&a->uuid, > > &b->uuid) && memcmp(&a->nguid, &b->nguid, sizeof(a->nguid)) == 0 && > > - memcmp(&a->eui64, &b->eui64, sizeof(a->eui64)) == 0; + > > memcmp(&a->eui64, &b->eui64, sizeof(a->eui64)) == 0 && + > > a->csi == b->csi; } > > No objection to defensive programming. But wouldn't this be a broken > device? It could be a broken device, but I think it's checking against mistaken identify, like if we're racing with namespace management commands deleting and recreating namespaces that the driver is still bound to. 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 6B373C433E0 for ; Tue, 16 Jun 2020 17:01:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 40A772098B for ; Tue, 16 Jun 2020 17:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Jwy5pOKf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KjhgnnDo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40A772098B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7od8ZPnOlRcC0emSc5cXdULpJ4097yFrQ+iQWTqcx6g=; b=Jwy5pOKf5xu86T Nob+vi95nFPo57VAfXVZRyVqKV6mVYFxUp9COXjt8Qp4A8SKLoYF0oQvluqChsP58Ew62jctBqXce vNqtVFzc9boex2CLyM7a/SitDVWx+pTaZLuzYao8BQtxidsGNXiSwvt4joj1dWKXUGmX283keVDUT nUcRBEZ+O296ykM1q4CRG/51aQEYaALJzpA4y1lsYG4e0c1KEEI/V/Fdr4DejNBefs7D7aSaTtfKs L+NoyFQztV0MST07FqU/iVYwvz9v5UKfUbKKf3SVSa1ZyEW0mfRQ9UARNqXZ0Pcpsj/Vlsmfv55Gv OqdhwLisWvD3hbk//ajg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlExx-0006JR-NZ; Tue, 16 Jun 2020 17:01:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlExv-0006J3-CU for linux-nvme@lists.infradead.org; Tue, 16 Jun 2020 17:01:40 +0000 Received: from dhcp-10-100-145-180.wdl.wdc.com (unknown [199.255.45.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D019E208E4; Tue, 16 Jun 2020 17:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592326898; bh=EKyYHXK56kGXUHZvZEG6MdiO03J4tJGKnPinUlkYWWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KjhgnnDoC0n2mREAdtWxwM7yLVLHZpLio6Cc2TqswBr0RJX6OtIQiOkSZiFvhA+74 eaFCNmfDRXiOjwZQOxeq/rPkOL4lz20M8kbRzQyGOlQ2MYmsnIbPg/R6DkqHGoQVyJ Sz4nq+YZmJ2v5qGUmGa4ZnVzQ9BlhkROF2tCFBXc= Date: Tue, 16 Jun 2020 10:01:35 -0700 From: Keith Busch To: "Martin K. Petersen" Subject: Re: [PATCH 3/5] nvme: implement I/O Command Sets Command Set support Message-ID: <20200616170135.GC521206@dhcp-10-100-145-180.wdl.wdc.com> References: <20200615233424.13458-1-keith.busch@wdc.com> <20200615233424.13458-4-keith.busch@wdc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_100139_455684_2DC55D32 X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , Niklas Cassel , Damien Le Moal , Sagi Grimberg , Keith Busch , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Christoph Hellwig , Matias =?iso-8859-1?Q?Bj=F8rling?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Tue, Jun 16, 2020 at 11:58:59AM -0400, Martin K. Petersen wrote: > > @@ -1113,8 +1126,9 @@ static int nvme_identify_ns_descs(struct nvme_ctrl *ctrl, unsigned nsid, > > status = nvme_submit_sync_cmd(ctrl->admin_q, &c, data, > > NVME_IDENTIFY_DATA_SIZE); > > if (status) { > > - dev_warn(ctrl->device, > > - "Identify Descriptors failed (%d)\n", status); > > + if (ctrl->vs >= NVME_VS(1, 3, 0)) > > + dev_warn(ctrl->device, > > + "Identify Descriptors failed (%d)\n", status); > > Not a biggie but maybe this should be a separate patch? Actually I think we can just get rid of this check before the warning. We only call this function if the version is >= 1.3 or if multi-css was selected. Both of those require this identification be supported. > > @@ -1808,7 +1828,8 @@ static bool nvme_ns_ids_equal(struct > > nvme_ns_ids *a, struct nvme_ns_ids *b) { return uuid_equal(&a->uuid, > > &b->uuid) && memcmp(&a->nguid, &b->nguid, sizeof(a->nguid)) == 0 && > > - memcmp(&a->eui64, &b->eui64, sizeof(a->eui64)) == 0; + > > memcmp(&a->eui64, &b->eui64, sizeof(a->eui64)) == 0 && + > > a->csi == b->csi; } > > No objection to defensive programming. But wouldn't this be a broken > device? It could be a broken device, but I think it's checking against mistaken identify, like if we're racing with namespace management commands deleting and recreating namespaces that the driver is still bound to. _______________________________________________ linux-nvme mailing list linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme