On Fri, Jun 18, 2021 at 11:49:25PM +0300, Vitaliy Makkoveev wrote:
> I'm lurking in crypto(9) and I found 'cryptocap' structure has unused
> members. Do we want to keep them or they could gone?
Looks like statistics that are never evluated. We should move, but
I am not sure about the direction.
What happened to the kstat feature? It is in the tree, but was
never enabled.
I we revive this, the counters cc_operations and cc_bytes could
stay there. If not, they are useless and can go away.
cc_koperations and cc_queued are not used at all. OK to remove them.
bluhm
> Index: sys/crypto/crypto.c
> ===================================================================
> RCS file: /cvs/src/sys/crypto/crypto.c,v
> retrieving revision 1.82
> diff -u -p -r1.82 crypto.c
> --- sys/crypto/crypto.c 30 Mar 2020 17:48:39 -0000 1.82
> +++ sys/crypto/crypto.c 18 Jun 2021 20:13:52 -0000
> @@ -431,9 +431,6 @@ crypto_invoke(struct cryptop *crp)
> if (crypto_drivers[hid].cc_process == NULL)
> goto migrate;
>
> - crypto_drivers[hid].cc_operations++;
> - crypto_drivers[hid].cc_bytes += crp->crp_ilen;
> -
> error = crypto_drivers[hid].cc_process(crp);
> if (error) {
> if (error == ERESTART) {
> Index: sys/crypto/cryptodev.h
> ===================================================================
> RCS file: /cvs/src/sys/crypto/cryptodev.h,v
> retrieving revision 1.71
> diff -u -p -r1.71 cryptodev.h
> --- sys/crypto/cryptodev.h 10 Aug 2017 18:57:20 -0000 1.71
> +++ sys/crypto/cryptodev.h 18 Jun 2021 20:13:52 -0000
> @@ -195,17 +195,9 @@ struct cryptop {
>
> /* Crypto capabilities structure */
> struct cryptocap {
> - u_int64_t cc_operations; /* Counter of how many ops done */
> - u_int64_t cc_bytes; /* Counter of how many bytes done */
> - u_int64_t cc_koperations; /* How many PK ops done */
> -
> u_int32_t cc_sessions; /* How many sessions allocated */
> -
> /* Symmetric/hash algorithms supported */
> int cc_alg[CRYPTO_ALGORITHM_MAX + 1];
> -
> - int cc_queued; /* Operations queued */
> -
> u_int8_t cc_flags;
> #define CRYPTOCAP_F_CLEANUP 0x01
> #define CRYPTOCAP_F_SOFTWARE 0x02