]> www.infradead.org Git - users/sagi/libnvme.git/log
users/sagi/libnvme.git
3 years agotree: only open controller device node if required
Hannes Reinecke [Fri, 21 Jan 2022 11:53:51 +0000 (12:53 +0100)]
tree: only open controller device node if required

Opening the controller device will fail if the controller is resetting,
so trying to open it during controller initialisation will fail, and
the controller will not displayed correctly.
So only try to open the controller device if required, allowing the
initialisation to continue.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #192 from igaw/fix-nvme_get_log_args
Daniel Wagner [Fri, 21 Jan 2022 09:45:58 +0000 (10:45 +0100)]
Merge pull request #192 from igaw/fix-nvme_get_log_args

ioctl: Initialize all members in nvme_get_log_args

3 years agoioctl: Initialize all members in nvme_get_log_args
Daniel Wagner [Fri, 21 Jan 2022 09:39:53 +0000 (10:39 +0100)]
ioctl: Initialize all members in nvme_get_log_args

Commit 781b9105cc43 ("nvme: Add Media Unit Status log page(LID:
0x10)") introduces a new member in nvme_get_log_args. Older compilers
are not happy when we don't initialize all members in the inline
functions.

In file included from ../subprojects/libnvme/src/libnvme.h:19:0,
                 from ../subprojects/libnvme/test/cpp.cc:10:
../subprojects/libnvme/src/nvme/ioctl.h: In function ‘int nvme_get_log_cmd_effects(int, nvme_csi, nvme_cmd_effects_log*)’:
../subprojects/libnvme/src/nvme/ioctl.h:1328:2: sorry, unimplemented: non-trivial designated initializers not supported
  };

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #191 from hreinecke/tls
Daniel Wagner [Fri, 21 Jan 2022 09:20:35 +0000 (10:20 +0100)]
Merge pull request #191 from hreinecke/tls

fabrics: add fabrics config option 'tls'

3 years agoMerge pull request #157 from Arunpandian15/Media_Unit_Status_Log_Page
Daniel Wagner [Fri, 21 Jan 2022 09:02:10 +0000 (10:02 +0100)]
Merge pull request #157 from Arunpandian15/Media_Unit_Status_Log_Page

nvme: Add Media Unit Status log page(LID: 0x10)

3 years agofabrics: add fabrics config option 'tls'
Hannes Reinecke [Thu, 20 Jan 2022 14:39:48 +0000 (15:39 +0100)]
fabrics: add fabrics config option 'tls'

Add an option 'tls' to the fabrics config to start TLS encryption
on the connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #186 from igaw/print-format-specifier
Hannes Reinecke [Thu, 20 Jan 2022 18:47:51 +0000 (19:47 +0100)]
Merge pull request #186 from igaw/print-format-specifier

src: Use PRIu64 format specifier for uint64 types

3 years agoMerge pull request #135 from hreinecke/ctrl-loss-args
Hannes Reinecke [Thu, 20 Jan 2022 15:55:05 +0000 (16:55 +0100)]
Merge pull request #135 from hreinecke/ctrl-loss-args

Fix up handling of '-1' values

3 years agosrc: Use PRIu64 format specifier for uint64 types
Daniel Wagner [Wed, 19 Jan 2022 14:54:50 +0000 (15:54 +0100)]
src: Use PRIu64 format specifier for uint64 types

When compiling for 32bit architectures the compiler is complaining
about the wrong format specifier for uint64. Use the the PRIu64 format
specifier in this case which is supported from 32bit and 64bit.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #185 from martin-belanger/ccan-static-lib
Daniel Wagner [Wed, 19 Jan 2022 13:27:05 +0000 (14:27 +0100)]
Merge pull request #185 from martin-belanger/ccan-static-lib

Define ccan as a static library

3 years agoDefine ccan as a static library
Martin Belanger [Tue, 18 Jan 2022 16:14:14 +0000 (11:14 -0500)]
Define ccan as a static library

ccan gets built as a static library, which gets linked
to libnvme.so.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
3 years agonvme: Add Media Unit Status log page(LID: 0x10)
Arunpandian J [Wed, 19 Jan 2022 12:44:34 +0000 (18:14 +0530)]
nvme: Add Media Unit Status log page(LID: 0x10)

Reviewed-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Arunpandian J <apj.arun@samsung.com>
3 years agoMerge pull request #164 from sc108-lee/add/flbas_to_lbaf_inuse
Daniel Wagner [Wed, 19 Jan 2022 08:23:58 +0000 (09:23 +0100)]
Merge pull request #164 from sc108-lee/add/flbas_to_lbaf_inuse

util: modify flbas rsvd bits to be used

3 years agoutil: modify flbas rsvd bits to be used
Steven Seungcheol Lee [Wed, 19 Jan 2022 02:47:18 +0000 (11:47 +0900)]
util: modify flbas rsvd bits to be used

flbas Bits 6:5 indicate the most significant 2 bits of
the Format Index of the supported LBA Format indicated
in this data structure that was used to format the namespace

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #183 from igaw/add-missing-stddef
Daniel Wagner [Tue, 18 Jan 2022 08:13:16 +0000 (09:13 +0100)]
Merge pull request #183 from igaw/add-missing-stddef

linux: Include missing stddef.h

3 years agolinux: Include missing stddef.h
Daniel Wagner [Tue, 18 Jan 2022 08:10:11 +0000 (09:10 +0100)]
linux: Include missing stddef.h

The header is not self contained because nvme_get_ana_log_len() is
using the size_t type.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #180 from sc108-lee/fix/ssl
Daniel Wagner [Tue, 18 Jan 2022 08:03:07 +0000 (09:03 +0100)]
Merge pull request #180 from sc108-lee/fix/ssl

meson: ssl version checking allow version >=1.1.0

3 years agomeson: ssl version checking allowed version only
Steven Seungcheol Lee [Mon, 17 Jan 2022 06:27:34 +0000 (15:27 +0900)]
meson: ssl version checking allowed version only

>=1.1.0 & <2.0.0 or >=3.0.0

For lower version of ssl or 2.x, config will be below
define CONFIG_OPENSSL
undef CONFIG_OPENSSL_1
undef CONFIG_OPENSSL_3

so function nvme_gen_dhchap_key is not defined in c file

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
3 years agoMerge pull request #178 from tbzatek/docs-updates-5
Hannes Reinecke [Mon, 17 Jan 2022 09:10:31 +0000 (10:10 +0100)]
Merge pull request #178 from tbzatek/docs-updates-5

Docs strings updates (#5)

3 years agofabrics: do not treat ctrl_loss_tmo values of '-1' as invalid
Hannes Reinecke [Mon, 17 Jan 2022 09:03:34 +0000 (10:03 +0100)]
fabrics: do not treat ctrl_loss_tmo values of '-1' as invalid

'-1' is perfectly valid for ctrl_loss_tmo as it indicates an infinite
timeout.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #177 from hreinecke/connect_err
Hannes Reinecke [Mon, 17 Jan 2022 06:47:18 +0000 (07:47 +0100)]
Merge pull request #177 from hreinecke/connect_err

Implement nvme_errno_to_string()

3 years agoImplement nvme_errno_to_string()
Hannes Reinecke [Sun, 16 Jan 2022 09:38:01 +0000 (10:38 +0100)]
Implement nvme_errno_to_string()

Add a function nvme_errno_to_string() to provide a string describing
the error from nvme_add_ctrl().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotypes: TP8013 and TP8014 doc strings updates
Tomas Bzatek [Sun, 16 Jan 2022 11:34:29 +0000 (12:34 +0100)]
types: TP8013 and TP8014 doc strings updates

Also changed NVMF_DISC_EFLAGS defines into an enum for consistency
with other definitions.

3 years agodocs: Fix a typo in README.md
Tomas Bzatek [Sun, 16 Jan 2022 10:46:44 +0000 (11:46 +0100)]
docs: Fix a typo in README.md

3 years agoMerge pull request #176 from igaw/fix-exports v1.0-rc0
Daniel Wagner [Fri, 14 Jan 2022 17:28:48 +0000 (18:28 +0100)]
Merge pull request #176 from igaw/fix-exports

build: Add __nvme_msg back to exported symbols

3 years agobuild: Add __nvme_msg back to exported symbols
Daniel Wagner [Fri, 14 Jan 2022 17:24:34 +0000 (18:24 +0100)]
build: Add __nvme_msg back to exported symbols

nvme_msg() is a macro which call __nvme_msg(). The naming scheme is
not great but until we figured it out, add it back to the list of
exported symbols.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #175 from igaw/fix-tests
Daniel Wagner [Fri, 14 Jan 2022 16:25:10 +0000 (17:25 +0100)]
Merge pull request #175 from igaw/fix-tests

Fix tests

3 years agotree: Skip invalid pointer when scanning topology
Daniel Wagner [Fri, 14 Jan 2022 16:13:16 +0000 (17:13 +0100)]
tree: Skip invalid pointer when scanning topology

Do not try to dereference a NULL pointer. Just ignore it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Set provided timestamp nvme_set_features_timestamp
Daniel Wagner [Fri, 14 Jan 2022 15:59:05 +0000 (16:59 +0100)]
ioctl: Set provided timestamp nvme_set_features_timestamp

The argument order for memcpy is clearly the wrong way around. The
provided timestamp should be stored into the ts variable. The
compiler was warning about ts not being initialized.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #108 from hreinecke/scan-rework
Daniel Wagner [Fri, 14 Jan 2022 15:18:34 +0000 (16:18 +0100)]
Merge pull request #108 from hreinecke/scan-rework

Rework scanning logic

3 years agoMerge pull request #171 from igaw/struct-layout-v2
Daniel Wagner [Fri, 14 Jan 2022 14:33:56 +0000 (15:33 +0100)]
Merge pull request #171 from igaw/struct-layout-v2

Fill holes in ioctl's argument structs (alternative version)

3 years agoMerge pull request #173 from igaw/add-error-codes
Daniel Wagner [Fri, 14 Jan 2022 13:08:33 +0000 (14:08 +0100)]
Merge pull request #173 from igaw/add-error-codes

log: Introduce libnvme error codes

3 years agolog: Introduce libnvme error codes
Daniel Wagner [Fri, 14 Jan 2022 10:10:08 +0000 (11:10 +0100)]
log: Introduce libnvme error codes

Add libnvme specific error codes which map to a specific error
message. The system error codes in errno are too overloaded to figure
out what is going wrong.

With this we can remove the nvme_log_message buffer. This avoids
having a global library buffer.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_zns_append_args
Daniel Wagner [Thu, 13 Jan 2022 18:09:35 +0000 (19:09 +0100)]
ioctl: Rearrange members in nvme_zns_append_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_zns_append_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u64 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u64                      zslba;                /*    24     8 */
        __u16                      nlb;                  /*    32     2 */
        __u16                      control;              /*    34     2 */
        __u32                      ilbrt;                /*    36     4 */
        __u16                      lbat;                 /*    40     2 */
        __u16                      lbatm;                /*    42     2 */
        __u32                      data_len;             /*    44     4 */
        void *                     data;                 /*    48     8 */
        void *                     metadata;             /*    56     8 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        __u32                      metadata_len;         /*    64     4 */

        /* size: 72, cachelines: 2, members: 15 */
        /* padding: 4 */
        /* last cacheline: 8 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_zns_mgmt_recv_args
Daniel Wagner [Thu, 13 Jan 2022 18:07:18 +0000 (19:07 +0100)]
ioctl: Rearrange members in nvme_zns_mgmt_recv_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_zns_mgmt_recv_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u64                      slba;                 /*    24     8 */
        enum nvme_zns_recv_action  zra;                  /*    32     4 */
        __u32                      data_len;             /*    36     4 */
        void *                     data;                 /*    40     8 */
        __u16                      zrasf;                /*    48     2 */
        _Bool                      zras_feat;            /*    50     1 */

        /* size: 56, cachelines: 1, members: 11 */
        /* padding: 5 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_zns_mgmt_send_args
Daniel Wagner [Thu, 13 Jan 2022 18:04:09 +0000 (19:04 +0100)]
ioctl: Rearrange members in nvme_zns_mgmt_send_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_zns_mgmt_send_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u64                      slba;                 /*    24     8 */
        enum nvme_zns_send_action  zsa;                  /*    32     4 */
        __u32                      data_len;             /*    36     4 */
        void *                     data;                 /*    40     8 */
        _Bool                      select_all;           /*    48     1 */
        __u8                       zsaso;                /*    49     1 */

        /* size: 56, cachelines: 1, members: 11 */
        /* padding: 6 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_resv_report_args
Daniel Wagner [Thu, 13 Jan 2022 18:01:48 +0000 (19:01 +0100)]
ioctl: Rearrange members in nvme_resv_report_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_resv_report_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_resv_status *  report;               /*    24     8 */
        __u32                      len;                  /*    32     4 */
        _Bool                      eds;                  /*    36     1 */

        /* size: 40, cachelines: 1, members: 8 */
        /* padding: 3 */
        /* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_resv_release_args
Daniel Wagner [Thu, 13 Jan 2022 17:57:44 +0000 (18:57 +0100)]
ioctl: Rearrange members in nvme_resv_release_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_resv_release_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_resv_rtype       rtype;                /*    24     4 */
        enum nvme_resv_rrela       rrela;                /*    28     4 */
        __u64                      crkey;                /*    32     8 */
        _Bool                      iekey;                /*    40     1 */

        /* size: 48, cachelines: 1, members: 9 */
        /* padding: 7 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_resv_register_args
Daniel Wagner [Thu, 13 Jan 2022 17:56:22 +0000 (18:56 +0100)]
ioctl: Rearrange members in nvme_resv_register_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_resv_register_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_resv_rrega       rrega;                /*    24     4 */
        enum nvme_resv_cptpl       cptpl;                /*    28     4 */
        __u64                      crkey;                /*    32     8 */
        __u64                      nrkey;                /*    40     8 */
        _Bool                      iekey;                /*    48     1 */

        /* size: 56, cachelines: 1, members: 10 */
        /* padding: 7 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_resv_acquire_args
Daniel Wagner [Thu, 13 Jan 2022 17:54:43 +0000 (18:54 +0100)]
ioctl: Rearrange members in nvme_resv_acquire_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_resv_acquire_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_resv_rtype       rtype;                /*    24     4 */
        enum nvme_resv_racqa       racqa;                /*    28     4 */
        __u64                      crkey;                /*    32     8 */
        __u64                      nrkey;                /*    40     8 */
        _Bool                      iekey;                /*    48     1 */

        /* size: 56, cachelines: 1, members: 10 */
        /* padding: 7 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_copy_args
Daniel Wagner [Thu, 13 Jan 2022 17:50:31 +0000 (18:50 +0100)]
ioctl: Rearrange members in nvme_copy_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_copy_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_copy_range *   copy;                 /*    24     8 */
        __u64                      sdlba;                /*    32     8 */
        __u16                      nr;                   /*    40     2 */
        __u16                      dspec;                /*    42     2 */
        __u8                       prinfor;              /*    44     1 */
        __u8                       prinfow;              /*    45     1 */
        __u8                       dtype;                /*    46     1 */
        __u8                       format;               /*    47     1 */
        int                        lr;                   /*    48     4 */
        int                        fua;                  /*    52     4 */
        __u32                      ilbrt;                /*    56     4 */
        __u16                      lbatm;                /*    60     2 */
        __u16                      lbat;                 /*    62     2 */

        /* size: 64, cachelines: 1, members: 18 */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_dsm_args
Daniel Wagner [Thu, 13 Jan 2022 17:46:48 +0000 (18:46 +0100)]
ioctl: Rearrange members in nvme_dsm_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_dsm_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_dsm_range *    dsm;                  /*    24     8 */
        __u32                      attrs;                /*    32     4 */
        __u16                      nr_ranges;            /*    36     2 */

        /* size: 40, cachelines: 1, members: 8 */
        /* padding: 2 */
        /* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_io_args
Daniel Wagner [Thu, 13 Jan 2022 16:59:20 +0000 (17:59 +0100)]
ioctl: Rearrange members in nvme_io_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_io_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        void *                     data;                 /*    24     8 */
        void *                     metadata;             /*    32     8 */
        __u64                      slba;                 /*    40     8 */
        __u16                      nlb;                  /*    48     2 */
        __u16                      control;              /*    50     2 */
        __u16                      apptag;               /*    52     2 */
        __u16                      appmask;              /*    54     2 */
        __u32                      reftag;               /*    56     4 */
        __u32                      data_len;             /*    60     4 */
        /* --- cacheline 1 boundary (64 bytes) --- */
        __u64                      storage_tag;          /*    64     8 */
        __u32                      metadata_len;         /*    72     4 */
        __u8                       dsm;                  /*    76     1 */
        __u8                       dspec;                /*    77     1 */

        /* size: 80, cachelines: 2, members: 18 */
        /* padding: 2 */
        /* last cacheline: 16 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_virtual_mgmt_args
Daniel Wagner [Thu, 13 Jan 2022 16:52:19 +0000 (17:52 +0100)]
ioctl: Rearrange members in nvme_virtual_mgmt_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_virtual_mgmt_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        enum nvme_virt_mgmt_act    act;                  /*    20     4 */
        enum nvme_virt_mgmt_rt     rt;                   /*    24     4 */
        __u16                      cntlid;               /*    28     2 */
        __u16                      nr;                   /*    30     2 */

        /* size: 32, cachelines: 1, members: 8 */
        /* last cacheline: 32 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_sanitize_nvm_args
Daniel Wagner [Thu, 13 Jan 2022 16:49:00 +0000 (17:49 +0100)]
ioctl: Rearrange members in nvme_sanitize_nvm_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_sanitize_nvm_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        enum nvme_sanitize_sanact  sanact;               /*    20     4 */
        _Bool                      ause;                 /*    24     1 */
        __u8                       owpass;               /*    25     1 */
        _Bool                      oipbp;                /*    26     1 */
        _Bool                      nodas;                /*    27     1 */
        __u32                      ovrpat;               /*    28     4 */

        /* size: 32, cachelines: 1, members: 6 */
        /* padding: 4 */
        /* last cacheline: 32 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_get_property_args
Daniel Wagner [Thu, 13 Jan 2022 16:47:10 +0000 (17:47 +0100)]
ioctl: Rearrange members in nvme_get_property_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_get_property_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u64 *                    value;                /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        int                        offset;               /*    20     4 */

       /* size: 24, cachelines: 1, members: 5 */
        /* last cacheline: 24 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_set_property_args
Daniel Wagner [Thu, 13 Jan 2022 14:51:13 +0000 (15:51 +0100)]
ioctl: Rearrange members in nvme_set_property_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_set_property_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        int                        offset;               /*    20     4 */
        __u64                      value;                /*    24     8 */

        /* size: 32, cachelines: 1, members: 6 */
        /* last cacheline: 32 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_lockdown_args
Daniel Wagner [Thu, 13 Jan 2022 14:49:10 +0000 (15:49 +0100)]
ioctl: Rearrange members in nvme_lockdown_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_lockdown_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u8                       scp;                  /*    20     1 */
        __u8                       prhbt;                /*    21     1 */
        __u8                       ifc;                  /*    22     1 */
        __u8                       ofi;                  /*    23     1 */
        __u8                       uuidx;                /*    24     1 */

        /* size: 32, cachelines: 1, members: 8 */
        /* padding: 1 */
        /* last cacheline: 32 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_capacity_mgmt_args
Daniel Wagner [Thu, 13 Jan 2022 14:47:05 +0000 (15:47 +0100)]
ioctl: Rearrange members in nvme_capacity_mgmt_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_capacity_mgmt_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      cdw11;                /*    20     4 */
        __u32                      cdw12;                /*    24     4 */
        __u16                      element_id;           /*    28     2 */
        __u8                       op;                   /*    30     1 */

        /* size: 56, cachelines: 1, members: 11 */
        /* padding: 6 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_directive_recv_args
Daniel Wagner [Thu, 13 Jan 2022 14:42:22 +0000 (15:42 +0100)]
ioctl: Rearrange members in nvme_directive_recv_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_directive_recv_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_directive_receive_doper doper;         /*    24     4 */
        enum nvme_directive_dtype  dtype;                /*    28     4 */
        __u32                      cdw12;                /*    32     4 */
        __u32                      data_len;             /*    36     4 */
        void *                     data;                 /*    40     8 */
        __u16                      dspec;                /*    48     2 */

        /* size: 56, cachelines: 1, members: 11 */
        /* padding: 6 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_directive_send_args
Daniel Wagner [Thu, 13 Jan 2022 14:26:01 +0000 (15:26 +0100)]
ioctl: Rearrange members in nvme_directive_send_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_directive_send_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_directive_send_doper doper;            /*    24     4 */
        enum nvme_directive_dtype  dtype;                /*    28     4 */
        __u32                      cdw12;                /*    32     4 */
        __u32                      data_len;             /*    36     4 */
        void *                     data;                 /*    40     8 */
        __u16                      dspec;                /*    48     2 */

        /* size: 56, cachelines: 1, members: 10 */
        /* padding: 6 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_get_lba_status_args
Daniel Wagner [Thu, 13 Jan 2022 14:23:02 +0000 (15:23 +0100)]
ioctl: Rearrange members in nvme_get_lba_status_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_get_lba_status_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u32                      mndw;                 /*    24     4 */
        enum nvme_lba_status_atype atype;                /*    28     4 */
        __u64                      slba;                 /*    32     8 */
        struct nvme_lba_status *   lbas;                 /*    40     8 */
        __u16                      rl;                   /*    48     2 */

        /* size: 50, cachelines: 1, members: 10 */
        /* last cacheline: 50 bytes */
} __attribute__((__packed__));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_security_receive_args
Daniel Wagner [Thu, 13 Jan 2022 14:20:34 +0000 (15:20 +0100)]
ioctl: Rearrange members in nvme_security_receive_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_security_receive_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u8                       nssf;                 /*    24     1 */
        __u8                       spsp0;                /*    25     1 */
        __u8                       spsp1;                /*    26     1 */
        __u8                       secp;                 /*    27     1 */
        __u32                      al;                   /*    28     4 */
        void *                     data;                 /*    32     8 */
        __u32                      data_len;             /*    40     4 */

        /* size: 48, cachelines: 1, members: 12 */
        /* padding: 4 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_security_send_args
Daniel Wagner [Thu, 13 Jan 2022 14:16:54 +0000 (15:16 +0100)]
ioctl: Rearrange members in nvme_security_send_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_security_send_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u8                       nssf;                 /*    24     1 */
        __u8                       spsp0;                /*    25     1 */
        __u8                       spsp1;                /*    26     1 */
        __u8                       secp;                 /*    27     1 */
        __u32                      tl;                   /*    28     4 */
        void *                     data;                 /*    32     8 */
        __u32                      data_len;             /*    40     4 */

        /* size: 48, cachelines: 1, members: 12 */
        /* padding: 4 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_fw_commit_args
Daniel Wagner [Thu, 13 Jan 2022 14:15:54 +0000 (15:15 +0100)]
ioctl: Rearrange members in nvme_fw_commit_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_fw_commit_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        enum nvme_fw_commit_ca     action;               /*    20     4 */
        __u8                       slot;                 /*    24     1 */
        _Bool                      bpid;                 /*    25     1 */

        /* size: 32, cachelines: 1, members: 7 */
        /* padding: 6 */
        /* last cacheline: 32 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_fw_download_args
Daniel Wagner [Thu, 13 Jan 2022 14:09:09 +0000 (15:09 +0100)]
ioctl: Rearrange members in nvme_fw_download_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_fw_download_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      offset;               /*    20     4 */
        void *                     data;                 /*    24     8 */
        __u32                      data_len;             /*    32     4 */

        /* size: 40, cachelines: 1, members: 7 */
        /* padding: 4 */
        /* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_ns_attach_args
Daniel Wagner [Thu, 13 Jan 2022 14:07:09 +0000 (15:07 +0100)]
ioctl: Rearrange members in nvme_ns_attach_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_ns_attach_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_ctrl_list *    ctrlist;              /*    24     8 */
        enum nvme_ns_attach_sel    sel;                  /*    32     4 */

        /* size: 40, cachelines: 1, members: 7 */
        /* padding: 4 */
        /* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));

While at it also introduce the result member.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_ns_mgmt_args
Daniel Wagner [Thu, 13 Jan 2022 14:04:53 +0000 (15:04 +0100)]
ioctl: Rearrange members in nvme_ns_mgmt_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_ns_mgmt_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        struct nvme_id_ns *        ns;                   /*    24     8 */
        enum nvme_ns_mgmt_sel      sel;                  /*    32     4 */
        __u8                       csi;                  /*    36     1 */

        /* size: 40, cachelines: 1, members: 8 */
        /* padding: 3 */
        /* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_format_nvm_args
Daniel Wagner [Thu, 13 Jan 2022 14:03:11 +0000 (15:03 +0100)]
ioctl: Rearrange members in nvme_format_nvm_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_format_nvm_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_cmd_format_mset  mset;                 /*    24     4 */
        enum nvme_cmd_format_pi    pi;                   /*    28     4 */
        enum nvme_cmd_format_pil   pil;                  /*    32     4 */
        enum nvme_cmd_format_ses   ses;                  /*    36     4 */
        __u8                       lbaf;                 /*    40     1 */

        /* size: 48, cachelines: 1, members: 10 */
        /* padding: 7 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_get_features_args
Daniel Wagner [Thu, 13 Jan 2022 14:01:08 +0000 (15:01 +0100)]
ioctl: Rearrange members in nvme_get_features_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_get_features_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        enum nvme_get_features_sel sel;                  /*    24     4 */
        __u32                      cdw11;                /*    28     4 */
        __u32                      data_len;             /*    32     4 */
        void *                     data;                 /*    36     8 */
        __u8                       fid;                  /*    44     1 */
        __u8                       uuidx;                /*    45     1 */

        /* size: 48, cachelines: 1, members: 11 */
        /* padding: 2 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_set_features_args
Daniel Wagner [Thu, 13 Jan 2022 13:48:26 +0000 (14:48 +0100)]
ioctl: Rearrange members in nvme_set_features_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_set_features_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        __u32                      nsid;                 /*    20     4 */
        __u32                      cdw11;                /*    24     4 */
        __u32                      cdw12;                /*    28     4 */
        __u32                      cdw15;                /*    32     4 */
        __u32                      data_len;             /*    36     4 */
        void *                     data;                 /*    40     8 */
        _Bool                      save;                 /*    48     1 */
        __u8                       uuidx;                /*    49     1 */
        __u8                       fid;                  /*    50     1 */

        /* size: 56, cachelines: 1, members: 13 */
        /* padding: 5 */
        /* last cacheline: 56 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_get_log_args
Daniel Wagner [Thu, 13 Jan 2022 13:43:31 +0000 (14:43 +0100)]
ioctl: Rearrange members in nvme_get_log_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_get_log_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        enum nvme_cmd_get_log_lid  lid;                  /*    20     4 */
        __u64                      lpo;                  /*    24     8 */
        void *                     log;                  /*    32     8 */
        __u32                      len;                  /*    40     4 */
        __u32                      nsid;                 /*    44     4 */
        enum nvme_csi              csi;                  /*    48     4 */
        __u16                      lsi;                  /*    52     2 */
        __u8                       lsp;                  /*    54     1 */
        __u8                       uuidx;                /*    55     1 */
        _Bool                      rae;                  /*    56     1 */
        _Bool                      ot;                   /*    57     1 */

        /* size: 64, cachelines: 1, members: 15 */
        /* padding: 6 */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Rearrange members in nvme_identify_args
Daniel Wagner [Thu, 13 Jan 2022 13:19:16 +0000 (14:19 +0100)]
ioctl: Rearrange members in nvme_identify_args

Avoid any holes in the struct by rearranging the members. Also add the
attribute packed to struct definition to reduce ABI breakage.

struct nvme_identify_args {
        int                        args_size;            /*     0     4 */
        int                        fd;                   /*     4     4 */
        __u32 *                    result;               /*     8     8 */
        __u32                      timeout;              /*    16     4 */
        enum nvme_identify_cns     cns;                  /*    20     4 */
        void *                     data;                 /*    24     8 */
        enum nvme_csi              csi;                  /*    32     4 */
        __u32                      nsid;                 /*    36     4 */
        __u16                      cntid;                /*    40     2 */
        __u16                      nvmsetid;             /*    42     2 */
        __u16                      domid;                /*    44     2 */
        __u8                       uuidx;                /*    46     1 */

        /* size: 48, cachelines: 1, members: 12 */
        /* padding: 1 */
        /* last cacheline: 48 bytes */
} __attribute__((__aligned__(8)));

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #172 from hreinecke/host_traddr
Daniel Wagner [Thu, 13 Jan 2022 16:34:42 +0000 (17:34 +0100)]
Merge pull request #172 from hreinecke/host_traddr

Move 'host_traddr' and 'host_iface' into fabrics configuration

3 years agoioctl: Remove declration of nvme_set_features_iocs_profile()
Daniel Wagner [Thu, 13 Jan 2022 13:56:34 +0000 (14:56 +0100)]
ioctl: Remove declration of nvme_set_features_iocs_profile()

There is no implemenation for this function. Remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMove 'host_traddr' and 'host_iface' into fabrics configuration
Hannes Reinecke [Thu, 13 Jan 2022 16:18:45 +0000 (17:18 +0100)]
Move 'host_traddr' and 'host_iface' into fabrics configuration

Having 'host_traddr' and 'host_iface' as part of the controller
structure is technically correct, but won't work for 'connect-all'.
There we evaluate the contents of the discovery log page, and create
new controllers based on that information.
But as 'host_traddr' and 'host_iface' are Linux-only constructs, the
spec (and the discovery log page) doesn't know about them, and can't
provide us with that information.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotree: scan controllers before scanning subsystems in nvme_scan_topology()
Hannes Reinecke [Mon, 15 Nov 2021 10:32:20 +0000 (11:32 +0100)]
tree: scan controllers before scanning subsystems in nvme_scan_topology()

The linux sysfs hierarchy only knows about 'controllers' and 'subsystems',
so when scanning the topology we should follow this structure and scan
first for controllers and then for subsystems.
Just scanning for subsystems and all controllers attached to them has
the problem that the hostnqn can only be derived from the controller,
but by the time the controller is scanned the subsystem has already
been created and attached to the default host.
Scanning for controllers first will setup the correct hosts
(and subsystems), so the subsequent scan for subsystems is primarily
there to find all namespaces attached to the subsystems.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotree: lookup correct subsystem in nvme_scan_ctrl()
Hannes Reinecke [Tue, 28 Sep 2021 12:14:49 +0000 (14:14 +0200)]
tree: lookup correct subsystem in nvme_scan_ctrl()

Looking subsystems by subsys NQN only might yield wrong results
(eg for discovery controllers), as there might be several subsystem
instances all having the same subsystem NQN.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotree: drop 'path' argument from nvme_init_subsystem()
Hannes Reinecke [Tue, 28 Sep 2021 10:01:21 +0000 (12:01 +0200)]
tree: drop 'path' argument from nvme_init_subsystem()

The 'path' argument for nvme_init_subsystem() can be derived from
the name.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agotree: use name as argument to nvme_ctrl_lookup_subsystem_name()
Hannes Reinecke [Tue, 28 Sep 2021 09:55:07 +0000 (11:55 +0200)]
tree: use name as argument to nvme_ctrl_lookup_subsystem_name()

When looking up the subsystem in ctrl_lookup_subsystem_name() we
only need the controller name, not the entire controller structure.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #150 from hreinecke/api-rework
Daniel Wagner [Tue, 11 Jan 2022 14:23:06 +0000 (15:23 +0100)]
Merge pull request #150 from hreinecke/api-rework

Rework the libnvme ioctl API

3 years agolibnvme.map: Export nvme_io
Daniel Wagner [Tue, 11 Jan 2022 13:18:39 +0000 (14:18 +0100)]
libnvme.map: Export nvme_io

Add missing export.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoInline nvme_flush()
Hannes Reinecke [Fri, 17 Dec 2021 11:49:18 +0000 (12:49 +0100)]
Inline nvme_flush()

nvme_flush() is a trivial wrapper around nvme_submit_io_passthru(),
so inline it instead of carrying a function in the library.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_zns_append()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_zns_append()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_zns_mgmt_send() and nvme_zns_mgmt_recv()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_zns_mgmt_send() and nvme_zns_mgmt_recv()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Also convert zns.c to use nvme_zns_report_zones() instead of calling
nvme_zns_mgmt_recv() directly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for NVMe reservation commands
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for NVMe reservation commands

Use an argument structure for NVMe reservation commands like
nvme_resv_acquire() or nvme_resv_release() instead of passing all
arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_copy()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_copy()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_dsm()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_dsm()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for NVMe I/O commands
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for NVMe I/O commands

Use an argument structure for NVMe I/O commands like nvme_read() or
nvme_write() instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_virtual_mgmt()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_virtual_mgmt()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_dev_self_test()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_dev_self_test()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_sanize_nvm()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_sanize_nvm()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_set_property() and nvme_get_property()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_set_property() and nvme_get_property()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_lockdown()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_lockdown()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_capacity_mgmt()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_capacity_mgmt()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_directive_send() and nvme_directive_receive()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_directive_send() and nvme_directive_receive()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_get_lba_status()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_get_lba_status()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_security_send() and nvme_security_receive()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_security_send() and nvme_security_receive()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_fw_commit()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_fw_commit()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_fw_download()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_fw_download()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_format_nvm() and nvme_ns_mgmt()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_format_nvm() and nvme_ns_mgmt()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoInline nvme_identify() wrapper functions
Hannes Reinecke [Fri, 17 Dec 2021 12:43:19 +0000 (13:43 +0100)]
Inline nvme_identify() wrapper functions

No point in having wrapper functions as part of the libnvme library.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_identify()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_identify()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_set_features() and nvme_get_features()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_set_features() and nvme_get_features()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.
Also convert zns.c to use nvme_zns_report_zones() instead of calling
nvme_zns_mgmt_recv() directly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoInline nvme_get_log() wrapper functions
Hannes Reinecke [Fri, 17 Dec 2021 12:43:19 +0000 (13:43 +0100)]
Inline nvme_get_log() wrapper functions

No point in having wrapper functions as part of the libnvme library.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUse argument structure for nvme_get_log()
Hannes Reinecke [Fri, 17 Dec 2021 07:03:42 +0000 (08:03 +0100)]
Use argument structure for nvme_get_log()

Use an argument structure instead of passing all arguments one by one.
This allows for a future expansion of the argument list without having
to change the library ABI.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #167 from martin-belanger/fix-the-docs
Daniel Wagner [Mon, 10 Jan 2022 13:36:31 +0000 (14:36 +0100)]
Merge pull request #167 from martin-belanger/fix-the-docs

Fix error building the man pages

3 years agofix error building the man pages
Martin Belanger [Mon, 10 Jan 2022 13:23:59 +0000 (08:23 -0500)]
fix error building the man pages

3 years agobuild: Remove more in tree build artifacts
Daniel Wagner [Fri, 7 Jan 2022 15:57:10 +0000 (16:57 +0100)]
build: Remove more in tree build artifacts

meson doesn't do any in tree builds. Remove the old Makefile generated
config files from gitignore.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Fix *.wrap exclude pattern in .gitignore
Daniel Wagner [Fri, 7 Jan 2022 15:53:50 +0000 (16:53 +0100)]
build: Fix *.wrap exclude pattern in .gitignore

The current rules trigger git to to complain with

 $ git add subprojects/openssl.wrap
 The following paths are ignored by one of your .gitignore files:
 subprojects

We need to keep the parent directory in the tracking domain and just
filter out all sub directories and files except the wrap files.

Signed-off-by: Daniel Wagner <dwagner@suse.de>