All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Glover <andre.glover@linux.intel.com>
To: tom.zanussi@linux.intel.com, herbert@gondor.apana.org.au,
	davem@davemloft.net
Cc: dave.jiang@intel.com, fenghua.yu@intel.com,
	wajdi.k.feghali@intel.com, james.guilford@intel.com,
	vinodh.gopal@intel.com, tony.luck@intel.com,
	linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org,
	andre.glover@linux.intel.com
Subject: [PATCH 4/4] crypto: iaa - Add Software Compression stats to IAA Compression Accelerator stats
Date: Thu, 28 Mar 2024 10:44:45 -0700	[thread overview]
Message-ID: <f5136e3a9f4745dc8ecdfc9f0cc8ebd793fbd602.1710969449.git.andre.glover@linux.intel.com> (raw)
In-Reply-To: <cover.1710969449.git.andre.glover@linux.intel.com>

Update optional debugfs statistics support for IAA with additional software
compression statistics. The software compression statistics will track
instances where iaa falls back to software deflate (e.g. when the source
data input length is greater than 4KB).

Signed-off-by: Andre Glover <andre.glover@linux.intel.com>
---
 drivers/crypto/intel/iaa/iaa_crypto_main.c  | 2 ++
 drivers/crypto/intel/iaa/iaa_crypto_stats.c | 8 ++++++++
 drivers/crypto/intel/iaa/iaa_crypto_stats.h | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c
index 4d34096b80ca..ad88ad727d0a 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_main.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c
@@ -1152,6 +1152,8 @@ static int deflate_generic_compress(struct acomp_req *req)
 	kunmap_local(src);
 	kunmap_local(dst);
 
+	update_total_sw_comp_calls();
+
 	return ret;
 }
 
diff --git a/drivers/crypto/intel/iaa/iaa_crypto_stats.c b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
index f5cc3d29ca19..42aae8a738ac 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_stats.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_stats.c
@@ -19,6 +19,7 @@
 
 static atomic64_t total_comp_calls;
 static atomic64_t total_decomp_calls;
+static atomic64_t total_sw_comp_calls;
 static atomic64_t total_sw_decomp_calls;
 static atomic64_t total_comp_bytes_out;
 static atomic64_t total_decomp_bytes_in;
@@ -43,6 +44,11 @@ void update_total_decomp_calls(void)
 	atomic64_inc(&total_decomp_calls);
 }
 
+void update_total_sw_comp_calls(void)
+{
+	atomic64_inc(&total_sw_comp_calls);
+}
+
 void update_total_sw_decomp_calls(void)
 {
 	atomic64_inc(&total_sw_decomp_calls);
@@ -174,6 +180,8 @@ static int global_stats_show(struct seq_file *m, void *v)
 		   atomic64_read(&total_comp_calls));
 	seq_printf(m, "  total_decomp_calls: %llu\n",
 		   atomic64_read(&total_decomp_calls));
+	seq_printf(m, "  total_sw_comp_calls: %llu\n",
+		   atomic64_read(&total_sw_comp_calls));
 	seq_printf(m, "  total_sw_decomp_calls: %llu\n",
 		   atomic64_read(&total_sw_decomp_calls));
 	seq_printf(m, "  total_comp_bytes_out: %llu\n",
diff --git a/drivers/crypto/intel/iaa/iaa_crypto_stats.h b/drivers/crypto/intel/iaa/iaa_crypto_stats.h
index 3787a5f507eb..6e0c6f9939bf 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_stats.h
+++ b/drivers/crypto/intel/iaa/iaa_crypto_stats.h
@@ -11,6 +11,7 @@ void	iaa_crypto_debugfs_cleanup(void);
 void	update_total_comp_calls(void);
 void	update_total_comp_bytes_out(int n);
 void	update_total_decomp_calls(void);
+void	update_total_sw_comp_calls(void);
 void	update_total_sw_decomp_calls(void);
 void	update_total_decomp_bytes_in(int n);
 void	update_completion_einval_errs(void);
@@ -29,6 +30,7 @@ static inline void	iaa_crypto_debugfs_cleanup(void) {}
 static inline void	update_total_comp_calls(void) {}
 static inline void	update_total_comp_bytes_out(int n) {}
 static inline void	update_total_decomp_calls(void) {}
+static inline void	update_total_sw_comp_calls(void) {}
 static inline void	update_total_sw_decomp_calls(void) {}
 static inline void	update_total_decomp_bytes_in(int n) {}
 static inline void	update_completion_einval_errs(void) {}
-- 
2.27.0


  parent reply	other threads:[~2024-03-28 17:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 17:44 [PATCH 0/4] crypto: Add new compression modes for zlib and IAA Andre Glover
2024-03-28 17:44 ` [PATCH 1/4] crypto: Add 'canned' compression mode for zlib Andre Glover
2024-03-28 17:44 ` [PATCH 2/4] crypto: iaa - Add deflate-canned compression algorithm Andre Glover
2024-04-05 20:12   ` Tom Zanussi
2024-03-28 17:44 ` [PATCH 3/4] crypto: iaa - Add deflate-iaa-dynamic " Andre Glover
2024-03-28 17:44 ` Andre Glover [this message]
2024-03-29  2:46 ` [PATCH 0/4] crypto: Add new compression modes for zlib and IAA Eric Biggers
2024-04-01 20:46   ` Andre Glover
2024-04-05  7:07 ` Herbert Xu
2024-05-01 22:07   ` Andre Glover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f5136e3a9f4745dc8ecdfc9f0cc8ebd793fbd602.1710969449.git.andre.glover@linux.intel.com \
    --to=andre.glover@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=james.guilford@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=tom.zanussi@linux.intel.com \
    --cc=tony.luck@intel.com \
    --cc=vinodh.gopal@intel.com \
    --cc=wajdi.k.feghali@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.