[PATCH v2 3/5] eventdev/crypto: fix wrong offset used while flushing events

Gujjar, Abhinandan S abhinandan.gujjar at intel.com
Tue Dec 6 17:17:54 CET 2022


Acked-by: Abhinandan Gujjar <abhinandan.gujjar at intel.com>

> -----Original Message-----
> From: Kundapura, Ganapati <ganapati.kundapura at intel.com>
> Sent: Thursday, December 1, 2022 12:17 PM
> To: dev at dpdk.org; jerinj at marvell.com; Naga Harish K, S V
> <s.v.naga.harish.k at intel.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar at intel.com>
> Cc: Jayatheerthan, Jay <jay.jayatheerthan at intel.com>
> Subject: [PATCH v2 3/5] eventdev/crypto: fix wrong offset used while flushing
> events
> 
> Events enqueued to eventdev from the beginning of the circular buffer.
> This leads to invalid or already freed events getting enqueued to eventdev
> from the circular buffer.
> 
> Fixed by enqueuing the events to eventdev from the head pointer of circular
> buffer.
> 
> Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
> 
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura at intel.com>
> ---
> v2:
> * Updated subject line in commit message
> 
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index ef3dbe9..72deedd 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -669,7 +669,7 @@ eca_circular_buffer_flush_to_evdev(struct
> event_crypto_adapter *adapter,
>  	else
>  		return 0;  /* buffer empty */
> 
> -	nb_ops_flushed =  eca_ops_enqueue_burst(adapter, ops, n);
> +	nb_ops_flushed =  eca_ops_enqueue_burst(adapter, &ops[*headp],
> n);
>  	bufp->count -= nb_ops_flushed;
>  	if (!bufp->count) {
>  		*headp = 0;
> --
> 2.6.4



More information about the dev mailing list