* [dpdk-dev] [PATCH 1/2] common/cnxk: move instruction queue enable to roc API
2021-07-08 11:47 [dpdk-dev] [PATCH 0/2] add dev start and dev stop ops in cnxk crypto PMD Ankur Dwivedi
@ 2021-07-08 11:47 ` Ankur Dwivedi
2021-07-08 11:47 ` [dpdk-dev] [PATCH 2/2] crypto/cnxk: add dev start and dev stop Ankur Dwivedi
2021-07-18 7:45 ` [dpdk-dev] [PATCH 0/2] add dev start and dev stop ops in cnxk crypto PMD Akhil Goyal
2 siblings, 0 replies; 4+ messages in thread
From: Ankur Dwivedi @ 2021-07-08 11:47 UTC (permalink / raw)
To: dev; +Cc: gakhil, anoobj, ktejasree, jerinj, Ankur Dwivedi
The code for enabling instruction queue is moved to roc API.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
drivers/common/cnxk/roc_cpt.c | 41 ++++++++++++++++++++-------------
drivers/common/cnxk/roc_cpt.h | 1 +
drivers/common/cnxk/version.map | 1 +
3 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index 788b28a167..c001497f74 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -444,8 +444,6 @@ cpt_iq_init(struct roc_cpt_lf *lf)
{
union cpt_lf_q_size lf_q_size = {.u = 0x0};
union cpt_lf_q_base lf_q_base = {.u = 0x0};
- union cpt_lf_inprog lf_inprog;
- union cpt_lf_ctl lf_ctl;
uintptr_t addr;
lf->io_addr = lf->rbase + CPT_LF_NQX(0);
@@ -465,19 +463,6 @@ cpt_iq_init(struct roc_cpt_lf *lf)
lf_q_size.s.size_div40 = CPT_IQ_NB_DESC_SIZE_DIV40(lf->nb_desc);
plt_write64(lf_q_size.u, lf->rbase + CPT_LF_Q_SIZE);
- /* Enable command queue execution */
- lf_inprog.u = plt_read64(lf->rbase + CPT_LF_INPROG);
- lf_inprog.s.eena = 1;
- plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG);
-
- /* Enable instruction queue enqueuing */
- lf_ctl.u = plt_read64(lf->rbase + CPT_LF_CTL);
- lf_ctl.s.ena = 1;
- lf_ctl.s.fc_ena = 1;
- lf_ctl.s.fc_up_crossing = 1;
- lf_ctl.s.fc_hyst_bits = CPT_FC_NUM_HYST_BITS;
- plt_write64(lf_ctl.u, lf->rbase + CPT_LF_CTL);
-
lf->fc_addr = (uint64_t *)addr;
}
@@ -573,7 +558,6 @@ cpt_lf_init(struct roc_cpt_lf *lf)
if (rc)
goto disable_iq;
- cpt_lf_dump(lf);
return 0;
disable_iq:
@@ -807,6 +791,31 @@ roc_cpt_iq_disable(struct roc_cpt_lf *lf)
plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG);
}
+void
+roc_cpt_iq_enable(struct roc_cpt_lf *lf)
+{
+ union cpt_lf_inprog lf_inprog;
+ union cpt_lf_ctl lf_ctl;
+
+ /* Disable command queue */
+ roc_cpt_iq_disable(lf);
+
+ /* Enable command queue execution */
+ lf_inprog.u = plt_read64(lf->rbase + CPT_LF_INPROG);
+ lf_inprog.s.eena = 1;
+ plt_write64(lf_inprog.u, lf->rbase + CPT_LF_INPROG);
+
+ /* Enable instruction queue enqueuing */
+ lf_ctl.u = plt_read64(lf->rbase + CPT_LF_CTL);
+ lf_ctl.s.ena = 1;
+ lf_ctl.s.fc_ena = 1;
+ lf_ctl.s.fc_up_crossing = 1;
+ lf_ctl.s.fc_hyst_bits = CPT_FC_NUM_HYST_BITS;
+ plt_write64(lf_ctl.u, lf->rbase + CPT_LF_CTL);
+
+ cpt_lf_dump(lf);
+}
+
int
roc_cpt_lmtline_init(struct roc_cpt *roc_cpt, struct roc_cpt_lmtline *lmtline,
int lf_id)
diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h
index 8dd2b5ee69..3a2f5b97e1 100644
--- a/drivers/common/cnxk/roc_cpt.h
+++ b/drivers/common/cnxk/roc_cpt.h
@@ -139,6 +139,7 @@ int __roc_api roc_cpt_inline_ipsec_inb_cfg(struct roc_cpt *roc_cpt,
int __roc_api roc_cpt_afs_print(struct roc_cpt *roc_cpt);
int __roc_api roc_cpt_lfs_print(struct roc_cpt *roc_cpt);
void __roc_api roc_cpt_iq_disable(struct roc_cpt_lf *lf);
+void __roc_api roc_cpt_iq_enable(struct roc_cpt_lf *lf);
int __roc_api roc_cpt_lmtline_init(struct roc_cpt *roc_cpt,
struct roc_cpt_lmtline *lmtline, int lf_id);
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index e3af48c02e..490a366ea6 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -54,6 +54,7 @@ INTERNAL {
roc_cpt_inline_ipsec_cfg;
roc_cpt_inline_ipsec_inb_cfg;
roc_cpt_iq_disable;
+ roc_cpt_iq_enable;
roc_cpt_lf_ctx_flush;
roc_cpt_lf_init;
roc_cpt_lf_fini;
--
2.28.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] crypto/cnxk: add dev start and dev stop
2021-07-08 11:47 [dpdk-dev] [PATCH 0/2] add dev start and dev stop ops in cnxk crypto PMD Ankur Dwivedi
2021-07-08 11:47 ` [dpdk-dev] [PATCH 1/2] common/cnxk: move instruction queue enable to roc API Ankur Dwivedi
@ 2021-07-08 11:47 ` Ankur Dwivedi
2021-07-18 7:45 ` [dpdk-dev] [PATCH 0/2] add dev start and dev stop ops in cnxk crypto PMD Akhil Goyal
2 siblings, 0 replies; 4+ messages in thread
From: Ankur Dwivedi @ 2021-07-08 11:47 UTC (permalink / raw)
To: dev; +Cc: gakhil, anoobj, ktejasree, jerinj, Ankur Dwivedi
The instruction queue is enabled in dev start and is disabled in
dev stop.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
---
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 7322539a17..7d8d98e7ec 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -95,7 +95,13 @@ cnxk_cpt_dev_config(struct rte_cryptodev *dev,
int
cnxk_cpt_dev_start(struct rte_cryptodev *dev)
{
- RTE_SET_USED(dev);
+ struct cnxk_cpt_vf *vf = dev->data->dev_private;
+ struct roc_cpt *roc_cpt = &vf->cpt;
+ uint16_t nb_lf = roc_cpt->nb_lf;
+ uint16_t qp_id;
+
+ for (qp_id = 0; qp_id < nb_lf; qp_id++)
+ roc_cpt_iq_enable(roc_cpt->lf[qp_id]);
return 0;
}
@@ -103,7 +109,13 @@ cnxk_cpt_dev_start(struct rte_cryptodev *dev)
void
cnxk_cpt_dev_stop(struct rte_cryptodev *dev)
{
- RTE_SET_USED(dev);
+ struct cnxk_cpt_vf *vf = dev->data->dev_private;
+ struct roc_cpt *roc_cpt = &vf->cpt;
+ uint16_t nb_lf = roc_cpt->nb_lf;
+ uint16_t qp_id;
+
+ for (qp_id = 0; qp_id < nb_lf; qp_id++)
+ roc_cpt_iq_disable(roc_cpt->lf[qp_id]);
}
int
--
2.28.0
^ permalink raw reply [flat|nested] 4+ messages in thread