[LTP] [PATCH 3/3] crypto: Replace old netlink helper functions with netlink contexts

Petr Vorel pvorel@suse.cz
Mon Nov 13 16:40:49 CET 2023


Hi Martin,

...
> +++ b/include/tst_crypto.h
> @@ -13,67 +13,13 @@
>  #define TST_CRYPTO_H

>  #include "lapi/cryptouser.h"
> -
> -/**
> - * A reference to a crypto session and associated state.
> - *
> - * Holds state relevant to a netlink crypto connection. The seq_num is used
> - * to tag each message sent to the netlink layer and is automatically
> - * incremented by the tst_crypto_ functions. When the netlink layer sends a
> - * response (ack) it will use the sequences number from the request.
> - *
> - * Some functions, such as delete ALG, may return EBUSY in which case it is
> - * safe to retry them. The retries field allows you to set the number of
> - * times this should be done. If set to zero the operation will only be tried
> - * once. For operations which do not return EBUSY, the field is ignored.
> - *
> - * Use TST_CRYPTO_SESSION_INIT to statically initialize this struct with sane
> - * defaults.
> - */
> -struct tst_crypto_session {
> -	/** File descriptor for the netlink socket */
> -	int fd;
> -	/** A sequence number used to identify responses from the kernel. */
> -	uint32_t seq_num;
> -	/** Number of times some operations will be retried. */
> -	uint32_t retries;
> -};

include/tst_crypto.h still contains "@relates tst_crypto_session". I guess this
should be replaced with "@relates tst_netlink_context", right?

I can fix this before merge.

...
> -/**
> - * Default static definition of tst_crypto_session.
> - *
> - * @relates tst_crypto_session
> - */
> -#define TST_CRYPTO_SESSION_INIT {\
> -	.fd = 0,                 \
> -	.seq_num = 0,            \
> -	.retries = 1000          \
I quite like this macro which had the default values.
But atm only retries 1000 is what needs to be specified, thus understand that
you didn't introduce any macro wrapper).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list