[v2] eventdev/crypto: fix circular buffer full case
Checks
Commit Message
crypto ops from the circular buffer are not getting flushed
to crypto dev when crypto dev becomes busy and circular buffer
gets full.
Fix it by flushing ops from circular buffer when circ buffer is full
instead of returning without flushing.
Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")
Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Comments
On Thu, Aug 3, 2023 at 2:03 PM Ganapati Kundapura
<ganapati.kundapura@intel.com> wrote:
>
> crypto ops from the circular buffer are not getting flushed
> to crypto dev when crypto dev becomes busy and circular buffer
> gets full.
>
> Fix it by flushing ops from circular buffer when circ buffer is full
> instead of returning without flushing.
>
> Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Applied to dpdk-next-net-eventdev/for-main. Thanks
@@ -248,9 +248,18 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
n = *tailp - *headp;
else if (*tailp < *headp)
n = bufp->size - *headp;
- else {
- *nb_ops_flushed = 0;
- return 0; /* buffer empty */
+ else { /* head == tail case */
+ /* when head == tail,
+ * circ buff is either full(tail pointer roll over) or empty
+ */
+ if (bufp->count != 0) {
+ /* circ buffer is full */
+ n = bufp->count;
+ } else {
+ /* circ buffer is empty */
+ *nb_ops_flushed = 0;
+ return 0; /* buffer empty */
+ }
}
*nb_ops_flushed = rte_cryptodev_enqueue_burst(cdev_id, qp_id,