[v1] eventdev/crypto: wrong offset used while flushing events

Message ID 20221130152702.1685762-1-ganapati.kundapura@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v1] eventdev/crypto: wrong offset used while flushing events |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Ganapati Kundapura Nov. 30, 2022, 3:27 p.m. UTC
  Events enqueued to eventdev from the beginning of the circular buffer.
This leads to invalid or already freed events getting enqueued to
circular buffer.

Fixed by enqueuing the events from the head pointer of circular buffer.

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 1c0a22b..fe7e9f9 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;