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 479164564F; Fri, 19 Jul 2024 12:05:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C6D542F97; Fri, 19 Jul 2024 12:02:45 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010054.outbound.protection.outlook.com [52.101.69.54]) by mails.dpdk.org (Postfix) with ESMTP id 9485042F2D for ; Fri, 19 Jul 2024 12:02:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W2LRlCUQyQul7+rmiVHKDOMaWT3QRGoSxLUmiLG7xLvIseIsORRy2taqH/alXo0jmB535p69umVFeDH7eKnNkoNVgUGGe3LkaE9uX4ifaUllfmGG9urnSCZXhoig1+K5/tvsEbBrQOnLlRwc6Zbj8JJFJ8RnSqPY6sssCDUP7yUBdG5Yj6ULkD9xgKv0nXWTyo8j4CGjiK4xzvS7Zy4Aj9uPa0tS0z5xkkIb3CMsbZTxjd/rE71f61Q5SZ4aaLNOUndk1uJg/hXUSTAgf0tLPZXKrFUX1vZtZoEWm7MjQThCzh0biYqMPw6xQKmfK9ECvQrq94gHAF7BJtXczjz6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lO825mTYcGFkb1Wbb3oQ/3OmpWD/w8XPXrh1ZbPIDRI=; b=QP3cFbcq6nFqIb6mvhSlKAJ4uxPS+RkBVTaU849xItm3kj2mlSalTYKXh2uVtkS4gsMnkz7zxyWwvM28mJxH1JQ4KA84xMhz+GkdepajqRUemiZvTAcNNGeNVsP8rLg3g8SquDOwjm/fdmdN/8PGyuQ/w/A+STkxSMgzKKuUnFWucCMR7Ei4LwCO0Psyq7jganGJOX0pqae+3b9Vy0BPLZj6P6nKXFF6jDJitT4FwfR9P/aR52B0XJS6/YAVH8mvxWMZU/TcyeBhBU1R6medXixEClmgKS6QvdcUWna3ngCxgIGstXUIbnPnCZjH5jnaECA673wh7KcHz6/VEjSTtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lO825mTYcGFkb1Wbb3oQ/3OmpWD/w8XPXrh1ZbPIDRI=; b=fYo+a5tS/OLyFr2B4MCPCa3U9xMm4ONQcvZFUrlL+Gwg0YUCqSOTxCbXwS8gEhhIcZ5mHsKttjXK43e06tOAcQG7BKVBE585GKfp58VmSRMNaREOVk/Jr2CC+kbzjKVsgQ4kTsi4cB7y1Ka/1FKcu28JjNYb4MadbgsN+5dyiJ8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) by AM0PR04MB7108.eurprd04.prod.outlook.com (2603:10a6:208:19e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.20; Fri, 19 Jul 2024 10:02:26 +0000 Received: from PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f]) by PAXPR04MB8205.eurprd04.prod.outlook.com ([fe80::7633:884d:5973:174f%6]) with mapi id 15.20.7784.016; Fri, 19 Jul 2024 10:02:26 +0000 From: Gagandeep Singh To: dev@dpdk.org, Sachin Saxena Cc: Jun Yang Subject: [PATCH 26/30] dma/dpaa: improve ERRATA workaround solution Date: Fri, 19 Jul 2024 15:31:22 +0530 Message-Id: <20240719100126.1150373-26-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240719100126.1150373-1-g.singh@nxp.com> References: <20240719100126.1150373-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0184.apcprd01.prod.exchangelabs.com (2603:1096:4:189::9) To PAXPR04MB8205.eurprd04.prod.outlook.com (2603:10a6:102:1c2::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8205:EE_|AM0PR04MB7108:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dd8c377-2c2e-4905-0884-08dca7d9e427 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?XnALKZuKvNjQuYZhQS2Nup4kaxgdzq8saw+W84Yabfze9Acb6RXVKwhYdVCV?= =?us-ascii?Q?fcL4/YjeaPGMnp2BLHnHl9zYdLPCzikvRzgTamDH4g/Xie4nvOh33C/Mhhmk?= =?us-ascii?Q?fdl12JJRlyOg+t7tYCmuiv7FDIknZEk0uD32bbQj6iXKpfQ6jUD+LllBiNf+?= =?us-ascii?Q?C01IsBJtYC6CSK1ycueouaJtzli61DQO8zVsLM1ykqT9yO3AudS8Vx1qbC4p?= =?us-ascii?Q?PUimccivJ+lpUyMz8gmlqdKcORtbP0TFk7Avp+rXcJEIFztHiRZM/yUp47Ng?= =?us-ascii?Q?62rsYnDoGUjafQ554ZC5E5frWUgVtL1foZe17R9TmorDxKEmm+vJjY974Kt/?= =?us-ascii?Q?1Zs69T9TMmC5d6VxbPwRoqaLOT3yyO6cY4KWbQgwPhMIC9UbraI1T/xZzScS?= =?us-asc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NHJJWtT9wM90rM9?= =?us-ascii?Q?IJpBEvd8oKaUeR3krGG+N+m1X3JF5WwE5BLTJFGN2y+Rb6b+qRVGoeGQlWCA?= =?us-ascii?Q?PvmIkZMhVIh/43VwHDfK3qGnlpF//dN/mfQnO2ncdIIsyjVgCw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8205.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?J24VRpowgYvMnlf7+Av1bhsISTBrsgIXtHD3bZoT8HKS2N2aydQQilMp3+J5?= =?us-ascii?Q?80l5KkNgtn/y1xKcVNFoTIMxV2kvTDhGahC4Qu0gKOLWpl8roQxY2xxdT4/J?= =?us-ascii?Q?MxEypyqWo5/kl9Oua2JdT47W5jnCCCbW6Y6PRmAPm0/AwHjWQRJDf9N0W4tG?= =?us-ascii?Q?fPJ5QryXN1hI9D/69tiPxLTmy9655ljQUCDAsfZ6xglhJi+19MrkqOQ80Q7+?= =?us-ascii?Q?gcZTdrp8svGS00oCw9T2H30K+I2jfmw6aDGYggvLTw/n5HJJRu/i3qpwWa1I?= =?us-ascii?Q?su3qSWODmoNO/+9U7eUnMiYJyBI1WvmBNZwtIWEjL+NmWz100VTGwJJ4Uwzh?= =?us-ascii?Q?HTsVOQGhrAPlaCUh3N2OtPEwnEcGpr4KX8WRDTq4PIZfIyxMvEZ6hBhydgMD?= =?us-ascii?Q?2YyZuGt0b873L7HF4GvYX8o5/eLIpuTiVr7870FYovqWJ6m2orTQ4cX0FEWq?= =?us-ascii?Q?DvCJb4XG9hrGNQV1IJ62Kp5k1tIxGR5wlFYd9B2H1gSGz3G6QtU69h5TgUQu?= =?us-ascii?Q?HWZQqzb9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AuCEfWnKjZ?= =?us-ascii?Q?SO2zrE+PTu5e0cdMvcW77yPumTIwVCmZIUGlPECAVb9pinoppNr6tVa00cBb?= =?us-ascii?Q?OM/loqo99CN1mLM4oNw3jrdcC5NkN3YUTBqGiQdZ0lRAkoAlHJ8ReKVgQgfi?= =?us-ascii?Q?qgYgfUnfGpedT8EcxWO5+4HGfSHfWDY4VaAV2vN1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9dd8c377-2c2e-4905-0884-08dca7d9e427 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8205.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2024 10:02:26.0338 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CZH7x0NP8ZyiP8GI1G+q0gCDGHj/OTBxprS0gkLNhdkDgBMFddu8Wd+iMQ2AQ27N X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB7108 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 From: Jun Yang Fix issue of ERRATA 050757/050265 workaround which is not effective in burst mode. SDF/DDF is referred by first entry of compound frame table, move the DF to compound frame table description which is suitable to adapt single copy and SG/burst copy. Fix SG issue which was caused by memset clearing phy address of SGE in compound frame table. Signed-off-by: Jun Yang --- drivers/dma/dpaa/dpaa_qdma.c | 215 +++++++++++++++++------------------ drivers/dma/dpaa/dpaa_qdma.h | 7 +- 2 files changed, 107 insertions(+), 115 deletions(-) diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 1c8334291a..690ad5a6ff 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -11,7 +11,10 @@ static int s_data_validation; static int s_hw_err_check; -static int s_sg_disable = 1; +static int s_sg_enable = 1; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 +static int s_pci_read = 1; +#endif static inline void qdma_desc_addr_set64(struct fsl_qdma_comp_cmd_desc *ccdf, u64 addr) @@ -126,10 +129,9 @@ fsl_qdma_pre_comp_sd_desc(struct fsl_qdma_queue *queue) struct fsl_qdma_comp_cmd_desc *ccdf; uint16_t i, j; struct fsl_qdma_cmpd_ft *ft; - struct fsl_qdma_df *df; for (i = 0; i < queue->n_cq; i++) { - dma_addr_t phy_ft = 0, phy_df = 0; + dma_addr_t phy_ft = 0; queue->ft[i] = dma_pool_alloc(NULL, sizeof(struct fsl_qdma_cmpd_ft), @@ -156,25 +158,14 @@ fsl_qdma_pre_comp_sd_desc(struct fsl_qdma_queue *queue) offsetof(struct fsl_qdma_cmpd_ft, desc_ssge); queue->ft[i]->phy_dsge = phy_ft + offsetof(struct fsl_qdma_cmpd_ft, desc_dsge); - - queue->df[i] = dma_pool_alloc(NULL, - sizeof(struct fsl_qdma_df), - RTE_CACHE_LINE_SIZE, &phy_df); - if (!queue->df[i]) { - rte_free(queue->ft[i]); - queue->ft[i] = NULL; - goto fail; - } - - memset(queue->ft[i], 0, sizeof(struct fsl_qdma_cmpd_ft)); - memset(queue->df[i], 0, sizeof(struct fsl_qdma_df)); + queue->ft[i]->phy_df = phy_ft + + offsetof(struct fsl_qdma_cmpd_ft, df); ft = queue->ft[i]; - df = queue->df[i]; - sdf = &df->sdf; - ddf = &df->ddf; + sdf = &ft->df.sdf; + ddf = &ft->df.ddf; /* Compound Command Descriptor(Frame List Table) */ - qdma_desc_sge_addr_set64(&ft->desc_buf, phy_df); + qdma_desc_sge_addr_set64(&ft->desc_buf, ft->phy_df); /* It must be 32 as Compound S/G Descriptor */ ft->desc_buf.length = sizeof(struct fsl_qdma_df); @@ -198,10 +189,8 @@ fsl_qdma_pre_comp_sd_desc(struct fsl_qdma_queue *queue) return 0; fail: - for (j = 0; j < i; j++) { + for (j = 0; j < i; j++) rte_free(queue->ft[j]); - rte_free(queue->df[j]); - } return -ENOMEM; } @@ -247,23 +236,12 @@ fsl_qdma_alloc_queue_resources(struct fsl_qdma_engine *fsl_qdma, rte_free(cmd_queue->cq); return -ENOMEM; } - sprintf(nm, "Descriptor Buf_%d_%d", - block_id, queue_id); - cmd_queue->df = rte_zmalloc(nm, - sizeof(void *) * QDMA_QUEUE_SIZE, 0); - if (!cmd_queue->df) { - DPAA_QDMA_ERR("%s zmalloc failed!", nm); - rte_free(cmd_queue->ft); - rte_free(cmd_queue->cq); - return -ENOMEM; - } sprintf(nm, "Pending_desc_%d_%d", block_id, queue_id); cmd_queue->pending_desc = rte_zmalloc(nm, sizeof(struct fsl_qdma_desc) * FSL_QDMA_MAX_DESC_NUM, 0); if (!cmd_queue->pending_desc) { DPAA_QDMA_ERR("%s zmalloc failed!", nm); - rte_free(cmd_queue->df); rte_free(cmd_queue->ft); rte_free(cmd_queue->cq); return -ENOMEM; @@ -278,7 +256,6 @@ fsl_qdma_alloc_queue_resources(struct fsl_qdma_engine *fsl_qdma, rte_free(cmd_queue->pending_desc); rte_free(cmd_queue->ft); rte_free(cmd_queue->cq); - rte_free(cmd_queue->df); return -ENOMEM; } sprintf(nm, "complete-desc_ring_%d_%d", @@ -292,7 +269,6 @@ fsl_qdma_alloc_queue_resources(struct fsl_qdma_engine *fsl_qdma, rte_free(cmd_queue->pending_desc); rte_free(cmd_queue->ft); rte_free(cmd_queue->cq); - rte_free(cmd_queue->df); return -ENOMEM; } sprintf(nm, "complete-pool-desc_ring_%d_%d", @@ -307,7 +283,6 @@ fsl_qdma_alloc_queue_resources(struct fsl_qdma_engine *fsl_qdma, rte_free(cmd_queue->pending_desc); rte_free(cmd_queue->ft); rte_free(cmd_queue->cq); - rte_free(cmd_queue->df); return -ENOMEM; } @@ -320,7 +295,6 @@ fsl_qdma_alloc_queue_resources(struct fsl_qdma_engine *fsl_qdma, static void fsl_qdma_free_cmdq_res(struct fsl_qdma_queue *queue) { - rte_free(queue->df); rte_free(queue->ft); rte_free(queue->cq); rte_free(queue->pending_desc); @@ -664,8 +638,30 @@ fsl_qdma_enqueue_desc_single(struct fsl_qdma_queue *fsl_queue, struct fsl_qdma_comp_sg_desc *csgf_src, *csgf_dest; struct fsl_qdma_cmpd_ft *ft; int ret; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 + struct fsl_qdma_sdf *sdf; +#endif ft = fsl_queue->ft[fsl_queue->ci]; + +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 + if (s_pci_read) { + sdf = &ft->df.sdf; + sdf->srttype = FSL_QDMA_CMD_RWTTYPE; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050265 + sdf->prefetch = 1; +#endif + if (len > FSL_QDMA_CMD_SS_ERR050757_LEN) { + sdf->ssen = 1; + sdf->sss = FSL_QDMA_CMD_SS_ERR050757_LEN; + sdf->ssd = FSL_QDMA_CMD_SS_ERR050757_LEN; + } else { + sdf->ssen = 0; + sdf->sss = 0; + sdf->ssd = 0; + } + } +#endif csgf_src = &ft->desc_sbuf; csgf_dest = &ft->desc_dbuf; qdma_desc_sge_addr_set64(csgf_src, src); @@ -745,7 +741,7 @@ fsl_qdma_enqueue_overflow(struct fsl_qdma_queue *fsl_queue) } static int -fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) +fsl_qdma_enqueue_desc_sg(struct fsl_qdma_queue *fsl_queue) { uint8_t *block = fsl_queue->block_vir, i; struct fsl_qdma_comp_sg_desc *csgf_src, *csgf_dest; @@ -758,74 +754,10 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) struct fsl_qdma_sdf *sdf; #endif - ret = fsl_qdma_enqueue_overflow(fsl_queue); - if (unlikely(ret)) - return ret; - ft = fsl_queue->ft[fsl_queue->ci]; csgf_src = &ft->desc_sbuf; csgf_dest = &ft->desc_dbuf; -#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 - sdf = &fsl_queue->df[fsl_queue->ci]->sdf; - sdf->srttype = FSL_QDMA_CMD_RWTTYPE; -#ifdef RTE_DMA_DPAA_ERRATA_ERR050265 - sdf->prefetch = 1; -#endif -#endif - - if (num == 1) { -#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 - if (fsl_queue->pending_desc[start].len > - FSL_QDMA_CMD_SSS_DISTANCE) { - sdf->ssen = 1; - sdf->sss = FSL_QDMA_CMD_SSS_STRIDE; - sdf->ssd = FSL_QDMA_CMD_SSS_DISTANCE; - } else { - sdf->sss = 0; - sdf->ssd = 0; - } -#endif - ret = fsl_qdma_enqueue_desc_single(fsl_queue, - fsl_queue->pending_desc[start].dst, - fsl_queue->pending_desc[start].src, - fsl_queue->pending_desc[start].len); - if (!ret) { - fsl_queue->pending_start = - (start + 1) & (fsl_queue->pending_max - 1); - fsl_queue->pending_num = 0; - } - return ret; - } else if (s_sg_disable) { - while (fsl_queue->pending_num > 0) { -#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 - if (fsl_queue->pending_desc[start].len > - FSL_QDMA_CMD_SSS_DISTANCE) { - sdf->ssen = 1; - sdf->sss = FSL_QDMA_CMD_SSS_STRIDE; - sdf->ssd = FSL_QDMA_CMD_SSS_DISTANCE; - } else { - sdf->sss = 0; - sdf->ssd = 0; - } -#endif - ret = fsl_qdma_enqueue_desc_single(fsl_queue, - fsl_queue->pending_desc[start].dst, - fsl_queue->pending_desc[start].src, - fsl_queue->pending_desc[start].len); - if (!ret) { - start = (start + 1) & - (fsl_queue->pending_max - 1); - fsl_queue->pending_start = start; - fsl_queue->pending_num--; - } else { - DPAA_QDMA_ERR("Eq pending desc failed(%d)", - ret); - return -EIO; - } - } - return 0; - } qdma_desc_sge_addr_set64(csgf_src, ft->phy_ssge); csgf_src->extion = 1; qdma_desc_sge_addr_set64(csgf_dest, ft->phy_dsge); @@ -849,13 +781,21 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) csgf_src->length = total_len; csgf_dest->length = total_len; #ifdef RTE_DMA_DPAA_ERRATA_ERR050757 - if (total_len > FSL_QDMA_CMD_SSS_DISTANCE) { - sdf->ssen = 1; - sdf->sss = FSL_QDMA_CMD_SSS_STRIDE; - sdf->ssd = FSL_QDMA_CMD_SSS_DISTANCE; - } else { - sdf->sss = 0; - sdf->ssd = 0; + if (s_pci_read) { + sdf = &ft->df.sdf; + sdf->srttype = FSL_QDMA_CMD_RWTTYPE; +#ifdef RTE_DMA_DPAA_ERRATA_ERR050265 + sdf->prefetch = 1; +#endif + if (total_len > FSL_QDMA_CMD_SS_ERR050757_LEN) { + sdf->ssen = 1; + sdf->sss = FSL_QDMA_CMD_SS_ERR050757_LEN; + sdf->ssd = FSL_QDMA_CMD_SS_ERR050757_LEN; + } else { + sdf->ssen = 0; + sdf->sss = 0; + sdf->ssd = 0; + } } #endif ret = fsl_qdma_enqueue_desc_to_ring(fsl_queue, 1); @@ -875,6 +815,51 @@ fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) return 0; } +static int +fsl_qdma_enqueue_desc(struct fsl_qdma_queue *fsl_queue) +{ + uint16_t start = fsl_queue->pending_start; + int ret; + + ret = fsl_qdma_enqueue_overflow(fsl_queue); + if (unlikely(ret)) + return ret; + + if (fsl_queue->pending_num == 1) { + ret = fsl_qdma_enqueue_desc_single(fsl_queue, + fsl_queue->pending_desc[start].dst, + fsl_queue->pending_desc[start].src, + fsl_queue->pending_desc[start].len); + if (!ret) { + fsl_queue->pending_start = + (start + 1) & (fsl_queue->pending_max - 1); + fsl_queue->pending_num = 0; + } + return ret; + } else if (!s_sg_enable) { + while (fsl_queue->pending_num > 0) { + ret = fsl_qdma_enqueue_desc_single(fsl_queue, + fsl_queue->pending_desc[start].dst, + fsl_queue->pending_desc[start].src, + fsl_queue->pending_desc[start].len); + if (!ret) { + start = (start + 1) & + (fsl_queue->pending_max - 1); + fsl_queue->pending_start = start; + fsl_queue->pending_num--; + } else { + DPAA_QDMA_ERR("Eq pending desc failed(%d)", + ret); + return -EIO; + } + } + + return 0; + } + + return fsl_qdma_enqueue_desc_sg(fsl_queue); +} + static int dpaa_info_get(const struct rte_dma_dev *dev, struct rte_dma_info *dev_info, __rte_unused uint32_t info_sz) @@ -1276,6 +1261,7 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) int regs_size; int ret; uint32_t i, j, k; + char *penv; if (getenv("DPAA_QDMA_DATA_VALIDATION")) s_data_validation = 1; @@ -1283,8 +1269,15 @@ dpaa_qdma_init(struct rte_dma_dev *dmadev) if (getenv("DPAA_QDMA_HW_ERR_CHECK")) s_hw_err_check = 1; - if (getenv("DPAA_QDMA_SG_DISABLE")) - s_sg_disable = 1; + penv = getenv("DPAA_QDMA_SG_ENABLE"); + if (penv) + s_sg_enable = atoi(penv); + +#ifdef RTE_DMA_DPAA_ERRATA_ERR050757 + penv = getenv("DPAA_QDMA_PCI_READ"); + if (penv) + s_pci_read = atoi(penv); +#endif fsl_qdma->n_queues = QDMA_QUEUES * QDMA_BLOCKS; fsl_qdma->num_blocks = QDMA_BLOCKS; diff --git a/drivers/dma/dpaa/dpaa_qdma.h b/drivers/dma/dpaa/dpaa_qdma.h index f4535af3dd..906d452d48 100644 --- a/drivers/dma/dpaa/dpaa_qdma.h +++ b/drivers/dma/dpaa/dpaa_qdma.h @@ -88,9 +88,7 @@ #define FSL_QDMA_CMD_RWTTYPE 0x4 #define FSL_QDMA_CMD_LWC 0x2 -#define FSL_QDMA_CFG_SSS_OFFSET 12 -#define FSL_QDMA_CMD_SSS_STRIDE 128 -#define FSL_QDMA_CMD_SSS_DISTANCE 128 +#define FSL_QDMA_CMD_SS_ERR050757_LEN 128 /* qdma engine attribute */ #define QDMA_QUEUE_SIZE FSL_QDMA_CIRCULAR_DESC_SIZE_MIN @@ -192,8 +190,10 @@ struct fsl_qdma_cmpd_ft { uint64_t cache_align[2]; struct fsl_qdma_comp_sg_desc desc_ssge[FSL_QDMA_SG_MAX_ENTRY]; struct fsl_qdma_comp_sg_desc desc_dsge[FSL_QDMA_SG_MAX_ENTRY]; + struct fsl_qdma_df df; uint64_t phy_ssge; uint64_t phy_dsge; + uint64_t phy_df; } __rte_packed; #define FSL_QDMA_ERR_REG_STATUS_OFFSET 0xe00 @@ -273,7 +273,6 @@ struct fsl_qdma_queue { uint8_t pending_num; uint16_t complete_start; dma_addr_t bus_addr; - struct fsl_qdma_df **df; void *engine; }; -- 2.25.1