]> www.infradead.org Git - users/sagi/libnvme.git/log
users/sagi/libnvme.git
3 years agolinux.h: fixup kernel-doc comments
Hannes Reinecke [Wed, 2 Feb 2022 07:23:49 +0000 (08:23 +0100)]
linux.h: fixup kernel-doc comments

To keep sphinx happy.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoioctl.h: fixup kernel-doc comments
Hannes Reinecke [Wed, 2 Feb 2022 07:23:49 +0000 (08:23 +0100)]
ioctl.h: fixup kernel-doc comments

To keep sphinx happy.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #209 from hreinecke/doc-proto
Hannes Reinecke [Wed, 2 Feb 2022 06:59:43 +0000 (07:59 +0100)]
Merge pull request #209 from hreinecke/doc-proto

Document function prototypes

3 years agotree: document function prototypes
Hannes Reinecke [Tue, 1 Feb 2022 12:27:28 +0000 (13:27 +0100)]
tree: document function prototypes

Document all function prototypes in tree.h.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #205 from igaw/fix-64bit-alignment v1.0-rc2
Daniel Wagner [Tue, 1 Feb 2022 10:44:20 +0000 (11:44 +0100)]
Merge pull request #205 from igaw/fix-64bit-alignment

ioctl: Sort members their natural size

3 years agoRename nvme_path_get_subsystem()
Hannes Reinecke [Tue, 1 Feb 2022 10:31:05 +0000 (11:31 +0100)]
Rename nvme_path_get_subsystem()

Misnamed, should be nvme_path_get_ctrl() to be consistent with the
other library functions.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #207 from igaw/rename-__nvme_get_log_page
Daniel Wagner [Tue, 1 Feb 2022 10:31:03 +0000 (11:31 +0100)]
Merge pull request #207 from igaw/rename-__nvme_get_log_page

Rename   nvme get log page

3 years agoRemove nvme_reset_topology()
Hannes Reinecke [Tue, 1 Feb 2022 10:28:23 +0000 (11:28 +0100)]
Remove nvme_reset_topology()

Identical to nvme_refresh_topology().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agolibvnme: Remove __nvme_msg from export map
Daniel Wagner [Mon, 31 Jan 2022 12:24:56 +0000 (13:24 +0100)]
libvnme: Remove __nvme_msg from export map

nvme-cli was using the library infrastructure for logging. In the
meantime this has been removed, hence we can remove this function from
the export map.

Furthermore, move nvme_msg() and __nvme_msg() to private header.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agolinux: Rename __nvme_get_log_page()
Daniel Wagner [Mon, 31 Jan 2022 12:22:15 +0000 (13:22 +0100)]
linux: Rename __nvme_get_log_page()

The prefix of __nvme_get_log_page() is confusing as it usually
indicates this is a private function. Rename this function to
nvme_get_log_page().

The already existing one nvme_get_log_page() is renamed to
nvme_get_log_page_padded() which is asking for 4k transfers.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #202 from hreinecke/msg-redirect
Hannes Reinecke [Tue, 1 Feb 2022 10:22:58 +0000 (11:22 +0100)]
Merge pull request #202 from hreinecke/msg-redirect

Redirect error messages

3 years agoRework nvme_scan_filter()
Hannes Reinecke [Tue, 1 Feb 2022 06:50:40 +0000 (07:50 +0100)]
Rework nvme_scan_filter()

Split off nvme_scan_filter() into nvme_create_root() and export the
remaining functionality as nvme_scan_topology(). With that
nvme_scan_filter() becomes pointless as the component functions
can be called directly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoioctl: Sort members their natural size
Daniel Wagner [Mon, 31 Jan 2022 09:43:58 +0000 (10:43 +0100)]
ioctl: Sort members their natural size

Previous attempt to align the members of all *_args structure didn't
take into account that pointer types vary between 32bit and 64bit
depending the arch. The only reliable alignemnt is to sort the members
according their natural size: 64bit, pointers, 32bit, 16bit, 8bit.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #204 from igaw/fix-nvme_get_log_args-layout
Hannes Reinecke [Mon, 31 Jan 2022 08:53:48 +0000 (09:53 +0100)]
Merge pull request #204 from igaw/fix-nvme_get_log_args-layout

ioctl: Fix struct nvme_get_log_args memberm alignment

3 years agolibnvme/tests: fixup create-ctrl-obj.py
Hannes Reinecke [Mon, 31 Jan 2022 08:12:13 +0000 (09:12 +0100)]
libnvme/tests: fixup create-ctrl-obj.py

Add the new 'root' argument to nvme.ctrl()

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoioctl: Fix struct nvme_get_log_args memberm alignment
Daniel Wagner [Mon, 31 Jan 2022 08:17:50 +0000 (09:17 +0100)]
ioctl: Fix struct nvme_get_log_args memberm alignment

Commit 781b9105cc43 ("nvme: Add Media Unit Status log page(LID:
0x10)") placed the domid member between two u8 members. The access
domid member would not be 16 bit aligned which is caused problems on
certain architectures. Let's fix the aligemnt by moving domid before
lsp. This give us following layout

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 */
        __u16                      domid;                /*    54     2 */
        __u8                       lsp;                  /*    56     1 */
        __u8                       uuidx;                /*    57     1 */
        _Bool                      rae;                  /*    58     1 */
        _Bool                      ot;                   /*    59     1 */

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

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoRemove stale definition for nvme_log_message
Hannes Reinecke [Mon, 31 Jan 2022 08:07:02 +0000 (09:07 +0100)]
Remove stale definition for nvme_log_message

No functionality anymore.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMove global logging variables into nvme_root_t
Hannes Reinecke [Mon, 31 Jan 2022 08:04:46 +0000 (09:04 +0100)]
Move global logging variables into nvme_root_t

Move the global logging variables into nvme_root_t to make them
settable by the application.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoAdd 'nvme_root_t' argument to nvme_msg()
Hannes Reinecke [Fri, 28 Jan 2022 13:18:25 +0000 (14:18 +0100)]
Add 'nvme_root_t' argument to nvme_msg()

Add a 'nvme_root_t' argument to nvme_msg() to allow for error
messages to be redirected to a different filedescriptor than
'stderr'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge hostname2traddr()
Hannes Reinecke [Fri, 28 Jan 2022 12:42:58 +0000 (13:42 +0100)]
Merge hostname2traddr()

For some reason we have two versions of hostname2traddr().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #203 from igaw/fix-error-codes
Hannes Reinecke [Mon, 31 Jan 2022 06:53:31 +0000 (07:53 +0100)]
Merge pull request #203 from igaw/fix-error-codes

Fix error codes

3 years agoutil: Set errno in error case nvme_get_directive_receive_length
Daniel Wagner [Fri, 28 Jan 2022 16:58:40 +0000 (17:58 +0100)]
util: Set errno in error case nvme_get_directive_receive_length

The API says we return -1 in the error case and set the errno
accordingly. Update nvme_get_directive_receive_length
to fulfill the promise.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoioctl: Set errno when command args check fails
Daniel Wagner [Fri, 28 Jan 2022 16:52:14 +0000 (17:52 +0100)]
ioctl: Set errno when command args check fails

In error the function is supposed to return -1 and set the errno
accordingly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #201 from Arunpandian15/types_h_cleanup
Daniel Wagner [Fri, 28 Jan 2022 13:18:15 +0000 (14:18 +0100)]
Merge pull request #201 from Arunpandian15/types_h_cleanup

Clean up Patch for types.h, ioctl.h

3 years agoClean up Patch for types.h, ioctl.h
Arunpandian J [Fri, 28 Jan 2022 11:49:32 +0000 (17:19 +0530)]
Clean up Patch for types.h, ioctl.h

Signed-off-by: Arunpandian J <apj.arun@samsung.com>
3 years agoUpdate README.md
Hannes Reinecke [Fri, 28 Jan 2022 10:44:59 +0000 (11:44 +0100)]
Update README.md

Add documentation on how to build a static library.

3 years agoMerge pull request #196 from hreinecke/rc-cleanup
Hannes Reinecke [Fri, 21 Jan 2022 16:52:07 +0000 (17:52 +0100)]
Merge pull request #196 from hreinecke/rc-cleanup

Cleanups for release candidate

3 years agofabrics: remove documentation for nvmf_add_ctrl_opts()
Hannes Reinecke [Fri, 21 Jan 2022 16:42:21 +0000 (17:42 +0100)]
fabrics: remove documentation for nvmf_add_ctrl_opts()

function is gone, no need for the documentation.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: Update prototype documentation
Hannes Reinecke [Fri, 21 Jan 2022 16:28:00 +0000 (17:28 +0100)]
fabrics: Update prototype documentation

Fill out missing bits in the function prototyp documentation.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: Remove nvmf_add_ctrl_opts()
Hannes Reinecke [Fri, 21 Jan 2022 16:13:20 +0000 (17:13 +0100)]
fabrics: Remove nvmf_add_ctrl_opts()

Unused, and nvmf_add_ctrl() is doing exactly the same.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #195 from hreinecke/disable-sqflow v1.0-rc1
Hannes Reinecke [Fri, 21 Jan 2022 12:53:30 +0000 (13:53 +0100)]
Merge pull request #195 from hreinecke/disable-sqflow

fabrics: kill 'disable_sqflow' argument to nvmf_add_ctrl()

3 years agofabrics: kill 'disable_sqflow' argument to nvmf_add_ctrl()
Hannes Reinecke [Fri, 21 Jan 2022 12:47:20 +0000 (13:47 +0100)]
fabrics: kill 'disable_sqflow' argument to nvmf_add_ctrl()

The 'disable_sqflow' argument to nvmf_add_ctrl() is pointless, as
'struct fabrics_config' is exported and the caller can set it
directly there, without having to involve library functions at all.
And consequently we can also remove nvme_ctrl_disable_sqflow().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #194 from hreinecke/ctrl-init
Hannes Reinecke [Fri, 21 Jan 2022 12:00:46 +0000 (13:00 +0100)]
Merge pull request #194 from hreinecke/ctrl-init

tree: only open controller device node if required

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>