From: Vidya Sagar Velumuri <vvelumuri@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
Ankur Dwivedi <adwivedi@marvell.com>,
Anoob Joseph <anoobj@marvell.com>,
Tejasree Kondoj <ktejasree@marvell.com>
Cc: <gakhil@marvell.com>, <jerinj@marvell.com>,
<vvelumuri@marvell.com>, <asasidharan@marvell.com>,
<gmuthukrishn@marvell.com>, <dev@dpdk.org>
Subject: [PATCH v1 2/3] crypto/cnxk: add queue pair reset support
Date: Thu, 22 Aug 2024 03:28:55 -0700 [thread overview]
Message-ID: <20240822102856.3965710-2-vvelumuri@marvell.com> (raw)
In-Reply-To: <20240822102856.3965710-1-vvelumuri@marvell.com>
Add support for reset of a specific queue pair on cnxk platform.
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c
index aba2a49d19..3855d5e7a5 100644
--- a/drivers/common/cnxk/roc_cpt.c
+++ b/drivers/common/cnxk/roc_cpt.c
@@ -953,6 +953,20 @@ cpt_lf_fini(struct roc_cpt_lf *lf)
lf->iq_vaddr = NULL;
}
+void
+roc_cpt_lf_reset(struct roc_cpt_lf *lf)
+{
+ if (lf == NULL)
+ return;
+
+ cpt_lf_misc_intr_enb_dis(lf, false);
+ cpt_lf_done_intr_enb_dis(lf, false);
+ roc_cpt_iq_disable(lf);
+ roc_cpt_iq_reset(lf);
+ cpt_lf_misc_intr_enb_dis(lf, true);
+ cpt_lf_done_intr_enb_dis(lf, true);
+}
+
void
roc_cpt_lf_fini(struct roc_cpt_lf *lf)
{
diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h
index e2e919f80f..0b9c933925 100644
--- a/drivers/common/cnxk/roc_cpt.h
+++ b/drivers/common/cnxk/roc_cpt.h
@@ -187,6 +187,7 @@ int __roc_api roc_cpt_dev_configure(struct roc_cpt *roc_cpt, int nb_lf, bool rxc
void __roc_api roc_cpt_dev_clear(struct roc_cpt *roc_cpt);
int __roc_api roc_cpt_lf_init(struct roc_cpt *roc_cpt, struct roc_cpt_lf *lf);
void __roc_api roc_cpt_lf_fini(struct roc_cpt_lf *lf);
+void __roc_api roc_cpt_lf_reset(struct roc_cpt_lf *lf);
int __roc_api roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, void *cptr,
bool inval);
int __roc_api roc_cpt_lf_ctx_reload(struct roc_cpt_lf *lf, void *cptr);
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index f98738d07e..88e59f4161 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -74,6 +74,7 @@ INTERNAL {
roc_cpt_lf_ctx_reload;
roc_cpt_lf_init;
roc_cpt_lf_fini;
+ roc_cpt_lf_reset;
roc_cpt_lfs_print;
roc_cpt_lmtline_init;
roc_cpt_parse_hdr_dump;
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index 780785d656..f18ed69014 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -1976,6 +1976,7 @@ struct rte_cryptodev_ops cn10k_cpt_ops = {
.stats_reset = NULL,
.queue_pair_setup = cnxk_cpt_queue_pair_setup,
.queue_pair_release = cnxk_cpt_queue_pair_release,
+ .queue_pair_reset = cnxk_cpt_queue_pair_reset,
/* Symmetric crypto ops */
.sym_session_get_size = cnxk_cpt_sym_session_get_size,
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
index f443cb9563..ae00af5019 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c
@@ -707,6 +707,7 @@ struct rte_cryptodev_ops cn9k_cpt_ops = {
.stats_reset = NULL,
.queue_pair_setup = cnxk_cpt_queue_pair_setup,
.queue_pair_release = cnxk_cpt_queue_pair_release,
+ .queue_pair_reset = cnxk_cpt_queue_pair_reset,
/* Symmetric crypto ops */
.sym_session_get_size = cnxk_cpt_sym_session_get_size,
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index cfcfa79fdf..09ce98db88 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -496,6 +496,27 @@ cnxk_cpt_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
return ret;
}
+int
+cnxk_cpt_queue_pair_reset(struct rte_cryptodev *dev, uint16_t qp_id,
+ const struct rte_cryptodev_qp_conf *conf, int socket_id)
+{
+ if (conf == NULL) {
+ struct cnxk_cpt_vf *vf = dev->data->dev_private;
+ struct roc_cpt_lf *lf;
+
+ if (vf == NULL)
+ return -ENOTSUP;
+
+ lf = vf->cpt.lf[qp_id];
+ roc_cpt_lf_reset(lf);
+ roc_cpt_iq_enable(lf);
+
+ return 0;
+ }
+
+ return cnxk_cpt_queue_pair_setup(dev, qp_id, conf, socket_id);
+}
+
uint32_t
cnxk_cpt_qp_depth_used(void *qptr)
{
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index caf6ac35e5..e4d85801d7 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -120,6 +120,9 @@ int cnxk_cpt_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
const struct rte_cryptodev_qp_conf *conf,
int socket_id __rte_unused);
+int cnxk_cpt_queue_pair_reset(struct rte_cryptodev *dev, uint16_t qp_id,
+ const struct rte_cryptodev_qp_conf *conf, int socket_id);
+
int cnxk_cpt_queue_pair_release(struct rte_cryptodev *dev, uint16_t qp_id);
unsigned int cnxk_cpt_sym_session_get_size(struct rte_cryptodev *dev);
--
2.25.1
next prev parent reply other threads:[~2024-08-22 10:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 10:28 [PATCH v1 1/3] cryptodev: add queue pair reset API Vidya Sagar Velumuri
2024-08-22 10:28 ` Vidya Sagar Velumuri [this message]
2024-09-18 5:40 ` [PATCH v1 2/3] crypto/cnxk: add queue pair reset support Akhil Goyal
2024-08-22 10:28 ` [PATCH v1 3/3] test/crypto: add support for error recovery Vidya Sagar Velumuri
2024-09-18 5:42 ` Akhil Goyal
2024-09-18 5:40 ` [PATCH v1 1/3] cryptodev: add queue pair reset API Akhil Goyal
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=20240822102856.3965710-2-vvelumuri@marvell.com \
--to=vvelumuri@marvell.com \
--cc=adwivedi@marvell.com \
--cc=anoobj@marvell.com \
--cc=asasidharan@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=gmuthukrishn@marvell.com \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ktejasree@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).