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 6F0A54564F; Fri, 19 Jul 2024 12:01:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CDBA42E02; Fri, 19 Jul 2024 12:01:44 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010009.outbound.protection.outlook.com [52.101.69.9]) by mails.dpdk.org (Postfix) with ESMTP id 4B7A940E3A for ; Fri, 19 Jul 2024 12:01:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lkd8VRkjl7eM2xJrJdso1i5jwzvcRsn1MWsPyXhveUxkfm8RP+Avtgohl0tOt4x6RBYzu75AxTsOFfmdg4oFLGCzmcg50Mz6gquXg02/Kqn8RReDtIogSe9LwJy4YidSxZOr5qLBFXIt1tRlUZL/RT+293rw7CtI/uJK1VzMqsYvWqkJgjPApfED8DX2S/zMini14ZJpvp2TGFcVZIPaCE+FkWGSJ+3Jp1ALtx1bmrwVc5tg8VYBC2/km9nSjoKB30s0hF4wOyZoM5loX8S46PoBxwh6xsaKP1MebNZ4MwJlMUTyIDmCu85ymi+/NzP7U4eWpUNR9vGTmn3AeXBg/w== 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=hXnZiJaBAEiCBH8yHQp25Q6z6Y4zzznlqx/1ThPyJ60=; b=vcluIAXOKPL2JdVITze8w3S0uiYIyg3Ol7hRt2P47iBjYZ5W7b48INlpCZYiS76VyeuzHV74H8MnzsNx7/buJYhZTLnrSbTOmMqPo9/USbMFibG//I8GpzJkIoBK8WTkKgmPK/pXIGRi4vfymRM94pJQVRYMMHs54PV7eCIpDMHs2vPncw97KEadWIXyplUGghjUPQRTY0ATwz0COWAMHwSAhu2TKM3/JutwmyNhnP/5HTWizJC7X/1Cr2A6g4fsY4w9QlYc2zxVw9kozPd05LUaMOzTWBmYfRf4PKoeRqZ7FAU9RxiCwflR1EILBcYK54ieLALQSHnz3OXJG/jEUA== 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=hXnZiJaBAEiCBH8yHQp25Q6z6Y4zzznlqx/1ThPyJ60=; b=nyEzK+o6/ow3T9Q9Tq7+FKYrn5MfkK2CQr9KYHDD1xXuaTr4m9eHqX6Cf+QCQZBX/rts9lXYAWeajWsnQOsshYNzkddAiOnOX1ebNl6bhiQRrlprVyTt6wqiBziFVVj2f3b/XiGRxdGGFU02W+1FeWUzbl3qSJsRdw4u8u63zLk= 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 AS8PR04MB7815.eurprd04.prod.outlook.com (2603:10a6:20b:28a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 19 Jul 2024 10:01:41 +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:01:41 +0000 From: Gagandeep Singh To: dev@dpdk.org, Hemant Agrawal , Sachin Saxena Cc: Jun Yang Subject: [PATCH 01/30] dma/dpaa2: configure route by port by PCIe port param Date: Fri, 19 Jul 2024 15:30:57 +0530 Message-Id: <20240719100126.1150373-1-g.singh@nxp.com> X-Mailer: git-send-email 2.25.1 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_|AS8PR04MB7815:EE_ X-MS-Office365-Filtering-Correlation-Id: ff75cd50-4562-4b1a-0664-08dca7d9c988 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?oF3URujuR5nzhDfNE5rzYwMVMwHR4AXUUNvZrKMRUUa3FOdbFDb9/mjwf04e?= =?us-ascii?Q?H/hLUiQD9j5XMHaYv0wSbzhdsYqqtmUmjO1O2j06aCCnaJh5M1PMcPzhyjZL?= =?us-ascii?Q?Jz0HwQUzMPcpmgLJErLHqY/2aY0Mn7uof0lYNGfZ3F/aSyEOqzENMM/WZcDI?= =?us-ascii?Q?+y+IbH7kBPlQHCC/UCsjb4ms+IxfKM0MVSe1U0EQOt/mt3Xn7C2v1A2lCW5u?= =?us-ascii?Q?xeo2tip3fY7J5cdrygAbZJA+C7qtwoQAyfv8RYe6tAPqEWrjXPLs3CGcmIJV?= =?us-ascii?Q?iLJ0dPjwhjgwQlp1kDehnCjLvw477qda0Ky5MP3Gki63r4lnDYohQi578qz+?= =?us-ascii?Q?o4b3ox0C/YI3LAcjRonG0jpFyeve4rxq31+VBglq3kTEh8+jky9SBQIiarPY?= =?us-ascii?Q?s8Xz6GqtxARLOfqB6Jk2nI0SMWvD3UbUbjc80I2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Z/5ogMoftyJvgGtXSv5Bx/ZIcApsLjj9TFVxydn++3PQ7DnNOvvxYdxDQnO0?= =?us-ascii?Q?Sqjxq7GfcLBEuXtG49z8/bdvHQSFii21SlakIR7eeGSQSMlTgg=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?zd6EnDymC38QBiHEmQyo0JkZtiNdFQchr5fsur44j8mJCchPsXyiq3sLldcP?= =?us-ascii?Q?5NzlSHSYeM8ytMV9Ujob6anX1xhZMizJ8pUaidTFsd0WqB5veN9uamh/1WGD?= =?us-ascii?Q?sP3Y/vOBWlfBs3UxCSuP/mznzRlipSgUYZQhBvzlyWMZisyOeAm0NYk07BjT?= =?us-ascii?Q?g2uY3QArK1SJyvF5CGg89/0Ye3frQB3KSl8vMwFPpfp3h871HoAmwO+uAetO?= =?us-ascii?Q?oGA1zyuZKpQ7sTznuKrM0I8B/rvXrqUnXsEv3tapKDzDEuOsTuL6mqXB/hrZ?= =?us-ascii?Q?RSY6CaAn8C+wvlusaS6V2J8LnCSDu6wlYzYdV4xIZMzrowrHXQ2xUhLY4psC?= =?us-ascii?Q?R5jHLOHi6ppf5HU98wz3IEUFfMBCJXmXPS5r+D7Wc+wApuraRQwg7b3EBazT?= =?us-ascii?Q?gSF6yL5M7rneHRgZmHxMlBVRslrrTlTCnPq9y+RRV/oyxxvLfbS5xJyGKkWt?= =?us-ascii?Q?7I19emtb87s40D0BRUYAPjp+knXB50waHmhAkSKMDE50D8luJPCGU/e7BNm+?= =?us-ascii?Q?Xk0m2Z/QoWx2PAM3EGeYlO/etMwYIAPxAfTWx+bGJBGWA26jUh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3ujiGxPUwK1afJiXFKHQ72kHbjZvkpLBXb87?= =?us-ascii?Q?YdI29YNnNFl5KIsvQ+7ZJVu4/Ylrkfs9VlYqnUL8m94VpM7a/LmivSJHV/sY?= =?us-ascii?Q?FOjbKtCYZfyb1ZL7p4o=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff75cd50-4562-4b1a-0664-08dca7d9c988 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:01:41.3903 (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: XgDhqitFRi3Oh6PgXFyxVQPmPXWAVI64zDcgLHnW9ALLDPkxc48RtC/ylH9D0WIU X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7815 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 2c91ceec13..5954b552b5 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 713ed41f0c..eb012cfbfc 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