mlx5dv_crypto_lo...dv_crypto_logout(3)
okay bestie, welcome to the mlx5dv_crypto_login(3) manual page β home of the crypto login session trio: mlx5dv_crypto_login, mlx5dv_crypto_login_query_state, and mlx5dv_crypto_logout. All three are invited to the group chat. β¨
π NAME π
mlx5dv_crypto_loginβ creates a crypto login session.mlx5dv_crypto_login_query_stateβ queries the state of the current crypto login session.mlx5dv_crypto_logoutβ logs out from the current crypto login session.
π¦ SYNOPSIS π¦
#include <infiniband/mlx5dv.h>
int mlx5dv_crypto_login(struct ibv_context *context,
struct mlx5dv_crypto_login_attr *login_attr);
int mlx5dv_crypto_login_query_state(struct ibv_context *context,
enum mlx5dv_crypto_login_state *state);
int mlx5dv_crypto_logout(struct ibv_context *context);
π DESCRIPTION π
So hereβs the vibe: when youβre using a crypto engine that is in wrapped import method, an active crypto login session must be present in order to create and query Data Encryption Keys (DEKs). No login session, no DEK business β periodt.
mlx5dv_crypto_login() creates a crypto login session with the credential given in login_attr and associates it with context. Important: only one active crypto login session can be associated per device context. One session, one context, thatβs the rule π
mlx5dv_crypto_login_query_state() queries the state of the crypto login session associated with context and returns the state in state, which indicates whether it is valid, invalid or doesnβt exist. A valid crypto login session can become invalid if the credential or the import KEK used in the crypto login session were deleted during the login session (for example by a crypto officer). In this case, mlx5dv_crypto_logout() should be called to destroy the current invalid crypto login session and if still necessary, mlx5dv_crypto_login() should be called to create a new crypto login session with valid credential and import KEK. Basically: clean up the expired session, then re-login like the main character you are.
mlx5dv_crypto_logout() logs out from the current crypto login session associated with context.
Existing DEKs that were previously loaded to the device during a crypto login session donβt need an active crypto login session in order to be used (in MKey or during traffic). <butterfly>π¦</butterfly> So the already-loaded DEKs can still do their thing.
π ARGUMENTS π
π«Ά context
The device context to associate the crypto login session with.
π login_attr
Crypto login attributes specify the credential to login with and the import KEK to be used for secured communications during the crypto login session.
struct mlx5dv_crypto_login_attr {
uint32_t credential_id;
uint32_t import_kek_id;
char credential[48];
uint64_t comp_mask;
};
πΈ credential_id
An ID of a credential, from the credentials stored on the device, that indicates the credential that should be validated against the credential provided in credential.
π import_kek_id
An ID of an import KEK, from the import KEKs stored on the device, that indicates the import KEK that will be used for unwrapping the credential provided in credential and also for all other secured communications during the crypto login session.
π credential
The credential to login with. Must be provided wrapped by the AES key wrap algorithm using the import KEK indicated by import_kek_id.
π§ comp_mask
Reserved for future extension β must be 0 now. Like, actually 0, bestie.
β state
Indicates the state of the current crypto login session. Can be one of MLX5DV_CRYPTO_LOGIN_STATE_VALID, MLX5DV_CRYPTO_LOGIN_STATE_NO_LOGIN and MLX5DV_CRYPTO_LOGIN_STATE_INVALID.
π₯ RETURN VALUE π₯
mlx5dv_crypto_login()returns0on success anderrnovalue on error.mlx5dv_crypto_login_query_state()returns0on success and updatesstatewith the queried state. On error,errnovalue is returned.mlx5dv_crypto_logout()returns0on success anderrnovalue on error.
π ERRORS π
EEXISTβ A crypto login session already exists.EINVALβ Invalid attributes were provided, or one or more ofcredential,credential_idandimport_kek_idare invalid.ENOENTβ No crypto login session exists.
π AUTHORS π
Avihai Horon <avihaih@nvidia.com>
Thatβs the whole page, bestie π β the footer on this copy is the truncated mlx5dv_crypto_lo...dv_crypto_logout(3) title, and no separate source/version or date line showed up in the provided footer, so consider this your cute sign-off. mwah π«Ά
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms