diff mbox series

[v2,01/11] event/octeontx: fix SSO fastpath

Message ID 20220523161100.86280-1-hkalra@marvell.com (mailing list archive)
State Superseded
Delegated to: Jerin Jacob
Headers show
Series [v2,01/11] event/octeontx: fix SSO fastpath | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Harman Kalra May 23, 2022, 4:10 p.m. UTC
Segmentation fault is observed as soon as any dpdk application
with ethdev event is launched. Handling the event types
appropriately.

Fixes: 8dc6c2f12ecf ("crypto/octeontx: add crypto adapter data path")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
V2:
 * Seperated out a generic patch from the series
 
 drivers/event/octeontx/ssovf_worker.h | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h
index e6ee292688..1e906bf694 100644
--- a/drivers/event/octeontx/ssovf_worker.h
+++ b/drivers/event/octeontx/ssovf_worker.h
@@ -179,16 +179,20 @@  ssows_get_work(struct ssows *ws, struct rte_event *ev, const uint16_t flag)
 	ev->event = sched_type_queue | (get_work0 & 0xffffffff);
 
 	if (get_work1) {
-		if (ev->event_type == RTE_EVENT_TYPE_ETHDEV)
-			get_work1 = (uintptr_t)ssovf_octeontx_wqe_to_pkt(
-				get_work1, (ev->event >> 20) & 0x7F, flag,
-				ws->lookup_mem);
-		else if (ev->event_type == RTE_EVENT_TYPE_CRYPTODEV)
+		if (ev->event_type == RTE_EVENT_TYPE_ETHDEV) {
+			ev->mbuf = ssovf_octeontx_wqe_to_pkt(
+			     get_work1, (ev->event >> 20) & 0x7F, flag,
+			     ws->lookup_mem);
+		} else if (ev->event_type == RTE_EVENT_TYPE_CRYPTODEV) {
 			get_work1 = otx_crypto_adapter_dequeue(get_work1);
-		ev->u64 = get_work1;
-	} else if (unlikely((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF)) {
-		ssovf_octeontx_wqe_free(get_work1);
-		return 0;
+			ev->u64 = get_work1;
+		} else {
+			if (unlikely((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF)) {
+				ssovf_octeontx_wqe_free(get_work1);
+				return 0;
+			}
+			ev->u64 = get_work1;
+		}
 	}
 
 	return !!get_work1;