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 5823C429DB; Mon, 24 Apr 2023 14:29:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71A3F42D1D; Mon, 24 Apr 2023 14:29:01 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id C01DB42BC9 for ; Mon, 24 Apr 2023 14:28:57 +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 33OABCbt006481 for ; Mon, 24 Apr 2023 05:28:57 -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=QDg+tmxVVdtZl4OVTPttLr11TKbxJt1IE3kDX6UlFwS+7okX+hGTv3SZZeOHk+mPKcpM 1irOSEgxLLcRLFcbW8y92v9swJoy1Jnn46QHtH2LQn9GzT/Osw3WI1G4d0UrxVHQhj7l uI0xNfm/L/hvTm7DvdF4mqxLFdLbgi/taNRu0m6O+qgJNLAyu9OhHNIw959jaEaETnJz ONa1cfu95kWs1xOYNg9xnnaN9rPIw6Tqkq0+7RuhJ6nrKATNjlwizZO36cr5S2GDEmY7 mgxncvSzed7RgjPB+ZsTKCJVQYDkYNy64oVpvV52jEUqmHMJ8n8jL6VKWW8DeuLJFFhx RQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3q4f3p622b-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 24 Apr 2023 05:28:57 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 24 Apr 2023 05:28:55 -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:28:55 -0700 Received: from localhost.marvell.com (unknown [10.106.27.249]) by maili.marvell.com (Postfix) with ESMTP id 3FF2E3F70A2; Mon, 24 Apr 2023 05:28:55 -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:28:30 -0700 Message-ID: <20230424122835.39493-8-sedara@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230424122835.39493-1-sedara@marvell.com> References: <20230405142537.1899973-2-sedara@marvell.com> <20230424122835.39493-1-sedara@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: kt7jTd62THkcEcRLAdMw-GCKZ9RemCJj X-Proofpoint-GUID: kt7jTd62THkcEcRLAdMw-GCKZ9RemCJj 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_07,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