[v2,2/2] crypto: validate crypto callbacks from next node
Checks
Commit Message
Crypto callbacks are invoked on checking from head node
which is always valid pointer.
This patch checks next node from the head node if callbacks
registered before invoking callbacks.
Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
---
v2:
* Seperated this patch from the combined patch
Comments
> Crypto callbacks are invoked on checking from head node
> which is always valid pointer.
>
> This patch checks next node from the head node if callbacks
> registered before invoking callbacks.
>
> Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")
>
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
Cc: stable@dpdk.org
@@ -1910,7 +1910,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops);
#if RTE_CRYPTO_CALLBACKS
- if (unlikely(fp_ops->qp.deq_cb != NULL)) {
+ if (unlikely(fp_ops->qp.deq_cb[qp_id].next != NULL)) {
struct rte_cryptodev_cb_rcu *list;
struct rte_cryptodev_cb *cb;
@@ -1977,7 +1977,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
fp_ops = &rte_crypto_fp_ops[dev_id];
qp = fp_ops->qp.data[qp_id];
#if RTE_CRYPTO_CALLBACKS
- if (unlikely(fp_ops->qp.enq_cb != NULL)) {
+ if (unlikely(fp_ops->qp.enq_cb[qp_id].next != NULL)) {
struct rte_cryptodev_cb_rcu *list;
struct rte_cryptodev_cb *cb;