From patchwork Tue May 24 08:42:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 111709 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81901A04FF; Tue, 24 May 2022 10:42:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 724314067C; Tue, 24 May 2022 10:42:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 74FB040A84 for ; Tue, 24 May 2022 10:42:53 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24O7iwf3017461 for ; Tue, 24 May 2022 01:42:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=x4LDKxWBGQN0zKv3ZNDTZHoxk36vSoLkpSPUNc6PZ0U=; b=X+IbmG+5FrSl3Tmq86oih36RKQQL5g960qFwb95UuDe7wNNz60n7njgARumxkSvWx2um ROyJUZPxskbnO98n6mF34TcDFBQOBg6LTr2VG8XeDWChdfRisPxQ8mvoS/5dMePWlb/c BzDPsEYacy80jo+9AKUDFcF+3qA5upWVOVv6HJAuOM4Lo8cqgjaqLJMpyfsiDxrc+UxM /9JiRoA07/mvwCENnZOl9q936qzrLklhe2adzokopJaP8x7OZAQsuxdw3O+NZ3LtOb+A 5uSYIAznRW5DfsCAIMHgwnQhAYK1S9GQ33hy3rZs6q2TjREcOLti8OjPAJXuz2xrXPzF qQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3g6ykm1r4q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 24 May 2022 01:42:52 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 24 May 2022 01:42:50 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 24 May 2022 01:42:50 -0700 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id CDB4C3F709B; Tue, 24 May 2022 01:42:48 -0700 (PDT) From: Harman Kalra To: , Jerin Jacob CC: Harman Kalra , Pavan Nikhilesh Subject: [PATCH v3 01/11] event/octeontx: fix SSO fastpath Date: Tue, 24 May 2022 14:12:25 +0530 Message-ID: <20220524084235.17796-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220517173941.189330-2-hkalra@marvell.com> References: <20220517173941.189330-2-hkalra@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: dI_e2adyHnAXE9ydSJB1QqR1C3FXi6xT X-Proofpoint-ORIG-GUID: dI_e2adyHnAXE9ydSJB1QqR1C3FXi6xT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-24_05,2022-05-23_01,2022-02-23_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Segmentation fault is observed as soon as any dpdk application with ethdev event is launched. Handling the event types appropriately. Also fixing sub event type violation as in OCTEONTX event device we use sub_event_type to store the ethernet port identifier when we receive work from OCTEONTX ethernet device. This violates the event device spec as sub_event_type should be 0 in the initial receive stage. Set sub_event_type to 0 after copying the port id in single workslot mode. Fixes: 8dc6c2f12ecf ("crypto/octeontx: add crypto adapter data path") Signed-off-by: Harman Kalra Signed-off-by: Pavan Nikhilesh --- V3: * fixing sub event type violation V2: * Seperated out a generic patch from the series drivers/event/octeontx/ssovf_worker.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index e6ee292688..57be476394 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -179,16 +179,22 @@ 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) { + uint16_t port = (ev->event >> 20) & 0x7F; + + ev->sub_event_type = 0; + ev->mbuf = ssovf_octeontx_wqe_to_pkt( + get_work1, port, 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;