From: Srujana Challa <schalla@marvell.com>
To: <gakhil@marvell.com>, <roy.fan.zhang@intel.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>, <ndabilpuram@marvell.com>,
<anoobj@marvell.com>
Subject: [RFC PATCH] cryptodev: add return parameter to callback process API
Date: Fri, 24 Jun 2022 17:41:02 +0530 [thread overview]
Message-ID: <20220624121102.3450560-1-schalla@marvell.com> (raw)
Adds a return parameter "uint16_t qp_id" to the functions
rte_cryptodev_pmd_callback_process and rte_cryptodev_cb_fn.
The new parameter is used to return queue pair ID to
the application when it gets error interrupt, so that
application can disable and enable the queue pair, to bring
the queue back to normal state.
Signed-off-by: Srujana Challa <schalla@marvell.com>
Change-Id: I423c4fd6b8c3d910c60e3a6d4f17534756299213
---
lib/cryptodev/cryptodev_pmd.h | 3 ++-
lib/cryptodev/rte_cryptodev.c | 8 ++++----
lib/cryptodev/rte_cryptodev.h | 9 ++++++---
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 3dcc3cb7ed..f087b58161 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -560,6 +560,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
* device.
* *
* @param dev Pointer to cryptodev struct
+ * @param qp_id To pass qp_id, which got interrupt, to user application.
* @param event Crypto device interrupt event type.
*
* @return
@@ -567,7 +568,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev);
*/
__rte_internal
void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
- enum rte_cryptodev_event_type event);
+ uint16_t qp_id, enum rte_cryptodev_event_type event);
/**
* @internal
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 42f3221052..eee208ce2d 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -1689,8 +1689,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
}
void
-rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
- enum rte_cryptodev_event_type event)
+rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, uint16_t qp_id,
+ enum rte_cryptodev_event_type event)
{
struct rte_cryptodev_callback *cb_lst;
struct rte_cryptodev_callback dev_cb;
@@ -1702,8 +1702,8 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
dev_cb = *cb_lst;
cb_lst->active = 1;
rte_spinlock_unlock(&rte_cryptodev_cb_lock);
- dev_cb.cb_fn(dev->data->dev_id, dev_cb.event,
- dev_cb.cb_arg);
+ dev_cb.cb_fn(dev->data->dev_id, qp_id, dev_cb.event,
+ dev_cb.cb_arg);
rte_spinlock_lock(&rte_cryptodev_cb_lock);
cb_lst->active = 0;
}
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 56f459c6a0..6b41262735 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -577,13 +577,16 @@ typedef uint16_t (*rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id,
* software for notification of device events
*
* @param dev_id Crypto device identifier
+ * @param qp_id Return parameter from driver to the application. Driver
+ * returns queue pair ID when it gets HW error interrupt.
+ * The application can release and setup the queue
+ * again, to bring the HW queue back to normal state.
* @param event Crypto device event to register for notification of.
* @param cb_arg User specified parameter to be passed as to passed to
* users callback function.
*/
-typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id,
- enum rte_cryptodev_event_type event, void *cb_arg);
-
+typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id, uint16_t qp_id,
+ enum rte_cryptodev_event_type event, void *cb_arg);
/** Crypto Device statistics */
struct rte_cryptodev_stats {
--
2.25.1
next reply other threads:[~2022-06-24 12:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 12:11 Srujana Challa [this message]
2022-06-24 12:12 Srujana Challa
2022-07-17 10:46 ` Thomas Monjalon
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=20220624121102.3450560-1-schalla@marvell.com \
--to=schalla@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=roy.fan.zhang@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 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).