All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/4] lnvm: minor clean-ups
@ 2019-07-21 15:32 Minwoo Im
  2019-07-21 15:32 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:32 UTC (permalink / raw)


Hi,

This series is nothing but a clean-up patch series.  I hope it's not a
just code churns, but a good start to do something for lnvm.

The first one removed a redundant whitespace in the command description.
The second one removed unnecessary print for the sizeof(dev) which will
always be zero in case user does not give any argument for the device.
The third patch removed temp variable instead casting the pinter
directly.  The last one just sync-up the kernel UAPI header file to the
latest.

Please review.

Thanks,

Changes to V2:
  - Resend the series with the latest patch commits.

Minwoo Im (4):
  lnvm: remove redundant whitespace in lnvm_init()
  lnvm: do not print 0 when the arg is not given
  lnvm: cast identity structure to (void *) directly
  lnvm: sync-up uapi lightnvm.h header from kernel

 linux/lightnvm.h         | 52 +++++++++++++++++++++++++++++++++++++++-
 nvme-lightnvm.c          |  7 +++---
 plugins/lnvm/lnvm-nvme.c |  8 +++----
 3 files changed, 58 insertions(+), 9 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init()
  2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
@ 2019-07-21 15:32 ` Minwoo Im
  2019-07-23  5:39   ` Javier González
  2019-07-21 15:32 ` [PATCH 2/4] lnvm: do not print 0 when the arg is not given Minwoo Im
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:32 UTC (permalink / raw)


The description for lnvm-init subcommand has a redundant whitespace.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 plugins/lnvm/lnvm-nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
index 754931a..37b6733 100644
--- a/plugins/lnvm/lnvm-nvme.c
+++ b/plugins/lnvm/lnvm-nvme.c
@@ -17,7 +17,7 @@
 static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *plugin)
 {
 	const char *desc = "Initialize LightNVM device. A LightNVM/Open-Channel SSD"\
-			   " must have a media manager associated before it can "\
+			   " must have a media manager associated before it can"\
 			   " be exposed to the user. The default is to initialize"
 			   " the general media manager on top of the device.\n\n"
 			   "Example:"
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] lnvm: do not print 0 when the arg is not given
  2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
  2019-07-21 15:32 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
@ 2019-07-21 15:32 ` Minwoo Im
  2019-07-23  5:44   ` Javier González
  2019-07-21 15:32 ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:32 UTC (permalink / raw)


If an argument is not given by the user, it just needs to show the
situation, not a prominent 0 which indicates the size of the argument
variable.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 plugins/lnvm/lnvm-nvme.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
index 37b6733..aacd469 100644
--- a/plugins/lnvm/lnvm-nvme.c
+++ b/plugins/lnvm/lnvm-nvme.c
@@ -48,7 +48,7 @@ static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 
@@ -179,7 +179,7 @@ static int lnvm_create_tgt(int argc, char **argv, struct command *cmd, struct pl
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 	if (!strlen(cfg.tgtname)) {
@@ -265,7 +265,7 @@ static int lnvm_factory_init(int argc, char **argv, struct command *cmd, struct
 		return ret;
 
 	if (!strlen(cfg.devname)) {
-		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
+		fprintf(stderr, "device name missing\n");
 		return -EINVAL;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] lnvm: cast identity structure to (void *) directly
  2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
  2019-07-21 15:32 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
  2019-07-21 15:32 ` [PATCH 2/4] lnvm: do not print 0 when the arg is not given Minwoo Im
@ 2019-07-21 15:32 ` Minwoo Im
  2019-07-23  5:44   ` Javier González
  2019-07-21 15:32 ` [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel Minwoo Im
  2019-07-23  8:58 ` [PATCH V2 0/4] lnvm: minor clean-ups Matias Bjørling
  4 siblings, 1 reply; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:32 UTC (permalink / raw)


If we use "tmp" or something like this, we can expect that it just
stores the previous pointer and do something else with the previous
pointer.  But, in this function, it just to cast it out.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 nvme-lightnvm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nvme-lightnvm.c b/nvme-lightnvm.c
index 0b99786..62bdc40 100644
--- a/nvme-lightnvm.c
+++ b/nvme-lightnvm.c
@@ -422,13 +422,12 @@ static void show_lnvm_id20_ns(struct nvme_nvm_id20 *id, unsigned int flags)
 
 static void show_lnvm_id_ns(struct nvme_nvm_id *id, unsigned int flags)
 {
-	void *tmp = id;
 	switch (id->ver_id) {
 		case 1:
-			show_lnvm_id12_ns(tmp, flags);
+			show_lnvm_id12_ns((void *) id, flags);
 		break;
 		case 2:
-			show_lnvm_id20_ns(tmp, flags);
+			show_lnvm_id20_ns((void *) id, flags);
 		break;
 		default:
 			fprintf(stderr, "Version %d not supported.\n",
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel
  2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
                   ` (2 preceding siblings ...)
  2019-07-21 15:32 ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
@ 2019-07-21 15:32 ` Minwoo Im
  2019-07-23  5:45   ` Javier González
  2019-07-23  8:58 ` [PATCH V2 0/4] lnvm: minor clean-ups Matias Bjørling
  4 siblings, 1 reply; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:32 UTC (permalink / raw)


This patch just syncs-up UAPI header from the kernel.  No functional
changes included.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 linux/lightnvm.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
 nvme-lightnvm.c  |  2 +-
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/linux/lightnvm.h b/linux/lightnvm.h
index f678ffb..c937160 100644
--- a/linux/lightnvm.h
+++ b/linux/lightnvm.h
@@ -77,7 +77,7 @@ struct nvm_ioctl_create_simple {
 struct nvm_ioctl_create_extended {
 	__u16 lun_begin;
 	__u16 lun_end;
-	__u16 over_prov;
+	__u16 op;
 	__u16 rsv;
 };
 
@@ -135,6 +135,44 @@ struct nvm_ioctl_dev_factory {
 	__u32 flags;
 };
 
+struct nvm_user_vio {
+	__u8 opcode;
+	__u8 flags;
+	__u16 control;
+	__u16 nppas;
+	__u16 rsvd;
+	__u64 metadata;
+	__u64 addr;
+	__u64 ppa_list;
+	__u32 metadata_len;
+	__u32 data_len;
+	__u64 status;
+	__u32 result;
+	__u32 rsvd3[3];
+};
+
+struct nvm_passthru_vio {
+	__u8 opcode;
+	__u8 flags;
+	__u8 rsvd[2];
+	__u32 nsid;
+	__u32 cdw2;
+	__u32 cdw3;
+	__u64 metadata;
+	__u64 addr;
+	__u32 metadata_len;
+	__u32 data_len;
+	__u64 ppa_list;
+	__u16 nppas;
+	__u16 control;
+	__u32 cdw13;
+	__u32 cdw14;
+	__u32 cdw15;
+	__u64 status;
+	__u32 result;
+	__u32 timeout_ms;
+};
+
 /* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
 enum {
 	/* top level cmds */
@@ -150,6 +188,11 @@ enum {
 
 	/* Factory reset device */
 	NVM_DEV_FACTORY_CMD,
+
+	/* Vector user I/O */
+	NVM_DEV_VIO_ADMIN_CMD = 0x41,
+	NVM_DEV_VIO_CMD = 0x42,
+	NVM_DEV_VIO_USER_CMD = 0x43,
 };
 
 #define NVM_IOCTL 'L' /* 0x4c */
@@ -167,6 +210,13 @@ enum {
 #define NVM_DEV_FACTORY		_IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
 						struct nvm_ioctl_dev_factory)
 
+#define NVME_NVM_IOCTL_IO_VIO		_IOWR(NVM_IOCTL, NVM_DEV_VIO_USER_CMD, \
+						struct nvm_passthru_vio)
+#define NVME_NVM_IOCTL_ADMIN_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_ADMIN_CMD,\
+						struct nvm_passthru_vio)
+#define NVME_NVM_IOCTL_SUBMIT_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_CMD,\
+						struct nvm_user_vio)
+
 #define NVM_VERSION_MAJOR	1
 #define NVM_VERSION_MINOR	0
 #define NVM_VERSION_PATCHLEVEL	0
diff --git a/nvme-lightnvm.c b/nvme-lightnvm.c
index 62bdc40..b4b20ec 100644
--- a/nvme-lightnvm.c
+++ b/nvme-lightnvm.c
@@ -167,7 +167,7 @@ int lnvm_do_create_tgt(char *devname, char *tgtname, char *tgttype,
 		c.conf.type = NVM_CONFIG_TYPE_EXTENDED;
 		c.conf.e.lun_begin = lun_begin;
 		c.conf.e.lun_end = lun_end;
-		c.conf.e.over_prov = over_prov;
+		c.conf.e.op = over_prov;
 	} else {
 		c.conf.type = NVM_CONFIG_TYPE_SIMPLE;
 		c.conf.s.lun_begin = lun_begin;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init()
  2019-07-21 15:32 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
@ 2019-07-23  5:39   ` Javier González
  0 siblings, 0 replies; 12+ messages in thread
From: Javier González @ 2019-07-23  5:39 UTC (permalink / raw)


> On 21 Jul 2019,@17.32, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> 
> The description for lnvm-init subcommand has a redundant whitespace.
> 
> Cc: Keith Busch <kbusch at kernel.org>
> Cc: Matias Bjorling <mb at lightnvm.io>
> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
> ---
> plugins/lnvm/lnvm-nvme.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
> index 754931a..37b6733 100644
> --- a/plugins/lnvm/lnvm-nvme.c
> +++ b/plugins/lnvm/lnvm-nvme.c
> @@ -17,7 +17,7 @@
> static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *plugin)
> {
> 	const char *desc = "Initialize LightNVM device. A LightNVM/Open-Channel SSD"\
> -			   " must have a media manager associated before it can "\
> +			   " must have a media manager associated before it can"\
> 			   " be exposed to the user. The default is to initialize"
> 			   " the general media manager on top of the device.\n\n"
> 			   "Example:"
> --
> 2.17.1

Looks good to me.

Reviewed-by: Javier Gonz?lez <javier at javigon.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20190723/8a83905d/attachment.sig>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/4] lnvm: do not print 0 when the arg is not given
  2019-07-21 15:32 ` [PATCH 2/4] lnvm: do not print 0 when the arg is not given Minwoo Im
@ 2019-07-23  5:44   ` Javier González
  0 siblings, 0 replies; 12+ messages in thread
From: Javier González @ 2019-07-23  5:44 UTC (permalink / raw)


> On 21 Jul 2019,@17.32, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> 
> If an argument is not given by the user, it just needs to show the
> situation, not a prominent 0 which indicates the size of the argument
> variable.
> 
> Cc: Keith Busch <kbusch at kernel.org>
> Cc: Matias Bjorling <mb at lightnvm.io>
> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
> ---
> plugins/lnvm/lnvm-nvme.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/plugins/lnvm/lnvm-nvme.c b/plugins/lnvm/lnvm-nvme.c
> index 37b6733..aacd469 100644
> --- a/plugins/lnvm/lnvm-nvme.c
> +++ b/plugins/lnvm/lnvm-nvme.c
> @@ -48,7 +48,7 @@ static int lnvm_init(int argc, char **argv, struct command *cmd, struct plugin *
> 		return ret;
> 
> 	if (!strlen(cfg.devname)) {
> -		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
> +		fprintf(stderr, "device name missing\n");
> 		return -EINVAL;
> 	}
> 
> @@ -179,7 +179,7 @@ static int lnvm_create_tgt(int argc, char **argv, struct command *cmd, struct pl
> 		return ret;
> 
> 	if (!strlen(cfg.devname)) {
> -		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
> +		fprintf(stderr, "device name missing\n");
> 		return -EINVAL;
> 	}
> 	if (!strlen(cfg.tgtname)) {
> @@ -265,7 +265,7 @@ static int lnvm_factory_init(int argc, char **argv, struct command *cmd, struct
> 		return ret;
> 
> 	if (!strlen(cfg.devname)) {
> -		fprintf(stderr, "device name missing %d\n", (int)strlen(cfg.devname));
> +		fprintf(stderr, "device name missing\n");
> 		return -EINVAL;
> 	}
> 
> --
> 2.17.1

LGTM


Reviewed-by: Javier Gonz?lez <javier at javigon.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20190723/ab5980fb/attachment.sig>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 3/4] lnvm: cast identity structure to (void *) directly
  2019-07-21 15:32 ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
@ 2019-07-23  5:44   ` Javier González
  0 siblings, 0 replies; 12+ messages in thread
From: Javier González @ 2019-07-23  5:44 UTC (permalink / raw)


> On 21 Jul 2019,@17.32, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> 
> If we use "tmp" or something like this, we can expect that it just
> stores the previous pointer and do something else with the previous
> pointer.  But, in this function, it just to cast it out.
> 
> Cc: Keith Busch <kbusch at kernel.org>
> Cc: Matias Bjorling <mb at lightnvm.io>
> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
> ---
> nvme-lightnvm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/nvme-lightnvm.c b/nvme-lightnvm.c
> index 0b99786..62bdc40 100644
> --- a/nvme-lightnvm.c
> +++ b/nvme-lightnvm.c
> @@ -422,13 +422,12 @@ static void show_lnvm_id20_ns(struct nvme_nvm_id20 *id, unsigned int flags)
> 
> static void show_lnvm_id_ns(struct nvme_nvm_id *id, unsigned int flags)
> {
> -	void *tmp = id;
> 	switch (id->ver_id) {
> 		case 1:
> -			show_lnvm_id12_ns(tmp, flags);
> +			show_lnvm_id12_ns((void *) id, flags);
> 		break;
> 		case 2:
> -			show_lnvm_id20_ns(tmp, flags);
> +			show_lnvm_id20_ns((void *) id, flags);
> 		break;
> 		default:
> 			fprintf(stderr, "Version %d not supported.\n",
> --
> 2.17.1

LGTM


Reviewed-by: Javier Gonz?lez <javier at javigon.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20190723/136ecac1/attachment.sig>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel
  2019-07-21 15:32 ` [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel Minwoo Im
@ 2019-07-23  5:45   ` Javier González
  0 siblings, 0 replies; 12+ messages in thread
From: Javier González @ 2019-07-23  5:45 UTC (permalink / raw)


> On 21 Jul 2019,@17.32, Minwoo Im <minwoo.im.dev@gmail.com> wrote:
> 
> This patch just syncs-up UAPI header from the kernel.  No functional
> changes included.
> 
> Cc: Keith Busch <kbusch at kernel.org>
> Cc: Matias Bjorling <mb at lightnvm.io>
> Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
> ---
> linux/lightnvm.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
> nvme-lightnvm.c  |  2 +-
> 2 files changed, 52 insertions(+), 2 deletions(-)
> 
> diff --git a/linux/lightnvm.h b/linux/lightnvm.h
> index f678ffb..c937160 100644
> --- a/linux/lightnvm.h
> +++ b/linux/lightnvm.h
> @@ -77,7 +77,7 @@ struct nvm_ioctl_create_simple {
> struct nvm_ioctl_create_extended {
> 	__u16 lun_begin;
> 	__u16 lun_end;
> -	__u16 over_prov;
> +	__u16 op;
> 	__u16 rsv;
> };
> 
> @@ -135,6 +135,44 @@ struct nvm_ioctl_dev_factory {
> 	__u32 flags;
> };
> 
> +struct nvm_user_vio {
> +	__u8 opcode;
> +	__u8 flags;
> +	__u16 control;
> +	__u16 nppas;
> +	__u16 rsvd;
> +	__u64 metadata;
> +	__u64 addr;
> +	__u64 ppa_list;
> +	__u32 metadata_len;
> +	__u32 data_len;
> +	__u64 status;
> +	__u32 result;
> +	__u32 rsvd3[3];
> +};
> +
> +struct nvm_passthru_vio {
> +	__u8 opcode;
> +	__u8 flags;
> +	__u8 rsvd[2];
> +	__u32 nsid;
> +	__u32 cdw2;
> +	__u32 cdw3;
> +	__u64 metadata;
> +	__u64 addr;
> +	__u32 metadata_len;
> +	__u32 data_len;
> +	__u64 ppa_list;
> +	__u16 nppas;
> +	__u16 control;
> +	__u32 cdw13;
> +	__u32 cdw14;
> +	__u32 cdw15;
> +	__u64 status;
> +	__u32 result;
> +	__u32 timeout_ms;
> +};
> +
> /* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
> enum {
> 	/* top level cmds */
> @@ -150,6 +188,11 @@ enum {
> 
> 	/* Factory reset device */
> 	NVM_DEV_FACTORY_CMD,
> +
> +	/* Vector user I/O */
> +	NVM_DEV_VIO_ADMIN_CMD = 0x41,
> +	NVM_DEV_VIO_CMD = 0x42,
> +	NVM_DEV_VIO_USER_CMD = 0x43,
> };
> 
> #define NVM_IOCTL 'L' /* 0x4c */
> @@ -167,6 +210,13 @@ enum {
> #define NVM_DEV_FACTORY		_IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
> 						struct nvm_ioctl_dev_factory)
> 
> +#define NVME_NVM_IOCTL_IO_VIO		_IOWR(NVM_IOCTL, NVM_DEV_VIO_USER_CMD, \
> +						struct nvm_passthru_vio)
> +#define NVME_NVM_IOCTL_ADMIN_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_ADMIN_CMD,\
> +						struct nvm_passthru_vio)
> +#define NVME_NVM_IOCTL_SUBMIT_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_CMD,\
> +						struct nvm_user_vio)
> +
> #define NVM_VERSION_MAJOR	1
> #define NVM_VERSION_MINOR	0
> #define NVM_VERSION_PATCHLEVEL	0
> diff --git a/nvme-lightnvm.c b/nvme-lightnvm.c
> index 62bdc40..b4b20ec 100644
> --- a/nvme-lightnvm.c
> +++ b/nvme-lightnvm.c
> @@ -167,7 +167,7 @@ int lnvm_do_create_tgt(char *devname, char *tgtname, char *tgttype,
> 		c.conf.type = NVM_CONFIG_TYPE_EXTENDED;
> 		c.conf.e.lun_begin = lun_begin;
> 		c.conf.e.lun_end = lun_end;
> -		c.conf.e.over_prov = over_prov;
> +		c.conf.e.op = over_prov;
> 	} else {
> 		c.conf.type = NVM_CONFIG_TYPE_SIMPLE;
> 		c.conf.s.lun_begin = lun_begin;
> --
> 2.17.1

LGTM


Reviewed-by: Javier Gonz?lez <javier at javigon.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20190723/39f97d8b/attachment.sig>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 0/4] lnvm: minor clean-ups
  2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
                   ` (3 preceding siblings ...)
  2019-07-21 15:32 ` [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel Minwoo Im
@ 2019-07-23  8:58 ` Matias Bjørling
  2019-07-23 16:01   ` Keith Busch
  4 siblings, 1 reply; 12+ messages in thread
From: Matias Bjørling @ 2019-07-23  8:58 UTC (permalink / raw)


On 7/21/19 5:32 PM, Minwoo Im wrote:
> Hi,
> 
> This series is nothing but a clean-up patch series.  I hope it's not a
> just code churns, but a good start to do something for lnvm.
> 
> The first one removed a redundant whitespace in the command description.
> The second one removed unnecessary print for the sizeof(dev) which will
> always be zero in case user does not give any argument for the device.
> The third patch removed temp variable instead casting the pinter
> directly.  The last one just sync-up the kernel UAPI header file to the
> latest.
> 
> Please review.
> 
> Thanks,
> 
> Changes to V2:
>    - Resend the series with the latest patch commits.
> 
> Minwoo Im (4):
>    lnvm: remove redundant whitespace in lnvm_init()
>    lnvm: do not print 0 when the arg is not given
>    lnvm: cast identity structure to (void *) directly
>    lnvm: sync-up uapi lightnvm.h header from kernel
> 
>   linux/lightnvm.h         | 52 +++++++++++++++++++++++++++++++++++++++-
>   nvme-lightnvm.c          |  7 +++---
>   plugins/lnvm/lnvm-nvme.c |  8 +++----
>   3 files changed, 58 insertions(+), 9 deletions(-)
> 

Thanks Minwoo.

Patch 1-3 looks good to me. Keith, feel free to pick them up.

Patch 4 can wait until there is a use for the data structures.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH V2 0/4] lnvm: minor clean-ups
  2019-07-23  8:58 ` [PATCH V2 0/4] lnvm: minor clean-ups Matias Bjørling
@ 2019-07-23 16:01   ` Keith Busch
  0 siblings, 0 replies; 12+ messages in thread
From: Keith Busch @ 2019-07-23 16:01 UTC (permalink / raw)


On Tue, Jul 23, 2019@10:58:11AM +0200, Matias Bj?rling wrote:
> On 7/21/19 5:32 PM, Minwoo Im wrote:
> > Hi,
> > 
> > This series is nothing but a clean-up patch series.  I hope it's not a
> > just code churns, but a good start to do something for lnvm.
> > 
> > The first one removed a redundant whitespace in the command description.
> > The second one removed unnecessary print for the sizeof(dev) which will
> > always be zero in case user does not give any argument for the device.
> > The third patch removed temp variable instead casting the pinter
> > directly.  The last one just sync-up the kernel UAPI header file to the
> > latest.
> > 
> > Please review.
> > 
> > Thanks,
> > 
> > Changes to V2:
> >    - Resend the series with the latest patch commits.
> > 
> > Minwoo Im (4):
> >    lnvm: remove redundant whitespace in lnvm_init()
> >    lnvm: do not print 0 when the arg is not given
> >    lnvm: cast identity structure to (void *) directly
> >    lnvm: sync-up uapi lightnvm.h header from kernel
> > 
> >   linux/lightnvm.h         | 52 +++++++++++++++++++++++++++++++++++++++-
> >   nvme-lightnvm.c          |  7 +++---
> >   plugins/lnvm/lnvm-nvme.c |  8 +++----
> >   3 files changed, 58 insertions(+), 9 deletions(-)
> > 
> 
> Thanks Minwoo.
> 
> Patch 1-3 looks good to me. Keith, feel free to pick them up.
> 
> Patch 4 can wait until there is a use for the data structures.

Sounds good, series applied from the pull-request.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel
  2019-07-21 15:26     ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
@ 2019-07-21 15:26       ` Minwoo Im
  0 siblings, 0 replies; 12+ messages in thread
From: Minwoo Im @ 2019-07-21 15:26 UTC (permalink / raw)


This patch just syncs-up UAPI header from the kernel.  No functional
changes included.

Cc: Keith Busch <kbusch at kernel.org>
Cc: Matias Bjorling <mb at lightnvm.io>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
 linux/lightnvm.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/linux/lightnvm.h b/linux/lightnvm.h
index f678ffb..c937160 100644
--- a/linux/lightnvm.h
+++ b/linux/lightnvm.h
@@ -77,7 +77,7 @@ struct nvm_ioctl_create_simple {
 struct nvm_ioctl_create_extended {
 	__u16 lun_begin;
 	__u16 lun_end;
-	__u16 over_prov;
+	__u16 op;
 	__u16 rsv;
 };
 
@@ -135,6 +135,44 @@ struct nvm_ioctl_dev_factory {
 	__u32 flags;
 };
 
+struct nvm_user_vio {
+	__u8 opcode;
+	__u8 flags;
+	__u16 control;
+	__u16 nppas;
+	__u16 rsvd;
+	__u64 metadata;
+	__u64 addr;
+	__u64 ppa_list;
+	__u32 metadata_len;
+	__u32 data_len;
+	__u64 status;
+	__u32 result;
+	__u32 rsvd3[3];
+};
+
+struct nvm_passthru_vio {
+	__u8 opcode;
+	__u8 flags;
+	__u8 rsvd[2];
+	__u32 nsid;
+	__u32 cdw2;
+	__u32 cdw3;
+	__u64 metadata;
+	__u64 addr;
+	__u32 metadata_len;
+	__u32 data_len;
+	__u64 ppa_list;
+	__u16 nppas;
+	__u16 control;
+	__u32 cdw13;
+	__u32 cdw14;
+	__u32 cdw15;
+	__u64 status;
+	__u32 result;
+	__u32 timeout_ms;
+};
+
 /* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
 enum {
 	/* top level cmds */
@@ -150,6 +188,11 @@ enum {
 
 	/* Factory reset device */
 	NVM_DEV_FACTORY_CMD,
+
+	/* Vector user I/O */
+	NVM_DEV_VIO_ADMIN_CMD = 0x41,
+	NVM_DEV_VIO_CMD = 0x42,
+	NVM_DEV_VIO_USER_CMD = 0x43,
 };
 
 #define NVM_IOCTL 'L' /* 0x4c */
@@ -167,6 +210,13 @@ enum {
 #define NVM_DEV_FACTORY		_IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
 						struct nvm_ioctl_dev_factory)
 
+#define NVME_NVM_IOCTL_IO_VIO		_IOWR(NVM_IOCTL, NVM_DEV_VIO_USER_CMD, \
+						struct nvm_passthru_vio)
+#define NVME_NVM_IOCTL_ADMIN_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_ADMIN_CMD,\
+						struct nvm_passthru_vio)
+#define NVME_NVM_IOCTL_SUBMIT_VIO	_IOWR(NVM_IOCTL, NVM_DEV_VIO_CMD,\
+						struct nvm_user_vio)
+
 #define NVM_VERSION_MAJOR	1
 #define NVM_VERSION_MINOR	0
 #define NVM_VERSION_PATCHLEVEL	0
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-07-23 16:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-21 15:32 [PATCH V2 0/4] lnvm: minor clean-ups Minwoo Im
2019-07-21 15:32 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
2019-07-23  5:39   ` Javier González
2019-07-21 15:32 ` [PATCH 2/4] lnvm: do not print 0 when the arg is not given Minwoo Im
2019-07-23  5:44   ` Javier González
2019-07-21 15:32 ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
2019-07-23  5:44   ` Javier González
2019-07-21 15:32 ` [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel Minwoo Im
2019-07-23  5:45   ` Javier González
2019-07-23  8:58 ` [PATCH V2 0/4] lnvm: minor clean-ups Matias Bjørling
2019-07-23 16:01   ` Keith Busch
  -- strict thread matches above, loose matches on Subject: below --
2019-07-21 15:26 [PATCH " Minwoo Im
2019-07-21 15:26 ` [PATCH 1/4] lnvm: remove redundant whitespace in lnvm_init() Minwoo Im
2019-07-21 15:26   ` [PATCH 2/4] lnvm: do not print 0 when the arg is not given Minwoo Im
2019-07-21 15:26     ` [PATCH 3/4] lnvm: cast identity structure to (void *) directly Minwoo Im
2019-07-21 15:26       ` [PATCH 4/4] lnvm: sync-up uapi lightnvm.h header from kernel Minwoo Im

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.