From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751372AbdFDPIw (ORCPT ); Sun, 4 Jun 2017 11:08:52 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36708 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbdFDPIq (ORCPT ); Sun, 4 Jun 2017 11:08:46 -0400 Subject: Re: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs To: Johannes Thumshirn , Christoph Hellwig , Keith Busch Cc: Hannes Reinecke , maxg@mellanox.com, Linux NVMe Mailinglist , Linux Kernel Mailinglist References: <20170604103649.22130-1-jthumshirn@suse.de> <20170604103649.22130-8-jthumshirn@suse.de> From: Sagi Grimberg Message-ID: Date: Sun, 4 Jun 2017 18:08:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170604103649.22130-8-jthumshirn@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/06/17 13:36, Johannes Thumshirn wrote: > Allow overriding the announced NVMe Version of a via configfs. > > This is particularly helpful when debugging new features for the host > or target side without bumping the hard coded version (as the target > might not be fully compliant to the announced version yet). > > Signed-off-by: Johannes Thumshirn > --- > drivers/nvme/target/configfs.c | 34 ++++++++++++++++++++++++++++++++++ > include/linux/nvme.h | 4 ++++ > 2 files changed, 38 insertions(+) > > diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c > index 16f9f6e3a084..45421d4308a4 100644 > --- a/drivers/nvme/target/configfs.c > +++ b/drivers/nvme/target/configfs.c > @@ -650,8 +650,42 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item, > > CONFIGFS_ATTR(nvmet_subsys_, attr_allow_any_host); > > +static ssize_t nvmet_subsys_version_show(struct config_item *item, > + char *page) > +{ > + struct nvmet_subsys *subsys = to_subsys(item); > + int major, minor, tertiary; > + u32 ver; > + > + ver = subsys->ver; > + major = NVME_MAJOR(ver); > + minor = NVME_MINOR(ver); > + tertiary = NVME_TERRIARY(ver); > + > + return snprintf(page, PAGE_SIZE, "%d %d %d\n", major, minor, tertiary); Nit: maybe a dot separator would be better? e.g. "1.3.0" rather than "1 3 0" Otherwise looks good, Reviewed-by: Sagi Grimberg From mboxrd@z Thu Jan 1 00:00:00 1970 From: sagi@grimberg.me (Sagi Grimberg) Date: Sun, 4 Jun 2017 18:08:42 +0300 Subject: [PATCH v4 7/8] nvmet: allow overriding the NVMe VS via configfs In-Reply-To: <20170604103649.22130-8-jthumshirn@suse.de> References: <20170604103649.22130-1-jthumshirn@suse.de> <20170604103649.22130-8-jthumshirn@suse.de> Message-ID: On 04/06/17 13:36, Johannes Thumshirn wrote: > Allow overriding the announced NVMe Version of a via configfs. > > This is particularly helpful when debugging new features for the host > or target side without bumping the hard coded version (as the target > might not be fully compliant to the announced version yet). > > Signed-off-by: Johannes Thumshirn > --- > drivers/nvme/target/configfs.c | 34 ++++++++++++++++++++++++++++++++++ > include/linux/nvme.h | 4 ++++ > 2 files changed, 38 insertions(+) > > diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c > index 16f9f6e3a084..45421d4308a4 100644 > --- a/drivers/nvme/target/configfs.c > +++ b/drivers/nvme/target/configfs.c > @@ -650,8 +650,42 @@ static ssize_t nvmet_subsys_attr_allow_any_host_store(struct config_item *item, > > CONFIGFS_ATTR(nvmet_subsys_, attr_allow_any_host); > > +static ssize_t nvmet_subsys_version_show(struct config_item *item, > + char *page) > +{ > + struct nvmet_subsys *subsys = to_subsys(item); > + int major, minor, tertiary; > + u32 ver; > + > + ver = subsys->ver; > + major = NVME_MAJOR(ver); > + minor = NVME_MINOR(ver); > + tertiary = NVME_TERRIARY(ver); > + > + return snprintf(page, PAGE_SIZE, "%d %d %d\n", major, minor, tertiary); Nit: maybe a dot separator would be better? e.g. "1.3.0" rather than "1 3 0" Otherwise looks good, Reviewed-by: Sagi Grimberg