[4/4] crypto/cnxk: add error interrupt event query handler
Checks
Commit Message
Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
The query handler finds the next queue pair ID with pending error
interrupt event if any, starting from the given queue pair index,
for the device.
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
drivers/common/cnxk/roc_cpt.c | 4 +++-
drivers/common/cnxk/roc_cpt.h | 1 +
drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 1 +
drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 1 +
drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 15 +++++++++++++++
drivers/crypto/cnxk/cnxk_cryptodev_ops.h | 1 +
6 files changed, 22 insertions(+), 1 deletion(-)
Comments
> Subject: [PATCH 4/4] crypto/cnxk: add error interrupt event query handler
>
> Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
> The query handler finds the next queue pair ID with pending error
> interrupt event if any, starting from the given queue pair index,
> for the device.
>
> Signed-off-by: Srujana Challa <schalla@marvell.com>
The patch description do not match with the API added.
Can you please update it?
Thanks.
Hi Akhil,
Please find the correct description inline,
Thanks,
Srujana.
> > Subject: [PATCH 4/4] crypto/cnxk: add error interrupt event query
> > handler
> >
> > Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
> > The query handler finds the next queue pair ID with pending error
> > interrupt event if any, starting from the given queue pair index, for
> > the device.
> >
> > Signed-off-by: Srujana Challa <schalla@marvell.com>
> The patch description do not match with the API added.
> Can you please update it?
>
Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
The query handler returns pending error interrupt event status
for the given queue pair ID.
> Thanks.
> Subject: RE: [PATCH 4/4] crypto/cnxk: add error interrupt event query handler
>
> Hi Akhil,
>
> Please find the correct description inline,
>
> Thanks,
> Srujana.
>
> > > Subject: [PATCH 4/4] crypto/cnxk: add error interrupt event query
> > > handler
> > >
> > > Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
> > > The query handler finds the next queue pair ID with pending error
> > > interrupt event if any, starting from the given queue pair index, for
> > > the device.
> > >
> > > Signed-off-by: Srujana Challa <schalla@marvell.com>
> > The patch description do not match with the API added.
> > Can you please update it?
> >
> Adds RTE_CRYPTODEV_EVENT_ERROR query handler for cn9k/cn10k PMD.
> The query handler returns pending error interrupt event status
> for the given queue pair ID.
Series Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Updated the description of this patch.
Thanks.
@@ -63,8 +63,10 @@ cpt_lf_misc_irq(void *param)
/* Clear interrupt */
plt_write64(intr, lf->rbase + CPT_LF_MISC_INT);
- if (int_cb.cb != NULL)
+ if (int_cb.cb != NULL) {
+ lf->error_event_pending = 1;
int_cb.cb(lf, int_cb.cb_args);
+ }
}
static int
@@ -119,6 +119,7 @@ struct roc_cpt_lf {
uint64_t io_addr;
uint8_t *iq_vaddr;
struct roc_nix *inl_outb_nix;
+ uint8_t error_event_pending;
} __plt_cache_aligned;
struct roc_cpt {
@@ -1082,4 +1082,5 @@ struct rte_cryptodev_ops cn10k_cpt_ops = {
/* Event crypto ops */
.session_ev_mdata_set = cn10k_cpt_crypto_adapter_ev_mdata_set,
+ .queue_pair_event_error_query = cnxk_cpt_queue_pair_event_error_query,
};
@@ -759,5 +759,6 @@ struct rte_cryptodev_ops cn9k_cpt_ops = {
/* Event crypto ops */
.session_ev_mdata_set = cn9k_cpt_crypto_adapter_ev_mdata_set,
+ .queue_pair_event_error_query = cnxk_cpt_queue_pair_event_error_query,
};
@@ -806,3 +806,18 @@ cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp)
plt_print("");
roc_cpt_afs_print(qp->lf.roc_cpt);
}
+
+int
+cnxk_cpt_queue_pair_event_error_query(struct rte_cryptodev *dev, uint16_t qp_id)
+{
+ struct cnxk_cpt_vf *vf = dev->data->dev_private;
+ struct roc_cpt *roc_cpt = &vf->cpt;
+ struct roc_cpt_lf *lf;
+
+ lf = roc_cpt->lf[qp_id];
+ if (lf && lf->error_event_pending) {
+ lf->error_event_pending = 0;
+ return 1;
+ }
+ return 0;
+}
@@ -128,6 +128,7 @@ int cnxk_ae_session_cfg(struct rte_cryptodev *dev,
struct rte_crypto_asym_xform *xform,
struct rte_cryptodev_asym_session *sess);
void cnxk_cpt_dump_on_err(struct cnxk_cpt_qp *qp);
+int cnxk_cpt_queue_pair_event_error_query(struct rte_cryptodev *dev, uint16_t qp_id);
static __rte_always_inline void
pending_queue_advance(uint64_t *index, const uint64_t mask)