From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40078.outbound.protection.outlook.com [40.107.4.78]) by dpdk.org (Postfix) with ESMTP id C18F13772 for ; Mon, 17 Sep 2018 12:37:49 +0200 (CEST) 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=5355CFCriD4KFGZD/th/+GxjqwFXTENs7xFaynLry6A=; b=SluqrbV4dGBEQlnFod040YGRkiooO/vphWNTv6YFb39Q62azVE/73Y41/0lh2jUoD4sQ14TlBLxOZ8Z17P3VM8xQbzcBiCUA/VZdsB6RyQJd8xP+94Tlpstcs6AKUKdVMmOwJHaPulxkuZHEw0tdV6URhufzXaYi4TvgzWC30es= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Mon, 17 Sep 2018 10:37:48 +0000 From: Shreyansh Jain To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Hemant Agrawal Date: Mon, 17 Sep 2018 16:06:22 +0530 Message-Id: <20180917103631.32304-3-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180917103631.32304-1-shreyansh.jain@nxp.com> References: <20180917103631.32304-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0092.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::32) To AM0PR04MB4673.eurprd04.prod.outlook.com (2603:10a6:208:75::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf9f8b22-c2c9-4af8-fd13-08d61c899ce7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB4673; X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 3:ziJFTvk7bHbxyUrnkkZ1RzWEWIJYuHdlDVcSWyFCn7hlJYxYvXsvS5FVmJwN6FKlS+WRur0Gtt74Qvm+O6tmNCFu6Q1fUytJ0aRzCvj4AtToBx6/IMZf81n09LfBZjcl3GsCu2Q1nXqug9pr5PV/GU+VlZ1aN1THtT09SH9X6zKKObrfQNPfxRhOpY9aTJH5/PlvHeP6X+ilIP7/L7PFei+t2TPzePEMmymC9mjHKKWJOCY1V9kNXby9wKVQWhbc; 25:vmT5ZSRHxKQPWMlCPhas3gnKj1VgJ3gkdiCgrxKP8lp+XoFfqm+52+htpH1oanrZzC5McJQru9Os8kYIMUVTVchuexP/X1Yj1p6RByT0iYwJCANuqLwUj2A5fj8d7+thZQeNQQ2w9L/g+mogYFHKcEXEv7sXAZPs0PS0X9M8z/e8ynNiUE2wlzKTKXx+0dddA7FiCFN+KWqniJWpN1S20jof/YIhZ3KEFheQtw3brqmAlmVkSHbGccSkfaSyrsA5wb0Le7kOsesTHRMzk9dly0uMOqyrbSBD4pHRKXMslVtm8X2VdSLoa5AoCrsXR9wHd7lUUxeJezYdHq2iiQi9zg==; 31:tpACQCScQ2qiWRjr1aquDVnF7/othTJ+Ihhd4ZfiaIUjvYP/ziqn7q7tSdAYldoDbSR41Yxligo3T5LpXpKYkmHSnWU9KEsWamI/s3dznmFrxHxZYKDlkp1xTMODBMvWWcE4X3WnZGE/nwgQGp9cerN3Md2VbztfQp1lioh0jE25aTS54UcRT98sGYswOcFz4Kmw/vWdRxc9yxertFafr3zhS/LsOKmPUHOneqnkK8g= X-MS-TrafficTypeDiagnostic: AM0PR04MB4673: X-Microsoft-Exchange-Diagnostics: 1; AM0PR04MB4673; 20:VCb2kPnSdkxi4DZ3KLkw24iuoLXVuVErmbD4M9Btc3RrbH2q3X9XW2Xd3UW0Ylo2Wx0YTqZOCDa2lRKYrV46efQvk7tMs53sapNLvkKB1n0AlW3EhMDtHFdTwbKINCX8OOHo6buDbxjq/BFUfKpkc34niB4//MshnwBcat0eGi4/idXa50+M8ifNSrk1hel+AEKStAYtIj7F11d4N1Ow8IDaaZrMvuaZmgrlfwEpDm79o976Cce7+PnxPm6jJ26q+c/iyDvW3BPEr4ssk8cxwBs6SznnqOo0b/L4Nclzhl2JfLQfe8t+i8eQf+GSYVhal7hpEt7jEdNxZ4K1XB7y+bD45FA6OIqTZE0IuGR1Z3GRbOGJuztdKj3TxYuBugAYWnQ549xzyJ5yuaBiRBptmBK1SxTvuKzOgfSVIi7uf/bikh+p+qQNz5EzOlv8nPPMHW4vPYyHCVPFtxr5srkF2nNfW9mUGk0spnqmo3fJ39eSG40Cyi4/0JNcHRCwUmio; 4:gPjsaUBZXnYPK8VHEi5pQHWdERHq/641DDk+63jj0lSjQkjO29uWvuQamoZvBRpCRi7VnIjs613gvmijjLarbrSq4Ljx23djuqElQkbY22BbckILoNW94LsdZigUFUXXQRJ2uInMzf6xYCLTIfcM1AEKUxyU2l/Hk5bG6AcTyzyIxXwFROIpTEUYIVYIYGhu+95Wwu1n2sB12LpzWO938wqzid4CSBaT/VXWtAv9FNDjAyvvW1HMyq7zQJ4FRHdPq4UBaoUqe1zF2zW3srGKHGIZ1Z0hcti9hiomBrHBdyqFxhY3Od1EO3mQz6CYezLfjGVm4xJlHdq+eyUx81+hYsJ5bHuxoNods2V/VxytlWY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:AM0PR04MB4673; BCL:0; PCL:0; RULEID:; SRVR:AM0PR04MB4673; X-Forefront-PRVS: 0798146F16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(346002)(366004)(376002)(39860400002)(199004)(189003)(16526019)(48376002)(186003)(1076002)(3846002)(5660300001)(486006)(6506007)(386003)(16586007)(316002)(36756003)(14444005)(44832011)(5009440100003)(52116002)(6116002)(2616005)(76176011)(446003)(51416003)(11346002)(956004)(476003)(6512007)(47776003)(106356001)(25786009)(50226002)(2906002)(68736007)(105586002)(81156014)(81166006)(7736002)(6666003)(305945005)(8676002)(8936002)(4326008)(575784001)(86362001)(97736004)(6486002)(478600001)(50466002)(66066001)(26005)(53936002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB4673; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR04MB4673; 23:IP2IixaVIHRKAFJMS8uqvSxLBahGKT9y/paq925/W?= =?us-ascii?Q?1trTwTWibz2xyehbwlJuRow52wSO2WsSTxSJUr6Yj1ifmF+VJyr5Clo6SPZl?= =?us-ascii?Q?KCUswK8lslOta2KWNas3giw1hizLYJMqyVZoniUZc9tXujXuXOg/aACtKneD?= =?us-ascii?Q?6CyzMsxgWBeuBa6+qGCwxjQB9dlnNsdWQ8aZTRq5jCilMoIgCPOwU4mGOij4?= =?us-ascii?Q?nihrIsD8Qzdc3ThiW8fHq/3Z1qacMagsF/udfaDWAvwD8T1mZ+psf3QJxZbc?= =?us-ascii?Q?j8I6B5luCCaX7We8/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+BLOWIAl6WWWgKegn0cWAvG/7ukrRNdylKJFIbh+30i2gO7bOEUyotXkmf4SE61uKoJ1eFPfG+SSDmd/yPDe1Mhj3wPkcI5Q1GXYN8FlQJnJzn2viDaDRQbKLxzBMFi1QuSxXyEvmIPPtYKiDhp1TvNpU3tkY=; 7:EyJ0mqMEmYin7n5Php8Ubqg7/R3pTzY7f7jDX6lXfJ775sOHkIv4LFHxEUnFKtk+VUmEJf9QaKB8qTlqQfBwlOTY4U4aKoYnBISBtzYow+vF6bcIEyvwWpLy60nDITQhL0ijLg+lmUlBGs/FqQn6O5foxSqmrnpp1+UiDEjCVyAu7l2kF8L5p0Nv1WRU1jtWRJV4Yhbw+inxa8sCU+u9H0+ao4664BQYO0CNIZ71xOYbeRYEm99KV7H5+WfElIIp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2018 10:37:48.0706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf9f8b22-c2c9-4af8-fd13-08d61c899ce7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4673 Subject: [dpdk-dev] [PATCH 02/11] bus/fslmc: upgrade qdma mc FW APIs to 10.10.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 10:37:50 -0000 From: Hemant Agrawal Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/mc/dpdmai.c | 14 ++++++++++++++ drivers/bus/fslmc/mc/fsl_dpdmai.h | 5 +++++ drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h | 21 +++++++++++++-------- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 14 +++++++------- drivers/raw/dpaa2_qdma/dpaa2_qdma.h | 6 ++++-- 5 files changed, 43 insertions(+), 17 deletions(-) diff --git a/drivers/bus/fslmc/mc/dpdmai.c b/drivers/bus/fslmc/mc/dpdmai.c index 528889df3..dcb9d516a 100644 --- a/drivers/bus/fslmc/mc/dpdmai.c +++ b/drivers/bus/fslmc/mc/dpdmai.c @@ -113,6 +113,7 @@ int dpdmai_create(struct fsl_mc_io *mc_io, cmd_flags, dprc_token); cmd_params = (struct dpdmai_cmd_create *)cmd.params; + cmd_params->num_queues = cfg->num_queues; cmd_params->priorities[0] = cfg->priorities[0]; cmd_params->priorities[1] = cfg->priorities[1]; @@ -297,6 +298,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, rsp_params = (struct dpdmai_rsp_get_attr *)cmd.params; attr->id = le32_to_cpu(rsp_params->id); attr->num_of_priorities = rsp_params->num_of_priorities; + attr->num_of_queues = rsp_params->num_of_queues; return 0; } @@ -306,6 +308,8 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Rx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation; use * DPDMAI_ALL_QUEUES to configure all Rx queues @@ -317,6 +321,7 @@ int dpdmai_get_attributes(struct fsl_mc_io *mc_io, int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, const struct dpdmai_rx_queue_cfg *cfg) { @@ -331,6 +336,7 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, cmd_params->dest_id = cpu_to_le32(cfg->dest_cfg.dest_id); cmd_params->dest_priority = cfg->dest_cfg.priority; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; cmd_params->user_ctx = cpu_to_le64(cfg->user_ctx); cmd_params->options = cpu_to_le32(cfg->options); dpdmai_set_field(cmd_params->dest_type, @@ -346,6 +352,8 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Rx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation * @attr: Returned Rx queue attributes @@ -355,6 +363,7 @@ int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_rx_queue_attr *attr) { @@ -369,6 +378,7 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpdmai_cmd_get_queue *)cmd.params; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); @@ -392,6 +402,8 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, * @mc_io: Pointer to MC portal's I/O object * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_' * @token: Token of DPDMAI object + * @queue_idx: Tx queue index. Accepted values are form 0 to num_queues + * parameter provided in dpdmai_create * @priority: Select the queue relative to number of * priorities configured at DPDMAI creation * @attr: Returned Tx queue attributes @@ -401,6 +413,7 @@ int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_tx_queue_attr *attr) { @@ -415,6 +428,7 @@ int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpdmai_cmd_get_queue *)cmd.params; cmd_params->priority = priority; + cmd_params->queue_idx = queue_idx; /* send command to mc*/ err = mc_send_command(mc_io, &cmd); diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai.h b/drivers/bus/fslmc/mc/fsl_dpdmai.h index 03e46ec14..40469cc13 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai.h @@ -39,6 +39,7 @@ int dpdmai_close(struct fsl_mc_io *mc_io, * should be configured with 0 */ struct dpdmai_cfg { + uint8_t num_queues; uint8_t priorities[DPDMAI_PRIO_NUM]; }; @@ -78,6 +79,7 @@ int dpdmai_reset(struct fsl_mc_io *mc_io, struct dpdmai_attr { int id; uint8_t num_of_priorities; + uint8_t num_of_queues; }; int dpdmai_get_attributes(struct fsl_mc_io *mc_io, @@ -149,6 +151,7 @@ struct dpdmai_rx_queue_cfg { int dpdmai_set_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, const struct dpdmai_rx_queue_cfg *cfg); @@ -168,6 +171,7 @@ struct dpdmai_rx_queue_attr { int dpdmai_get_rx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_rx_queue_attr *attr); @@ -183,6 +187,7 @@ struct dpdmai_tx_queue_attr { int dpdmai_get_tx_queue(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token, + uint8_t queue_idx, uint8_t priority, struct dpdmai_tx_queue_attr *attr); diff --git a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h index 618e19eae..6c3602c1c 100644 --- a/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h +++ b/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h @@ -7,30 +7,33 @@ /* DPDMAI Version */ #define DPDMAI_VER_MAJOR 3 -#define DPDMAI_VER_MINOR 2 +#define DPDMAI_VER_MINOR 3 /* Command versioning */ #define DPDMAI_CMD_BASE_VERSION 1 +#define DPDMAI_CMD_VERSION_2 2 #define DPDMAI_CMD_ID_OFFSET 4 #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION) +#define DPDMAI_CMD_V2(id) ((id << DPDMAI_CMD_ID_OFFSET) | \ + DPDMAI_CMD_VERSION_2) /* Command IDs */ #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x800) #define DPDMAI_CMDID_OPEN DPDMAI_CMD(0x80E) -#define DPDMAI_CMDID_CREATE DPDMAI_CMD(0x90E) +#define DPDMAI_CMDID_CREATE DPDMAI_CMD_V2(0x90E) #define DPDMAI_CMDID_DESTROY DPDMAI_CMD(0x98E) #define DPDMAI_CMDID_GET_API_VERSION DPDMAI_CMD(0xa0E) #define DPDMAI_CMDID_ENABLE DPDMAI_CMD(0x002) #define DPDMAI_CMDID_DISABLE DPDMAI_CMD(0x003) -#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD(0x004) +#define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD_V2(0x004) #define DPDMAI_CMDID_RESET DPDMAI_CMD(0x005) #define DPDMAI_CMDID_IS_ENABLED DPDMAI_CMD(0x006) -#define DPDMAI_CMDID_SET_RX_QUEUE DPDMAI_CMD(0x1A0) -#define DPDMAI_CMDID_GET_RX_QUEUE DPDMAI_CMD(0x1A1) -#define DPDMAI_CMDID_GET_TX_QUEUE DPDMAI_CMD(0x1A2) +#define DPDMAI_CMDID_SET_RX_QUEUE DPDMAI_CMD_V2(0x1A0) +#define DPDMAI_CMDID_GET_RX_QUEUE DPDMAI_CMD_V2(0x1A1) +#define DPDMAI_CMDID_GET_TX_QUEUE DPDMAI_CMD_V2(0x1A2) /* Macros for accessing command fields smaller than 1byte */ #define DPDMAI_MASK(field) \ @@ -47,7 +50,7 @@ struct dpdmai_cmd_open { }; struct dpdmai_cmd_create { - uint8_t pad; + uint8_t num_queues; uint8_t priorities[2]; }; @@ -66,6 +69,7 @@ struct dpdmai_rsp_is_enabled { struct dpdmai_rsp_get_attr { uint32_t id; uint8_t num_of_priorities; + uint8_t num_of_queues; }; #define DPDMAI_DEST_TYPE_SHIFT 0 @@ -77,7 +81,7 @@ struct dpdmai_cmd_set_rx_queue { uint8_t priority; /* from LSB: dest_type:4 */ uint8_t dest_type; - uint8_t pad; + uint8_t queue_idx; uint64_t user_ctx; uint32_t options; }; @@ -85,6 +89,7 @@ struct dpdmai_cmd_set_rx_queue { struct dpdmai_cmd_get_queue { uint8_t pad[5]; uint8_t priority; + uint8_t queue_idx; }; struct dpdmai_rsp_get_rx_queue { diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index 2787d3028..44503331e 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -805,7 +805,7 @@ dpaa2_dpdmai_dev_uninit(struct rte_rawdev *rawdev) DPAA2_QDMA_ERR("dmdmai disable failed"); /* Set up the DQRR storage for Rx */ - for (i = 0; i < DPDMAI_PRIO_NUM; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { struct dpaa2_queue *rxq = &(dpdmai_dev->rx_queue[i]); if (rxq->q_storage) { @@ -856,17 +856,17 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) ret); goto init_err; } - dpdmai_dev->num_queues = attr.num_of_priorities; + dpdmai_dev->num_queues = attr.num_of_queues; /* Set up Rx Queues */ - for (i = 0; i < attr.num_of_priorities; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { struct dpaa2_queue *rxq; memset(&rx_queue_cfg, 0, sizeof(struct dpdmai_rx_queue_cfg)); ret = dpdmai_set_rx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, dpdmai_dev->token, - i, &rx_queue_cfg); + i, 0, &rx_queue_cfg); if (ret) { DPAA2_QDMA_ERR("Setting Rx queue failed with err: %d", ret); @@ -893,9 +893,9 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) } /* Get Rx and Tx queues FQID's */ - for (i = 0; i < DPDMAI_PRIO_NUM; i++) { + for (i = 0; i < dpdmai_dev->num_queues; i++) { ret = dpdmai_get_rx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, - dpdmai_dev->token, i, &rx_attr); + dpdmai_dev->token, i, 0, &rx_attr); if (ret) { DPAA2_QDMA_ERR("Reading device failed with err: %d", ret); @@ -904,7 +904,7 @@ dpaa2_dpdmai_dev_init(struct rte_rawdev *rawdev, int dpdmai_id) dpdmai_dev->rx_queue[i].fqid = rx_attr.fqid; ret = dpdmai_get_tx_queue(&dpdmai_dev->dpdmai, CMD_PRI_LOW, - dpdmai_dev->token, i, &tx_attr); + dpdmai_dev->token, i, 0, &tx_attr); if (ret) { DPAA2_QDMA_ERR("Reading device failed with err: %d", ret); diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h index c6a057806..0cbe90255 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.h @@ -11,6 +11,8 @@ struct qdma_io_meta; #define DPAA2_QDMA_MAX_FLE 3 #define DPAA2_QDMA_MAX_SDD 2 +#define DPAA2_DPDMAI_MAX_QUEUES 8 + /** FLE pool size: 3 Frame list + 2 source/destination descriptor */ #define QDMA_FLE_POOL_SIZE (sizeof(struct qdma_io_meta) + \ sizeof(struct qbman_fle) * DPAA2_QDMA_MAX_FLE + \ @@ -142,9 +144,9 @@ struct dpaa2_dpdmai_dev { /** Number of queue in this DPDMAI device */ uint8_t num_queues; /** RX queues */ - struct dpaa2_queue rx_queue[DPDMAI_PRIO_NUM]; + struct dpaa2_queue rx_queue[DPAA2_DPDMAI_MAX_QUEUES]; /** TX queues */ - struct dpaa2_queue tx_queue[DPDMAI_PRIO_NUM]; + struct dpaa2_queue tx_queue[DPAA2_DPDMAI_MAX_QUEUES]; }; #endif /* __DPAA2_QDMA_H__ */ -- 2.17.1