From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7703428D4; Wed, 5 Apr 2023 16:26:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D140342D3D; Wed, 5 Apr 2023 16:25:54 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 09F7C42C4D for ; Wed, 5 Apr 2023 16:25:52 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3357OLOC007019 for ; Wed, 5 Apr 2023 07:25: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-transfer-encoding : content-type; s=pfpt0220; bh=tUOxGFhthRmHBhFa4RE24L8wNzw2yu4oMliLz14QBsc=; b=E0AyVRIc+eVNuINORbyo+6TdBR19B8SPHjoUBAfQas34X4QwHEgkx6VfM/Jm4tsQt8DM +oFqgq5n1TXvVJ8BAVWUyjdrtBQQlgIOQDVvWl1mst4kudl53OQU5DjtLCIUPimgJv27 xaqwTEjO3J14+oMzYkwnaPozI7ymFyf2kgFw2HodUYh5lTvnr2q39eM20lOjtYW/vcHL JxUogmqrzXf6JtdOXBSNoH6vuXYVqhssjDr37Qf3BTdEWTVLcc8pW16sApAZq6TJ+dOH LK6+WOu5R8/EXB7AkCPXTWCmuhpiDkHUT2I5EV+PYJYQvpF+oeniaRiM1bZykeANmrfV jA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3ps4jpjbht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 05 Apr 2023 07:25:52 -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.48; Wed, 5 Apr 2023 07:25: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.48 via Frontend Transport; Wed, 5 Apr 2023 07:25:50 -0700 Received: from localhost.marvell.com (unknown [10.106.27.249]) by maili.marvell.com (Postfix) with ESMTP id 463E43F7050; Wed, 5 Apr 2023 07:25:50 -0700 (PDT) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru CC: Subject: [PATCH v2 06/10] net/octeon_ep: fix DMA incompletion Date: Wed, 5 Apr 2023 07:25:32 -0700 Message-ID: <20230405142537.1899973-7-sedara@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230405142537.1899973-1-sedara@marvell.com> References: <20230404141855.1025625-2-sedara@marvell.com> <20230405142537.1899973-1-sedara@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: RuKdzB0zxY7M4XbuhrfMfxYW5pOWUaI7 X-Proofpoint-ORIG-GUID: RuKdzB0zxY7M4XbuhrfMfxYW5pOWUaI7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-05_09,2023-04-05_01,2023-02-09_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 This patch fixes the DMA incompletion during packet reads. Signed-off-by: Sathesh Edara --- drivers/net/octeon_ep/otx_ep_common.h | 8 ++++++++ drivers/net/octeon_ep/otx_ep_rxtx.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h index 76528ed49d..1d9da5954e 100644 --- a/drivers/net/octeon_ep/otx_ep_common.h +++ b/drivers/net/octeon_ep/otx_ep_common.h @@ -345,6 +345,14 @@ struct otx_ep_droq { */ void *pkts_sent_reg; + /** Fix for DMA incompletion during pkt reads. + * This variable is used to initiate a sent_reg_read + * that completes pending dma + * this variable is used as lvalue so compiler cannot optimize + * the reads. + */ + uint32_t sent_reg_val; + /* Statistics for this DROQ. */ struct otx_ep_droq_stats stats; diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c index c4153bd583..ca968f6fe7 100644 --- a/drivers/net/octeon_ep/otx_ep_rxtx.c +++ b/drivers/net/octeon_ep/otx_ep_rxtx.c @@ -917,6 +917,10 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep, struct rte_mbuf *first_buf = NULL; struct rte_mbuf *last_buf = NULL; + /* csr read helps to flush pending dma */ + droq->sent_reg_val = rte_read32(droq->pkts_sent_reg); + rte_rmb(); + while (pkt_len < total_pkt_len) { int cpy_len = 0; -- 2.31.1