From patchwork Mon Nov 13 05:31:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srikanth Yalavarthi X-Patchwork-Id: 134124 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 621C343315; Mon, 13 Nov 2023 06:31:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D922E402A6; Mon, 13 Nov 2023 06:31:22 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 28DCC4029A for ; Mon, 13 Nov 2023 06:31:21 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AD4nkPa022289 for ; Sun, 12 Nov 2023 21:31:20 -0800 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=vsQM3gUjxKiaTT55tsisS9yCtXcM6yoP/jGUUrNj+zM=; b=BdKt9TGDNPmC5pag5G7Qh1NtYQUgf9JqhEHjltOmlBekBBRdLyqnmASm3l6c8wSEaLl4 EuGCLTZvwbhjPIwTi5To0x24AR2hTjAPKQfo+NAqu5Z4xgpm0Fhuo4oTWU5t3PGb29MS 3L2s1fnT+4PBrgcGTefiiwIrjEZj4OxgqYU6VAGHs03jjINlA1qmnlgrN3Bdp19YlFFY vMm688BZxdO0xu7kIQe9HxuUx6yMtoF/PQrC/Ef2dgyB01rJR/h1AlBDxi3u/H5GuIL6 dLfJnbU02k8DOIy6ZWsnyX5J9TwTJfFszIE1mpNUc0NHUuJGdl3+7/giW/NpytHfmFPj KQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3uaa0quvj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 12 Nov 2023 21:31:20 -0800 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.48; Sun, 12 Nov 2023 21:31:18 -0800 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.48 via Frontend Transport; Sun, 12 Nov 2023 21:31:18 -0800 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 820D15B6922; Sun, 12 Nov 2023 21:31:17 -0800 (PST) From: Srikanth Yalavarthi To: Srikanth Yalavarthi CC: , , , Subject: [PATCH v1 1/1] ml/cnxk: fix fast-path synchronization Date: Sun, 12 Nov 2023 21:31:15 -0800 Message-ID: <20231113053115.15142-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: cpkqVDp3Gwx4C5ups3u11T_lhFsmeVL8 X-Proofpoint-GUID: cpkqVDp3Gwx4C5ups3u11T_lhFsmeVL8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-12_24,2023-11-09_01,2023-05-22_02 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 Segfaults are reported with TVM/LLVM models as NULL value is read by dequeue thread for the op handle. This is due synchronization issue between enqueue and dequeue threads. This fix ensures the op handle written to internal request structure is committed before the dequeue threads read the handle value. Fixes: 88001b4d88de ("ml/cnxk: update fast path functions") Signed-off-by: Srikanth Yalavarthi --- drivers/ml/cnxk/cnxk_ml_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c index 81866ceaa6..971362b242 100644 --- a/drivers/ml/cnxk/cnxk_ml_ops.c +++ b/drivers/ml/cnxk/cnxk_ml_ops.c @@ -1596,6 +1596,7 @@ cnxk_ml_enqueue_burst(struct rte_ml_dev *dev, uint16_t qp_id, struct rte_ml_op * jcmdq_full: queue->head = head; qp->stats.enqueued_count += count; + rte_wmb(); return count; }