Skip to contentSkip to conversation

crypto: caam/qi2 - Add printing dpseci fq stats using debugfs

PATCH Superseded Vakul Garg 2 participants 3 messages Jul 23, 2019

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Vakul Garg

author
#0 lore raw

PATCH v4 1/1 crypto: caam/qi2 - Add printing dpseci fq stats using debugfs

Add support of printing the dpseci frame queue statistics using debugfs.

---

Please ignore PATCH v3.
Changes since v2:
- Replaced CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM_DEBUGFS with CONFIG_DEBUG_FS.

 drivers/crypto/caam/Makefile         |  1 +
 drivers/crypto/caam/caamalg_qi2.c    |  5 +++
 drivers/crypto/caam/caamalg_qi2.h    |  2 +
 drivers/crypto/caam/dpseci-debugfs.c | 80 ++++++++++++++++++++++++++++++++++++
 drivers/crypto/caam/dpseci-debugfs.h | 19 +++++++++
 5 files changed, 107 insertions(+)
 create mode 100644 drivers/crypto/caam/dpseci-debugfs.c
 create mode 100644 drivers/crypto/caam/dpseci-debugfs.h
drivers/crypto/caam/Makefile +1 -0
index c7b8c537ebfa..af5f64cb5e47 100644
@@ -31,3 +31,4 @@ endif
 obj-$(CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM) += dpaa2_caam.o
 
 dpaa2_caam-y    := caamalg_qi2.o dpseci.o
+dpaa2_caam-$(CONFIG_DEBUG_FS) += dpseci-debugfs.o
drivers/crypto/caam/caamalg_qi2.c +5 -0
index c7dad3c139e4..364206c99e6a 100644
@@ -15,6 +15,7 @@
 #include "key_gen.h"
 #include "caamalg_desc.h"
 #include "caamhash_desc.h"
+#include "dpseci-debugfs.h"
 #include <linux/fsl/mc.h>
 #include <soc/fsl/dpaa2-io.h>
 #include <soc/fsl/dpaa2-fd.h>
@@ -5479,6 +5480,8 @@ static int dpaa2_caam_probe(struct fsl_mc_device *dpseci_dev)
 		goto err_bind;
 	}
 
+	dpaa2_dpseci_debugfs_init(priv);
+
 	/* register crypto algorithms the device supports */
 	for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
 		struct caam_skcipher_alg *t_alg = driver_algs + i;
@@ -5646,6 +5649,8 @@ static int __cold dpaa2_caam_remove(struct fsl_mc_device *ls_dev)
 	dev = &ls_dev->dev;
 	priv = dev_get_drvdata(dev);
 
+	dpaa2_dpseci_debugfs_exit(priv);
+
 	for (i = 0; i < ARRAY_SIZE(driver_aeads); i++) {
 		struct caam_aead_alg *t_alg = driver_aeads + i;
 
drivers/crypto/caam/caamalg_qi2.h +2 -0
index 8646a7883c63..984e5d03277f 100644
@@ -10,6 +10,7 @@
 #include <soc/fsl/dpaa2-io.h>
 #include <soc/fsl/dpaa2-fd.h>
 #include <linux/threads.h>
+#include <linux/netdevice.h>
 #include "dpseci.h"
 #include "desc_constr.h"
 
@@ -64,6 +65,7 @@ struct dpaa2_caam_priv {
 	struct iommu_domain *domain;
 
 	struct dpaa2_caam_priv_per_cpu __percpu *ppriv;
+	struct dentry *dfs_root;
 };
 
 /**
drivers/crypto/caam/dpseci-debugfs.c new file +80 -0

80 lines not on this page · raw message

drivers/crypto/caam/dpseci-debugfs.h new file +19 -0
new file mode 100644
index 000000000000..1dbdb2587758
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2019 NXP
+ */
+
+#ifndef DPSECI_DEBUGFS_H
+#define DPSECI_DEBUGFS_H
+
+#include <linux/dcache.h>
+#include "caamalg_qi2.h"
+
+#ifdef CONFIG_DEBUG_FS
+void dpaa2_dpseci_debugfs_init(struct dpaa2_caam_priv *priv);
+void dpaa2_dpseci_debugfs_exit(struct dpaa2_caam_priv *priv);
+#else
+static inline void dpaa2_dpseci_debugfs_init(struct dpaa2_caam_priv *priv) {}
+static inline void dpaa2_dpseci_debugfs_exit(struct dpaa2_caam_priv *priv) {}
+#endif /* CONFIG_DEBUG_FS */
+
+#endif /* DPSECI_DEBUGFS_H */
Signature · 1 line
2.13.6
maintainer
#1 lore raw

drivers/crypto/caam/dpseci-debugfs.c line 3

Quoted 9 lines · Vakul Garg
drivers/crypto/caam/dpseci-debugfs.c new file +3 -0
new file mode 100644
index 000000000000..2e43ba9b7491
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2019 NXP
+ */

.c and .h files have different syntax, see:
https://www.kernel.org/doc/html/latest/process/license-rules.html#license-identifier-syntax

drivers/crypto/caam/dpseci-debugfs.h line 3

Quoted 9 lines
drivers/crypto/caam/dpseci-debugfs.h new file +3 -0
new file mode 100644
index 000000000000..1dbdb2587758
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2019 NXP
+ */

Yet another nitpick: incorrect commenting style (for the 2nd comment)
https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting

Why not make it a single-line comment?

Sorry for not catching these earlier.

Horia

author
#2 lore raw
Quoted 12 lines

-----Original Message-----
From: Horia Geanta
Sent: Tuesday, July 23, 2019 2:38 PM
To: Vakul Garg <[email protected]>; [email protected]
Cc: Aymen Sghaier <[email protected]>; [email protected]
Subject: Re: [PATCH v4] crypto: caam/qi2 - Add printing dpseci fq stats using debugfs

On 7/23/2019 11:42 AM, Vakul Garg wrote:

Quoted 15 lines

drivers/crypto/caam/dpseci-debugfs.c line 3

Quoted 10 lines
drivers/crypto/caam/dpseci-debugfs.c new file +3 -0
new file mode 100644
index 000000000000..2e43ba9b7491
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2019 NXP
+ */

.c and .h files have different syntax, see:
https://www.kernel.org/doc/html/latest/process/license-rules.html#license-
identifier-syntax

Thanks for pointing them out.
Earlier, I was not able to fix checkpatch warnings related to license headers.

Quoted 22 lines

drivers/crypto/caam/dpseci-debugfs.h line 3

Quoted 10 lines
drivers/crypto/caam/dpseci-debugfs.h new file +3 -0
new file mode 100644
index 000000000000..1dbdb2587758
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
+/* Copyright 2019 NXP
+ */

Yet another nitpick: incorrect commenting style (for the 2nd comment)
https://www.kernel.org/doc/html/latest/process/coding-
style.html#commenting

Why not make it a single-line comment?

Sorry for not catching these earlier.

Horia