From patchwork Fri Jun 24 12:12:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srujana Challa X-Patchwork-Id: 113441 X-Patchwork-Delegate: gakhil@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 D203CA0032; Fri, 24 Jun 2022 14:12:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD1284069D; Fri, 24 Jun 2022 14:12:24 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 5EB37400EF for ; Fri, 24 Jun 2022 14:12:23 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25O79ZJV020739; Fri, 24 Jun 2022 05:12:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=E9Rqd6xh3Xdwb9cFZ4beAhzksytV8UOSSlbp2oZk8sI=; b=lAB6/UEcgHnh1w8CyIxAjTnTczMk3fsrKaKOcSFDiz2oooqQblJ5qDVB57YmroljpOg5 0BsG0Kw7nrr6+w2IH7xm1+e+27aa5JMYxMFzxbv/i9DqOt4F5VO8y0cZl19Ewt0ugVCa /Uo/WnDXFlz5NkNS9wlQVh/RYHKO9JRSRGUCz0JZcMREAeVd9gC4cN8p0iP7tfM+85U0 sSFO8KCxGLMUFBzxy7MrCJAZux1spTdCzO3FWl2k6KkPqnQIXVkI9UQKYKqaaXz0XiOR tZV4OEJQ7Ztsd+T5vU8av7/zZ+5LRQj5dPEJ6Kq2Quwmw6I3yNgRow8hrA4/ZSo9u8WJ Tw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3gw8ms13mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 24 Jun 2022 05:12:22 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Jun 2022 05:12:20 -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; Fri, 24 Jun 2022 05:12:20 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id ACB323F7044; Fri, 24 Jun 2022 05:12:18 -0700 (PDT) From: Srujana Challa To: , CC: , , , Subject: [RFC PATCH] cryptodev: add return parameter to callback process API Date: Fri, 24 Jun 2022 17:42:17 +0530 Message-ID: <20220624121217.3450612-1-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: nHIK0dIRYgW56vj2XNWI-niVXMkDkKD6 X-Proofpoint-GUID: nHIK0dIRYgW56vj2XNWI-niVXMkDkKD6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-24_07,2022-06-23_01,2022-06-22_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 Adds a return parameter "uint16_t qp_id" to the functions rte_cryptodev_pmd_callback_process and rte_cryptodev_cb_fn. The new parameter is used to return queue pair ID to the application when it gets error interrupt, so that application can disable and enable the queue pair, to bring the queue back to normal state. Signed-off-by: Srujana Challa --- lib/cryptodev/cryptodev_pmd.h | 3 ++- lib/cryptodev/rte_cryptodev.c | 8 ++++---- lib/cryptodev/rte_cryptodev.h | 9 ++++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index 3dcc3cb7ed..f087b58161 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -560,6 +560,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev); * device. * * * @param dev Pointer to cryptodev struct + * @param qp_id To pass qp_id, which got interrupt, to user application. * @param event Crypto device interrupt event type. * * @return @@ -567,7 +568,7 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev); */ __rte_internal void rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, - enum rte_cryptodev_event_type event); + uint16_t qp_id, enum rte_cryptodev_event_type event); /** * @internal diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 42f3221052..eee208ce2d 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -1689,8 +1689,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id, } void -rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, - enum rte_cryptodev_event_type event) +rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, uint16_t qp_id, + enum rte_cryptodev_event_type event) { struct rte_cryptodev_callback *cb_lst; struct rte_cryptodev_callback dev_cb; @@ -1702,8 +1702,8 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev, dev_cb = *cb_lst; cb_lst->active = 1; rte_spinlock_unlock(&rte_cryptodev_cb_lock); - dev_cb.cb_fn(dev->data->dev_id, dev_cb.event, - dev_cb.cb_arg); + dev_cb.cb_fn(dev->data->dev_id, qp_id, dev_cb.event, + dev_cb.cb_arg); rte_spinlock_lock(&rte_cryptodev_cb_lock); cb_lst->active = 0; } diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index 56f459c6a0..6b41262735 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -577,13 +577,16 @@ typedef uint16_t (*rte_cryptodev_callback_fn)(uint16_t dev_id, uint16_t qp_id, * software for notification of device events * * @param dev_id Crypto device identifier + * @param qp_id Return parameter from driver to the application. Driver + * returns queue pair ID when it gets HW error interrupt. + * The application can release and setup the queue + * again, to bring the HW queue back to normal state. * @param event Crypto device event to register for notification of. * @param cb_arg User specified parameter to be passed as to passed to * users callback function. */ -typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id, - enum rte_cryptodev_event_type event, void *cb_arg); - +typedef void (*rte_cryptodev_cb_fn)(uint8_t dev_id, uint16_t qp_id, + enum rte_cryptodev_event_type event, void *cb_arg); /** Crypto Device statistics */ struct rte_cryptodev_stats {