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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 75832CF07DE for ; Thu, 10 Oct 2024 09:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OWD0yKiVcYBS1voEauZfnYYadb+/BqktjmDuqPOsWvY=; b=QCtHNBV5zjMWi0AJKASbDBPT+o 6A+VrSrV0b+6cH+X0rRdOVgjhXGiXU4jxLII+8xMkBpY+iDFplxTyh4H39F5Hwc0qDcdc8QyMrvvu cLV2gd582HrOo26n8Zw5xRxHpBC1r+tXlo3Eir0NcKsWTJg36Ks1EFOr748iJg1Z/1fEKwC3q7tWG eMdzSVnz4oKB0eHcPqfYKam5NjdSYyJJ4rHgGdwhaYQw64uq1MRatnrJ+PHgUojKEzOjLM09gQnji SKAPh6rq8PXcVBomAf1B3cWKZZ1XsnaC2PqSRQigLr1k58hn4Goy1ciim2+Q5U87kwFLzUSyK3s9K agTINA5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sypVu-0000000CF8q-3vXP; Thu, 10 Oct 2024 09:31:18 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sypVN-0000000CF2h-0tq1 for linux-nvme@lists.infradead.org; Thu, 10 Oct 2024 09:30:46 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id DEFCF227A8E; Thu, 10 Oct 2024 11:30:41 +0200 (CEST) Date: Thu, 10 Oct 2024 11:30:41 +0200 From: Christoph Hellwig To: Guixin Liu Cc: hch@lst.de, sagi@grimberg.me, kch@nvidia.com, d.bogdanov@yadro.com, linux-nvme@lists.infradead.org Subject: Re: [PATCH v13 2/2] nvmet: support reservation feature Message-ID: <20241010093041.GB9749@lst.de> References: <20241008102114.26199-1-kanie@linux.alibaba.com> <20241008102114.26199-3-kanie@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241008102114.26199-3-kanie@linux.alibaba.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_023045_419234_43306DC3 X-CRM114-Status: GOOD ( 17.49 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Tue, Oct 08, 2024 at 06:21:14PM +0800, Guixin Liu wrote: > This patch implements the reservation feature, includes: s/includes/including/ > 1. reservation register(register, unregister and replace). > 2. reservation acquire(acquire, preempt, preempt and abort). > 3. reservation release(release and clear). > 4. reservation report. > 5. set feature and get feature of reservation notify mask. > 6. get log page of reservation event. Maybe indent this bulleted list (and the other ones) by two characters to make it more readable? > Not supported: > 1. persistent reservation through power loss. > > Test: Tested-by: > Use nvme-cli and fio to test all implemented sub features: > 1. use nvme resv-register to register host a registrant or > unregister or replace a new key. > 2. use nvme resv-acquire to set host to the holder, and use fio > to send read and write io in all reservation type. And also test > preempt and "preempt and abort". > 3. use nvme resv-report to show all registrants and reservation > status. > 4. use nvme resv-release to release all registrants. > 5. use nvme get-log to get events generated by the preceding > operations. That's still very basic testing, but I have no really good answer what good test suite would be. > +static ssize_t nvmet_ns_resv_enable_store(struct config_item *item, > + const char *page, size_t count) The indentation used in most nvme code is two tabs for prototype continuations, can you change to that? I.e.: static ssize_t nvmet_ns_resv_enable_store(struct config_item *item, const char *page, size_t count) > +#define NVMET_PR_NOTIFI_MASK_ALL \ > + (1 << NVME_PR_NOTIFY_BIT_REG_PREEMPTED | \ > + 1 << NVME_PR_NOTIFY_BIT_RESV_RELEASED | \ > + 1 << NVME_PR_NOTIFY_BIT_RESV_PREEMPTED) And here I'd expect a single tab indent. Except for these nitpicks the code looks good to me: Reviewed-by: Christoph Hellwig