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 17BBC429DC; Mon, 24 Apr 2023 16:36:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 739DE42D17; Mon, 24 Apr 2023 16:36:26 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 52F5442B8C for ; Mon, 24 Apr 2023 16:36:22 +0200 (CEST) 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 33ODToKx016936 for ; Mon, 24 Apr 2023 07:36:21 -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=oaTzOxUQOxtuEc7F9KAjL/GDkJDCJ44PJ8IkETyW4Zc=; b=gSxjnpRja93z4LAgO9f30n6ZiM/FNzvHQisLIdDbol8AALXUEQY78yxLyV8dIu6kcOxw I+HN6/1U1BcPy9zKBtR9AqP9I3U2eD6RDklagO9O62LiG7DhevsWhD+b63TNWc4lxlFI 2dVUmNEWWHaNC0i5gLyyPjxqFxcT87XalVx1pA5hTvnfx4g3wvmqktpotrxOo3wGA1/t Unecu6g7yI3sw4UffW3XmQPLyUtlPnW5g/QzLG72hSdMVCoVhOR0up/Q6s5KAdxlJBdY BK072UZOWahdvhA9kT4yTatTiEvG4d88bIFVAjr4UA1pOASlZSKjNEhEu21H4cb90gdi 3w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3p6db4-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 24 Apr 2023 07:36:21 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 24 Apr 2023 05:55:27 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Mon, 24 Apr 2023 05:55:27 -0700 Received: from localhost.marvell.com (unknown [10.106.27.249]) by maili.marvell.com (Postfix) with ESMTP id 65E483F70A0; Mon, 24 Apr 2023 05:55:27 -0700 (PDT) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru CC: Subject: [PATCH v3 07/11] net/octeon_ep: flush pending DMA operations Date: Mon, 24 Apr 2023 05:55:07 -0700 Message-ID: <20230424125512.40013-8-sedara@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230424125512.40013-1-sedara@marvell.com> References: <20230405142537.1899973-1-sedara@marvell.com> <20230424125512.40013-1-sedara@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: mOru6kUoH8ni-lI5L6xUwWMwZK3gCyM4 X-Proofpoint-GUID: mOru6kUoH8ni-lI5L6xUwWMwZK3gCyM4 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-24_09,2023-04-21_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 Flushes the pending DMA operations while reading the packets by reading control and status register. 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..444136923f 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; + /** Handle 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