1
0
Fork 0

Merging upstream version 1.9.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-16 10:50:33 +01:00
parent 432344d511
commit ff5afdb431
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
928 changed files with 6732 additions and 1442 deletions

View file

@ -27,8 +27,8 @@ Fabrics-specific definitions.
int nr_write_queues;
int nr_poll_queues;
int tos;
int keyring;
int tls_key;
long keyring;
long tls_key;
bool duplicate_connect;
bool disable_sqflow;
bool hdr_digest;

View file

@ -4218,6 +4218,34 @@ The nvme command status if a response was received (see
:c:type:`enum nvme_status_field <nvme_status_field>`) or -1 with errno set otherwise.
.. c:function:: int nvme_ns_mgmt_delete_timeout (int fd, __u32 nsid, __u32 timeout)
Delete a non attached namespace with timeout
**Parameters**
``int fd``
File descriptor of nvme device
``__u32 nsid``
Namespace identifier to delete
``__u32 timeout``
Override the default timeout to this value in milliseconds;
set to 0 to use the system default.
**Description**
It is recommended that a namespace being deleted is not attached to any
controller. Use the nvme_ns_detach_ctrls() first if the namespace is still
attached.
**Return**
The nvme command status if a response was received (see
:c:type:`enum nvme_status_field <nvme_status_field>`) or -1 with errno set otherwise.
.. c:function:: int nvme_ns_mgmt_delete (int fd, __u32 nsid)
Delete a non attached namespace
@ -5201,27 +5229,3 @@ The nvme command status if a response was received (see
:c:type:`enum nvme_status_field <nvme_status_field>`) or -1 with errno set otherwise.
.. c:function:: void nvme_set_debug (bool debug)
Set NVMe command debugging output
**Parameters**
``bool debug``
true to enable or false to disable
.. c:function:: bool nvme_get_debug (void)
Get NVMe command debugging output
**Parameters**
``void``
no arguments
**Return**
false if disabled or true if enabled.

View file

@ -463,6 +463,127 @@ its keys are available for further key lookups.
with errno set.
.. c:function:: unsigned char * nvme_read_key (long keyring_id, long key_id, int *len)
Read key raw data
**Parameters**
``long keyring_id``
Id of the keyring holding ``key_id``
``long key_id``
Key id
``int *len``
Length of the returned data
**Description**
Links the keyring specified by **keyring_id** into the session
keyring and reads the payload of the key specified by **key_id**.
**len** holds the size of the returned buffer.
If **keyring** is 0 the default keyring '.nvme' is used.
**Return**
Pointer to the payload on success,
or NULL with errno set otherwise.
.. c:function:: long nvme_update_key (long keyring_id, const char *key_type, const char *identity, unsigned char *key_data, int key_len)
Update key raw data
**Parameters**
``long keyring_id``
Id of the keyring holding ``key_id``
``const char *key_type``
Type of the key to insert
``const char *identity``
Key identity string
``unsigned char *key_data``
Raw data of the key
``int key_len``
Length of **key_data**
**Description**
Links the keyring specified by **keyring_id** into the session
keyring and updates the key reference by **identity** with **key_data**.
The old key with identity **identity** will be revoked to make it
inaccessible.
**Return**
Key id of the new key or 0 with errno set otherwise.
.. c:macro:: nvme_scan_tls_keys_cb_t
**Typedef**: Callback for iterating TLS keys
**Syntax**
``void nvme_scan_tls_keys_cb_t (long keyring, long key, char *desc, int desc_len, void *data)``
**Parameters**
``long keyring``
Keyring which has been iterated
``long key``
Key for which the callback has been invoked
``char *desc``
Description of the key
``int desc_len``
Length of **desc**
``void *data``
Pointer for caller data
**Description**
Called for each TLS PSK in the keyring.
.. c:function:: int nvme_scan_tls_keys (const char *keyring, nvme_scan_tls_keys_cb_t cb, void *data)
Iterate over TLS keys in a keyring
**Parameters**
``const char *keyring``
Keyring holding TLS keys
``nvme_scan_tls_keys_cb_t cb``
Callback function
``void *data``
Pointer for data to be passed to **cb**
**Description**
Iterates **keyring** and call **cb** for each TLS key. When **keyring** is NULL
the default '.nvme' keyring is used.
A TLS key must be of type 'psk' and the description must be of the
form 'NVMe<0|1><R|G>0<1|2> <identity>', otherwise it will be skipped
during iteration.
**Return**
Number of keys for which **cb** was called, or -1 with errno set
on error.
.. c:function:: long nvme_insert_tls_key (const char *keyring, const char *key_type, const char *hostnqn, const char *subsysnqn, int hmac, unsigned char *configured_key, int key_len)
Derive and insert TLS key
@ -578,3 +699,111 @@ The string containing the TLS identity. It is the responsibility
of the caller to free the returned string.
.. c:function:: char * nvme_export_tls_key (const unsigned char *key_data, int key_len)
Export a TLS key
**Parameters**
``const unsigned char *key_data``
Raw data of the key
``int key_len``
Length of **key_data**
**Description**
Returns **key_data** in the PSK Interchange format as defined in section
3.6.1.5 of the NVMe TCP Transport specification.
**Return**
The string containing the TLS identity or NULL with errno set
on error. It is the responsibility of the caller to free the returned
string.
.. c:function:: unsigned char * nvme_import_tls_key (const char *encoded_key, int *key_len, unsigned int *hmac)
Import a TLS key
**Parameters**
``const char *encoded_key``
TLS key in PSK interchange format
``int *key_len``
Length of the resulting key data
``unsigned int *hmac``
HMAC algorithm
**Description**
Imports **key_data** in the PSK Interchange format as defined in section
3.6.1.5 of the NVMe TCP Transport specification.
**Return**
The raw data of the PSK or NULL with errno set on error. It is
the responsibility of the caller to free the returned string.
.. c:function:: int nvme_submit_passthru (int fd, unsigned long ioctl_cmd, struct nvme_passthru_cmd *cmd, __u32 *result)
Low level ioctl wrapper for passthru commands
**Parameters**
``int fd``
File descriptor of the nvme device
``unsigned long ioctl_cmd``
IOCTL command id
``struct nvme_passthru_cmd *cmd``
Passhtru command
``__u32 *result``
Optional field to return the result
**Description**
This is a low level library function which should not be used directly. It is
exposed as weak symbol so that the user application is able to provide their own
implementation of this function with additional debugging or logging code.
**Return**
The value from the ioctl system call (see ioctl documentation)
.. c:function:: int nvme_submit_passthru64 (int fd, unsigned long ioctl_cmd, struct nvme_passthru_cmd64 *cmd, __u64 *result)
Low level ioctl wrapper for passthru commands
**Parameters**
``int fd``
File descriptor of the nvme device
``unsigned long ioctl_cmd``
IOCTL command id
``struct nvme_passthru_cmd64 *cmd``
Passhtru command
``__u64 *result``
Optional field to return the result
**Description**
This is a low level library function which should not be used directly. It is
exposed as weak symbol so that the user application is able to provide their own
implementation of this function with additional debugging or logging code.
**Return**
The value from the ioctl system call (see ioctl documentation)

View file

@ -28,6 +28,32 @@ logging functions
Sets the default logging variables for the library.
.. c:function:: int nvme_get_logging_level (nvme_root_t r, bool *log_pid, bool *log_tstamp)
Get current logging level
**Parameters**
``nvme_root_t r``
nvme_root_t context
``bool *log_pid``
Pointer to store a current value of logging of
the PID flag at (optional).
``bool *log_tstamp``
Pointer to store a current value of logging of
the timestamp flag at (optional).
**Description**
Retrieves current values of logging variables.
**Return**
current log level value or DEFAULT_LOGLEVEL if not initialized.
.. c:function:: void nvme_set_root (nvme_root_t r)
Set nvme_root_t context
@ -47,3 +73,36 @@ the latest created root object. Note the first **nvme_free_tree** call will rese
the global root object.
.. c:function:: void nvme_set_debug (bool debug)
Set NVMe command debugging output
**Parameters**
``bool debug``
true to enable or false to disable
**Description**
Don't use it, it's debricated.
.. c:function:: bool nvme_get_debug (void)
Get NVMe command debugging output
**Parameters**
``void``
no arguments
**Description**
Don't use it, it's debricated.
**Return**
false if disabled or true if enabled.

View file

@ -1,3 +1,12 @@
.. _nbft.h:
**nbft.h**
NVM Express Boot Specification, Revision 1.0
Note: this API is currently unstable, subject to further additions.
.. c:enum:: nbft_desc_type
@ -1716,6 +1725,8 @@
int controller_id;
int asqsz;
char *dhcp_root_path_string;
bool discovered;
bool unavailable;
};
**Members**
@ -1785,6 +1796,14 @@
DHCP Root Path Override string (SSNS Extended
Information Descriptor).
``discovered``
Indicates that this namespace was acquired
through discovery.
``unavailable``
Namespace is unavailable as indicated by
the pre-OS driver.

View file

@ -1729,6 +1729,20 @@ Host interface name of **c** (if present)
DH-HMAC-CHAP host key or NULL if not set
.. c:function:: const char * nvme_ctrl_get_cntlid (nvme_ctrl_t c)
Controller id
**Parameters**
``nvme_ctrl_t c``
Controller to be checked
**Return**
Controller id of **c**
.. c:function:: void nvme_ctrl_set_dhchap_host_key (nvme_ctrl_t c, const char *key)
Set host key

File diff suppressed because it is too large Load diff