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 0812C45ADF; Tue, 8 Oct 2024 09:23:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5BAE40677; Tue, 8 Oct 2024 09:23:27 +0200 (CEST) Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011045.outbound.protection.outlook.com [52.101.65.45]) by mails.dpdk.org (Postfix) with ESMTP id E44DD40669 for ; Tue, 8 Oct 2024 09:23:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Dmae4u3MVLt2/1n6d3L/VuzaxsGQ0VHslk8QVZBp0eJPMK3UXOAyYU6PGrMG5czxWMBIwC0WoPkfUOXbPXDg+7GOA3ahiXo6vgjm2NEsh6CUYobb9MIvqg55N5V2rCvNZcn5JzVEldRwj1e3q17qoleJcYug9y+XaSTSH2VY3+bWzPeM6fT4wmeyBG4hKEmONGbFURYeTXQJpCJg1WBZaIaJSa4E38cPLhrF9hgikHgMLnXf2d2YKil/DcM4v1+HEd+AbfGQycGhGmqWdnXhSQHsLms2Hn03MKS7N5SvrClvDbvjXal4OdoTcWzXelxoCw3g1gbeSkW0yGjn9aN4dA== 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=vNq5hOvzNRxKNSZDIobDNeWoRIZjyVF4AqEbGkQttmA=; b=VtkW/k/jNiM2YuksbSrsMFqFLHEwHQPzc6mn+nZwUSk387K+0+onLQCb4wdkr56rFlBCTYDlS1BjVFmzglfpTGrHRIC2b/4wvdjb6P3sAz0AJJ0QG4SyRxNjSatug+LvDD3dWei3y59nG52olCTPy2tUCfRW5zfoU9SjGQ3ffIRqpuiBDk3HSRO/g8e2zk15z/N3GpmyE/p1/aNa7Ii7Ribihrcaxwmotpnxqvnu/zH7l4SGOp+5EYOhLQzCofOgkiFosohkSi7WKKlerF10hkBIqIkibtLTH+DIj3U2lRsRq055zONn5ArzxpURnWEsqQthVZui7tqsLuMG5QW2rQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vNq5hOvzNRxKNSZDIobDNeWoRIZjyVF4AqEbGkQttmA=; b=F3qjPMjfSAi/p4BvkZi+W60MwFoelsUtmej9cfG1QAjko3WEeN1RVlpbg07+w1WLQ8gsOuiWKDnglTvFQg/MJ4VMPGRdiShUs97h/2MDt/GUE3HVEAhhkhE0SW+Iddl13wa6j6za+kil7T9YiD1w0m1TRq3DMrtWrDR7zJrL8m67ivDSoHQNBmxL/JQ0GTyqyr2tgoRA/wCuk6r1PIOmjwRMvJReAmha4ccEY13p2MCsEhEaBGCozPqZQduFcFV1g0eQo8MOIi093iAo4OLUzCE/B2cmNovv8Z2kaHdG7bmZWo6E8Sh7fn94MXAyxEulIWHEci3l2LvrE+C7R1Kwjg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by DU0PR04MB9346.eurprd04.prod.outlook.com (2603:10a6:10:356::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Tue, 8 Oct 2024 07:23:24 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8026.020; Tue, 8 Oct 2024 07:23:24 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [v4 01/15] dma/dpaa2: configure route by port by PCIe port param Date: Tue, 8 Oct 2024 12:52:52 +0530 Message-Id: <20241008072306.1256445-2-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241008072306.1256445-1-g.singh@nxp.com> References: <20240722163930.2171568-2-g.singh@nxp.com> <20241008072306.1256445-1-g.singh@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0221.apcprd06.prod.outlook.com (2603:1096:4:68::29) To AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8198:EE_|DU0PR04MB9346:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b5a5644-990f-4513-54e7-08dce76a1812 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?H66Y7/8g6GQYCP2XULKgkKjlIbu9fZ2FCGU/zT92DO18sqxm7JNUsokEudo7?= =?us-ascii?Q?cB6TdtX2HjZ1K0vAe38yosNSeVLlgbaPIki/cjxw/06bH9EnHKmMdaUqwy0A?= =?us-ascii?Q?LRs3cy1f2jez07Npg8pj3vBzit/4xofsDm58a6AmR1pCDw2AgvStZ6+wKKHw?= =?us-ascii?Q?t3MPj8cx1aUCPTzrh4Zp8+dSk+2H/4ZSV7ZPGWgtkgLK1NsH1WAcG3F0r0r7?= =?us-ascii?Q?EGTOF85Bor/8xfh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Teu?= =?us-ascii?Q?DYhmbsctlZ1PYM0r8K4wY9ycE7w30LZoqcQj8KM7EYPwyStORL+UFTFoF3Mu?= =?us-ascii?Q?BNvjDZWCcybL8P/jE4zc7+Z5u0IPs+q10ZcScty7rF6egIXiUXK2n93JyCU3?= =?us-ascii?Q?t3MePaB1aMuDsg0mdHfBmteA2kgP6vvlvr2dU70jWRsczC0Da/jDyjT0fTv0?= =?us-ascii?Q?PBux2e3JPuka5kjesKrKYvtbQeB732UxTcJEPJzrfO9N0A=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hACb7Uaq4JSHWeMp7pMH5AgG6AJOzoFyc1s9C8YbLJDCOibeglEXXTj13RTD?= =?us-ascii?Q?DUZzzrWDesFf8m4jHARe78V3aJOiUQfo8z02f1vjs7HvhD9gerG6KCR5ljoi?= =?us-ascii?Q?vJvFWNO05rW4wk7vCgMNsnoyEUrnAX4Dj9M4Ch+WaCZcLhhXjIB8/ZswllyU?= =?us-ascii?Q?65I37Zq52aH98JPBPWpLPfoWRK+G3MLsjcTtC2V3VPw3nTlv9mg/xccjjnfA?= =?us-ascii?Q?x0+jltibJ6sJQgljCIc/eo/YBaI6tPQsuUzwXC+j836qUy8rIa62IK9s5Mcr?= =?us-ascii?Q?ZkauW12c6PAkLGIZMshdqc8kqxUNyFfnLHObDqZ0K4ykCTGRMhARulm2/TJk?= =?us-ascii?Q?7ndtdfYYyt6OvLz3YjVZGB/MbNGFSl20fnS7eYwDTW418H4xXUuI7e1w6gOY?= =?us-ascii?Q?q+Pi8jn1c7+Zw+r6ZKJOCGB3sBPumVvUOUbu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UlpC41FoxtGsXHaQltQTuDzSAYT8CF77U/doMCMvfmZFTMoaqKipvnS9?= =?us-ascii?Q?x1tn77r9ktYDMAl1m4kKmVue17NA48H8iOx1PKANJLEi16qWwE8tPSskWvFl?= =?us-ascii?Q?zHfv3OwfKkEqn8aErJ7fJ/9vuAQfIYxbXnCUcnqvLe11awl99DxVuOMGQa+u?= =?us-ascii?Q?0rRnreE2VLmSDcQmsQADLkOywzEesbMR0w6xSxbgfHd/8phVqF9KtaZlkYTY?= =?us-ascii?Q?J7o7VJsYK8P0/ghRHE0=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b5a5644-990f-4513-54e7-08dce76a1812 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2024 07:23:23.9517 (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: nN77zB7uYLmR4CB9bap/RiWgwTZEQZH9nUoqzQeo3cXUXIbPOqY80XDHBDbKRWr4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9346 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 struct { uint64_t coreid : 4; /**--rbp.sportid / rbp.dportid*/ uint64_t pfid : 8; /**--rbp.spfid / rbp.dpfid*/ uint64_t vfen : 1; /**--rbp.svfa / rbp.dvfa*/ uint64_t vfid : 16; /**--rbp.svfid / rbp.dvfid*/ ..... } pcie; Signed-off-by: Jun Yang --- .../bus/fslmc/qbman/include/fsl_qbman_base.h | 29 ++++++--- drivers/dma/dpaa2/dpaa2_qdma.c | 59 +++++++++++++------ drivers/dma/dpaa2/dpaa2_qdma.h | 38 +++++++++++- drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 55 +---------------- drivers/dma/dpaa2/version.map | 1 - 5 files changed, 100 insertions(+), 82 deletions(-) diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h index 48ffb1b46e..7528b610e1 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 2014 Freescale Semiconductor, Inc. - * Copyright 2017-2019 NXP + * Copyright 2017-2024 NXP * */ #ifndef _FSL_QBMAN_BASE_H @@ -141,12 +141,23 @@ struct qbman_fd { uint32_t saddr_hi; uint32_t len_sl:18; - uint32_t rsv1:14; - + uint32_t rsv13:2; + uint32_t svfid:6; + uint32_t rsv12:2; + uint32_t spfid:2; + uint32_t rsv1:2; uint32_t sportid:4; - uint32_t rsv2:22; + uint32_t rsv2:1; + uint32_t sca:1; + uint32_t sat:2; + uint32_t sattr:3; + uint32_t svfa:1; + uint32_t stc:3; uint32_t bmt:1; - uint32_t rsv3:1; + uint32_t dvfid:6; + uint32_t rsv3:2; + uint32_t dpfid:2; + uint32_t rsv31:2; uint32_t fmt:2; uint32_t sl:1; uint32_t rsv4:1; @@ -154,12 +165,14 @@ struct qbman_fd { uint32_t acc_err:4; uint32_t rsv5:4; uint32_t ser:1; - uint32_t rsv6:3; + uint32_t rsv6:2; + uint32_t wns:1; uint32_t wrttype:4; uint32_t dqos:3; uint32_t drbp:1; uint32_t dlwc:2; - uint32_t rsv7:2; + uint32_t rsv7:1; + uint32_t rns:1; uint32_t rdttype:4; uint32_t sqos:3; uint32_t srbp:1; @@ -182,7 +195,7 @@ struct qbman_fd { uint32_t saddr_lo; uint32_t saddr_hi:17; - uint32_t rsv1:15; + uint32_t rsv1_att:15; uint32_t len; diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 5780e49297..5d4749eae3 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -22,7 +22,7 @@ uint32_t dpaa2_coherent_alloc_cache; static inline int qdma_populate_fd_pci(phys_addr_t src, phys_addr_t dest, uint32_t len, struct qbman_fd *fd, - struct rte_dpaa2_qdma_rbp *rbp, int ser) + struct dpaa2_qdma_rbp *rbp, int ser) { fd->simple_pci.saddr_lo = lower_32_bits((uint64_t) (src)); fd->simple_pci.saddr_hi = upper_32_bits((uint64_t) (src)); @@ -93,7 +93,7 @@ qdma_populate_fd_ddr(phys_addr_t src, phys_addr_t dest, static void dpaa2_qdma_populate_fle(struct qbman_fle *fle, uint64_t fle_iova, - struct rte_dpaa2_qdma_rbp *rbp, + struct dpaa2_qdma_rbp *rbp, uint64_t src, uint64_t dest, size_t len, uint32_t flags, uint32_t fmt) { @@ -114,7 +114,6 @@ dpaa2_qdma_populate_fle(struct qbman_fle *fle, /* source */ sdd->read_cmd.portid = rbp->sportid; sdd->rbpcmd_simple.pfid = rbp->spfid; - sdd->rbpcmd_simple.vfa = rbp->vfa; sdd->rbpcmd_simple.vfid = rbp->svfid; if (rbp->srbp) { @@ -127,7 +126,6 @@ dpaa2_qdma_populate_fle(struct qbman_fle *fle, /* destination */ sdd->write_cmd.portid = rbp->dportid; sdd->rbpcmd_simple.pfid = rbp->dpfid; - sdd->rbpcmd_simple.vfa = rbp->vfa; sdd->rbpcmd_simple.vfid = rbp->dvfid; if (rbp->drbp) { @@ -178,7 +176,7 @@ dpdmai_dev_set_fd_us(struct qdma_virt_queue *qdma_vq, struct rte_dpaa2_qdma_job **job, uint16_t nb_jobs) { - struct rte_dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; + struct dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; struct rte_dpaa2_qdma_job **ppjob; size_t iova; int ret = 0, loop; @@ -276,7 +274,7 @@ dpdmai_dev_set_multi_fd_lf_no_rsp(struct qdma_virt_queue *qdma_vq, struct rte_dpaa2_qdma_job **job, uint16_t nb_jobs) { - struct rte_dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; + struct dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; struct rte_dpaa2_qdma_job **ppjob; uint16_t i; void *elem; @@ -322,7 +320,7 @@ dpdmai_dev_set_multi_fd_lf(struct qdma_virt_queue *qdma_vq, struct rte_dpaa2_qdma_job **job, uint16_t nb_jobs) { - struct rte_dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; + struct dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; struct rte_dpaa2_qdma_job **ppjob; uint16_t i; int ret; @@ -375,7 +373,7 @@ dpdmai_dev_set_sg_fd_lf(struct qdma_virt_queue *qdma_vq, struct rte_dpaa2_qdma_job **job, uint16_t nb_jobs) { - struct rte_dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; + struct dpaa2_qdma_rbp *rbp = &qdma_vq->rbp; struct rte_dpaa2_qdma_job **ppjob; void *elem; struct qbman_fle *fle; @@ -1223,17 +1221,38 @@ rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan) qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SG_FORMAT; } -/* Enable RBP */ -void -rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, - struct rte_dpaa2_qdma_rbp *rbp_config) +static int +dpaa2_qdma_vchan_rbp_set(struct qdma_virt_queue *vq, + const struct rte_dma_vchan_conf *conf) { - struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; - struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; - struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + if (conf->direction == RTE_DMA_DIR_MEM_TO_DEV || + conf->direction == RTE_DMA_DIR_DEV_TO_DEV) { + if (conf->dst_port.port_type != RTE_DMA_PORT_PCIE) + return -EINVAL; + vq->rbp.enable = 1; + vq->rbp.dportid = conf->dst_port.pcie.coreid; + vq->rbp.dpfid = conf->dst_port.pcie.pfid; + if (conf->dst_port.pcie.vfen) { + vq->rbp.dvfa = 1; + vq->rbp.dvfid = conf->dst_port.pcie.vfid; + } + vq->rbp.drbp = 1; + } + if (conf->direction == RTE_DMA_DIR_DEV_TO_MEM || + conf->direction == RTE_DMA_DIR_DEV_TO_DEV) { + if (conf->src_port.port_type != RTE_DMA_PORT_PCIE) + return -EINVAL; + vq->rbp.enable = 1; + vq->rbp.sportid = conf->src_port.pcie.coreid; + vq->rbp.spfid = conf->src_port.pcie.pfid; + if (conf->src_port.pcie.vfen) { + vq->rbp.svfa = 1; + vq->rbp.dvfid = conf->src_port.pcie.vfid; + } + vq->rbp.srbp = 1; + } - memcpy(&qdma_dev->vqs[vchan].rbp, rbp_config, - sizeof(struct rte_dpaa2_qdma_rbp)); + return 0; } static int @@ -1247,12 +1266,16 @@ dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, char ring_name[32]; char pool_name[64]; int fd_long_format = 1; - int sg_enable = 0; + int sg_enable = 0, ret; DPAA2_QDMA_FUNC_TRACE(); RTE_SET_USED(conf_sz); + ret = dpaa2_qdma_vchan_rbp_set(&qdma_dev->vqs[vchan], conf); + if (ret) + return ret; + if (qdma_dev->vqs[vchan].flags & DPAA2_QDMA_VQ_FD_SG_FORMAT) sg_enable = 1; diff --git a/drivers/dma/dpaa2/dpaa2_qdma.h b/drivers/dma/dpaa2/dpaa2_qdma.h index 5941b5a5d3..811906fcbc 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.h +++ b/drivers/dma/dpaa2/dpaa2_qdma.h @@ -166,6 +166,42 @@ struct qdma_sg_entry { }; } __rte_packed; +struct dpaa2_qdma_rbp { + uint32_t use_ultrashort:1; + uint32_t enable:1; + /** + * dportid: + * 0000 PCI-Express 1 + * 0001 PCI-Express 2 + * 0010 PCI-Express 3 + * 0011 PCI-Express 4 + * 0100 PCI-Express 5 + * 0101 PCI-Express 6 + */ + uint32_t dportid:4; + uint32_t dpfid:2; + uint32_t dvfid:6; + uint32_t dvfa:1; + /*using route by port for destination */ + uint32_t drbp:1; + /** + * sportid: + * 0000 PCI-Express 1 + * 0001 PCI-Express 2 + * 0010 PCI-Express 3 + * 0011 PCI-Express 4 + * 0100 PCI-Express 5 + * 0101 PCI-Express 6 + */ + uint32_t sportid:4; + uint32_t spfid:2; + uint32_t svfid:6; + uint32_t svfa:1; + /* using route by port for source */ + uint32_t srbp:1; + uint32_t rsv:2; +}; + /** Represents a DPDMAI device */ struct dpaa2_dpdmai_dev { /** Pointer to Next device instance */ @@ -216,7 +252,7 @@ struct qdma_virt_queue { /** FLE pool for the queue */ struct rte_mempool *fle_pool; /** Route by port */ - struct rte_dpaa2_qdma_rbp rbp; + struct dpaa2_qdma_rbp rbp; /** States if this vq is in use or not */ uint8_t in_use; /** States if this vq has exclusively associated hw queue */ diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h index 5a8da46d12..b0bf9d8bcc 100644 --- a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h +++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h @@ -13,42 +13,6 @@ /** States if the destination addresses is physical. */ #define RTE_DPAA2_QDMA_JOB_DEST_PHY (1ULL << 31) -struct rte_dpaa2_qdma_rbp { - uint32_t use_ultrashort:1; - uint32_t enable:1; - /** - * dportid: - * 0000 PCI-Express 1 - * 0001 PCI-Express 2 - * 0010 PCI-Express 3 - * 0011 PCI-Express 4 - * 0100 PCI-Express 5 - * 0101 PCI-Express 6 - */ - uint32_t dportid:4; - uint32_t dpfid:2; - uint32_t dvfid:6; - /*using route by port for destination */ - uint32_t drbp:1; - /** - * sportid: - * 0000 PCI-Express 1 - * 0001 PCI-Express 2 - * 0010 PCI-Express 3 - * 0011 PCI-Express 4 - * 0100 PCI-Express 5 - * 0101 PCI-Express 6 - */ - uint32_t sportid:4; - uint32_t spfid:2; - uint32_t svfid:6; - /* using route by port for source */ - uint32_t srbp:1; - /* Virtual Function Active */ - uint32_t vfa:1; - uint32_t rsv:3; -}; - /** Determines a QDMA job */ struct rte_dpaa2_qdma_job { /** Source Address from where DMA is (to be) performed */ @@ -67,6 +31,7 @@ struct rte_dpaa2_qdma_job { */ uint16_t status; uint16_t vq_id; + uint64_t cnxt; /** * FLE pool element maintained by user, in case no qDMA response. * Note: the address must be allocated from DPDK memory pool. @@ -104,24 +69,6 @@ void rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan); __rte_experimental void rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan); -/** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * - * Enable Route-by-port on a channel. This API should be - * called before calling 'rte_dma_vchan_setup()' API. - * - * @param dev_id - * The identifier of the device. - * @param vchan - * The identifier of virtual DMA channel. - * @param rbp_config - * Configuration for route-by-port - */ -__rte_experimental -void rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, - struct rte_dpaa2_qdma_rbp *rbp_config); - /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. diff --git a/drivers/dma/dpaa2/version.map b/drivers/dma/dpaa2/version.map index fc16517f7a..43e8b2d5c5 100644 --- a/drivers/dma/dpaa2/version.map +++ b/drivers/dma/dpaa2/version.map @@ -10,5 +10,4 @@ EXPERIMENTAL { rte_dpaa2_qdma_copy_multi; rte_dpaa2_qdma_vchan_fd_us_enable; rte_dpaa2_qdma_vchan_internal_sg_enable; - rte_dpaa2_qdma_vchan_rbp_enable; }; -- 2.25.1