git: 0e99e55d1866 - main - wlanstats: add crypto_swcipherfail

From: Adrian Chadd <adrian_at_FreeBSD.org>
Date: Wed, 23 Apr 2025 02:04:10 UTC
The branch main has been updated by adrian:

URL: https://cgit.FreeBSD.org/src/commit/?id=0e99e55d18669164b5f7218222ec6ced5609ee48

commit 0e99e55d18669164b5f7218222ec6ced5609ee48
Author:     Adrian Chadd <adrian@FreeBSD.org>
AuthorDate: 2025-04-10 20:41:46 +0000
Commit:     Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2025-04-23 02:03:00 +0000

    wlanstats: add crypto_swcipherfail
    
    This adds the is_crypto_swcipherfail counter to wlanstats.
    This counter counts the instances of failing to find support
    for a requested cipher being handled completely in software.
    
    Differential Revision:  https://reviews.freebsd.org/D49767
    Reviewed by:    bz
---
 usr.sbin/wlanstats/wlanstats.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/wlanstats/wlanstats.c b/usr.sbin/wlanstats/wlanstats.c
index 588b67ddd417..83f5010341a9 100644
--- a/usr.sbin/wlanstats/wlanstats.c
+++ b/usr.sbin/wlanstats/wlanstats.c
@@ -394,6 +394,8 @@ static const struct fmt wlanstats[] = {
 	{ 9,	"gcmp_nomem",	"gcmpnomem",	"No memory available (GCMP)" },
 #define	S_RX_GCMPNOSPC		AFTER(S_RX_GCMPNOMEM)
 	{ 9,	"gcmp_nospc",	"gcmpnospc",	"No mbuf space available (GCMP)" },
+#define	S_CRYPTO_SWCIPHERFAIL	AFTER(S_RX_GCMPNOSPC)
+	{ 12,	"crypto_swcipherfail",	"swcipherfail",	"No matching software cipher support" },
 };
 
 struct wlanstatfoo_p {
@@ -848,6 +850,7 @@ wlan_get_curstat(struct bsdstat *sf, int s, char b[], size_t bs)
 	case S_RX_GCMPMIC:	STAT(rx_gcmpmic);
 	case S_RX_GCMPNOMEM:	STAT(crypto_gcmp_nomem);
 	case S_RX_GCMPNOSPC:	STAT(crypto_gcmp_nospc);
+	case S_CRYPTO_SWCIPHERFAIL:	STAT(crypto_swcipherfail);
 	}
 	return wlan_getinfo(wf, s, b, bs);
 #undef NSTAT
@@ -1019,6 +1022,7 @@ wlan_get_totstat(struct bsdstat *sf, int s, char b[], size_t bs)
 	case S_RX_GCMPMIC:	STAT(rx_gcmpmic);
 	case S_RX_GCMPNOMEM:	STAT(crypto_gcmp_nomem);
 	case S_RX_GCMPNOSPC:	STAT(crypto_gcmp_nospc);
+	case S_CRYPTO_SWCIPHERFAIL:	STAT(crypto_swcipherfail);
 	}
 	return wlan_getinfo(wf, s, b, bs);
 #undef NSTAT