From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 8D004A05D3 for ; Tue, 26 Mar 2019 13:18:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D8FA14C9C; Tue, 26 Mar 2019 13:18:13 +0100 (CET) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80052.outbound.protection.outlook.com [40.107.8.52]) by dpdk.org (Postfix) with ESMTP id 137BA4CAB for ; Tue, 26 Mar 2019 13:18:12 +0100 (CET) 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=SKlP5dflNKjzmJPAWJ/guIpnSdMPewtpGeObvUam2s0=; b=u8Wtm96vG6E8cQcly8YpjnR9YxApxdhvz1ofVP76po3q/vpwaqiQCPcGNTTj7BejljrINve5MBrd09J7IGlWdK9rZXPI39cu4Iyrlsok6XlxcBX8f9MUpzDIa5uCADoSSdIlORLWvxL6J7y/uGkYR78X6/LNFYDzeFK4gX17Glc= Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by VI1PR0401MB2575.eurprd04.prod.outlook.com (10.168.65.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.16; Tue, 26 Mar 2019 12:18:05 +0000 Received: from VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18]) by VI1PR0401MB2541.eurprd04.prod.outlook.com ([fe80::18e3:39b6:c61d:3f18%12]) with mapi id 15.20.1730.019; Tue, 26 Mar 2019 12:18:05 +0000 From: Hemant Agrawal To: "dev@dpdk.org" CC: Shreyansh Jain , Yi Liu Thread-Topic: [PATCH 3/5] raw/dpaa2_qdma: add burst mode support Thread-Index: AQHU4833WQmLmfRiSkW+QYJ2NM5WoQ== Date: Tue, 26 Mar 2019 12:18:05 +0000 Message-ID: <20190326121610.28024-3-hemant.agrawal@nxp.com> References: <20190326121610.28024-1-hemant.agrawal@nxp.com> In-Reply-To: <20190326121610.28024-1-hemant.agrawal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [92.120.1.72] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BM1PR0101CA0069.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::31) To VI1PR0401MB2541.eurprd04.prod.outlook.com (2603:10a6:800:56::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0f621fc5-6111-4022-0702-08d6b1e5198e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2575; x-ms-traffictypediagnostic: VI1PR0401MB2575: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(346002)(39860400002)(376002)(199004)(189003)(186003)(36756003)(44832011)(53936002)(4326008)(76176011)(71190400001)(11346002)(71200400001)(476003)(6436002)(2616005)(5640700003)(486006)(2501003)(446003)(6486002)(14444005)(25786009)(14454004)(99286004)(256004)(30864003)(2351001)(2906002)(105586002)(86362001)(5660300002)(106356001)(81166006)(7736002)(1730700003)(1076003)(3846002)(97736004)(81156014)(52116002)(54906003)(66066001)(6116002)(68736007)(6506007)(386003)(478600001)(26005)(316002)(6916009)(6512007)(50226002)(8936002)(8676002)(102836004)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2575; H:VI1PR0401MB2541.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mx1yikZQw2E3pqlQbPbhuRiSwD6KDfzP8MYsgKR7HfBovq3s27J/gr6SzitYjuDnkHnJS/ispHPeAv3z06zeakzC0C8cbDRytqyw3bXCsCTxZjQVqPKmsyJUUHwTUl0XiMflcLOdPMPJpkidwYF8R61GTffb0JN/AWFBz8vkKfpXq6dC2pRzqzkADCaqzK1hqtmyZpYGtMEkOMuwO1UdDZt/Q6iflCY2w5rroeBpjvkLjQk3TrQrQCensqfBMGuIrs//It2PUlTHigyMjjGg0oUSyQtgFUys/mnPHYqEn0/qivDcGLKnBUJXPAq7EI04RyRR1GCcedwxytF9TPciUny8Y769h34i5IZxIC7ZLCEkE5uDuLnxPFbUJgURlH5XEmPqVgVNrZvGVx8HeflpA8l4pnOKlf5CUnHE0jRwmU4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f621fc5-6111-4022-0702-08d6b1e5198e X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:18:05.7192 (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-Transport-CrossTenantHeadersStamped: VI1PR0401MB2575 Subject: [dpdk-dev] [PATCH 3/5] raw/dpaa2_qdma: add burst mode support 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190326121805.IZ7-bEfRIK_PTY-Y0Nd56l7ysWDTUwfBSU98wb0xgeY@z> This patch adds support the batch processing for the qdma jobs Signed-off-by: Hemant Agrawal Signed-off-by: Yi Liu --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 309 ++++++++++---------- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 6 +- 2 files changed, 167 insertions(+), 148 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/d= paa2_qdma.c index a3f0f7fdd..679bf66e9 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,8 +1,10 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #include +#include +#include =20 #include #include @@ -13,6 +15,7 @@ #include #include #include +#include =20 #include #include @@ -395,21 +398,31 @@ dpaa2_qdma_populate_fle(struct qbman_fle *fle, DPAA2_SET_FLE_FIN(fle); } =20 -static int -dpdmai_dev_enqueue(struct dpaa2_dpdmai_dev *dpdmai_dev, - uint16_t txq_id, - uint16_t vq_id, - struct rte_qdma_job *job) +int +rte_qdma_vq_enqueue_multi(uint16_t vq_id, + struct rte_qdma_job **job, + uint16_t nb_jobs) { + struct qdma_virt_queue *qdma_vq =3D &qdma_vqs[vq_id]; + struct qdma_hw_queue *qdma_pq =3D qdma_vq->hw_queue; + struct dpaa2_dpdmai_dev *dpdmai_dev =3D qdma_pq->dpdmai_dev; struct qdma_io_meta *io_meta; - struct qbman_fd fd; + struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; struct dpaa2_queue *txq; struct qbman_fle *fle; struct qbman_eq_desc eqdesc; struct qbman_swp *swp; int ret; + uint32_t num_to_send =3D 0; + uint16_t num_tx =3D 0; + uint16_t num_txed =3D 0; =20 - DPAA2_QDMA_FUNC_TRACE(); + /* Return error in case of wrong lcore_id */ + if (rte_lcore_id() !=3D qdma_vq->lcore_id) { + DPAA2_QDMA_ERR("QDMA enqueue for vqid %d on wrong core", + vq_id); + return -1; + } =20 if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret =3D dpaa2_affine_qbman_swp(); @@ -420,7 +433,7 @@ dpdmai_dev_enqueue(struct dpaa2_dpdmai_dev *dpdmai_dev, } swp =3D DPAA2_PER_LCORE_PORTAL; =20 - txq =3D &(dpdmai_dev->tx_queue[txq_id]); + txq =3D &(dpdmai_dev->tx_queue[qdma_pq->queue_id]); =20 /* Prepare enqueue descriptor */ qbman_eq_desc_clear(&eqdesc); @@ -428,97 +441,86 @@ dpdmai_dev_enqueue(struct dpaa2_dpdmai_dev *dpdmai_de= v, qbman_eq_desc_set_no_orp(&eqdesc, 0); qbman_eq_desc_set_response(&eqdesc, 0, 0); =20 - /* - * Get an FLE/SDD from FLE pool. - * Note: IO metadata is before the FLE and SDD memory. - */ - ret =3D rte_mempool_get(qdma_dev.fle_pool, (void **)(&io_meta)); - if (ret) { - DPAA2_QDMA_DP_WARN("Memory alloc failed for FLE"); - return ret; - } - - /* Set the metadata */ - io_meta->cnxt =3D (size_t)job; - io_meta->id =3D vq_id; - - fle =3D (struct qbman_fle *)(io_meta + 1); - - /* populate Frame descriptor */ - memset(&fd, 0, sizeof(struct qbman_fd)); - DPAA2_SET_FD_ADDR(&fd, DPAA2_VADDR_TO_IOVA(fle)); - DPAA2_SET_FD_COMPOUND_FMT(&fd); - DPAA2_SET_FD_FRC(&fd, QDMA_SER_CTX); + while (nb_jobs > 0) { + uint32_t loop; + + num_to_send =3D (nb_jobs > dpaa2_eqcr_size) ? + dpaa2_eqcr_size : nb_jobs; + + for (loop =3D 0; loop < num_to_send; loop++) { + /* + * Get an FLE/SDD from FLE pool. + * Note: IO metadata is before the FLE and SDD memory. + */ + ret =3D rte_mempool_get(qdma_dev.fle_pool, + (void **)(&io_meta)); + if (ret) { + DPAA2_QDMA_DP_WARN("Me alloc failed for FLE"); + return ret; + } =20 - /* Populate FLE */ - memset(fle, 0, QDMA_FLE_POOL_SIZE); - dpaa2_qdma_populate_fle(fle, job->src, job->dest, job->len, job->flags); + /* Set the metadata */ + io_meta->cnxt =3D (size_t)job[num_tx]; + io_meta->id =3D vq_id; =20 - /* Enqueue the packet to the QBMAN */ - do { - ret =3D qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); - if (ret < 0 && ret !=3D -EBUSY) - DPAA2_QDMA_ERR("Transmit failure with err: %d", ret); - } while (ret =3D=3D -EBUSY); + fle =3D (struct qbman_fle *)(io_meta + 1); =20 - DPAA2_QDMA_DP_DEBUG("Successfully transmitted a packet"); + /* populate Frame descriptor */ + memset(&fd_arr[loop], 0, sizeof(struct qbman_fd)); + DPAA2_SET_FD_ADDR(&fd_arr[loop], + DPAA2_VADDR_TO_IOVA(fle)); + DPAA2_SET_FD_COMPOUND_FMT(&fd_arr[loop]); + DPAA2_SET_FD_FRC(&fd_arr[loop], QDMA_SER_CTX); =20 - return ret; -} + /* Populate FLE */ + memset(fle, 0, QDMA_FLE_POOL_SIZE); + dpaa2_qdma_populate_fle(fle, job[num_tx]->src, + job[num_tx]->dest, + job[num_tx]->len, + job[num_tx]->flags); =20 -int __rte_experimental -rte_qdma_vq_enqueue_multi(uint16_t vq_id, - struct rte_qdma_job **job, - uint16_t nb_jobs) -{ - int i, ret; + num_tx++; + } =20 - DPAA2_QDMA_FUNC_TRACE(); + /* Enqueue the packet to the QBMAN */ + uint32_t enqueue_loop =3D 0; + while (enqueue_loop < num_to_send) { + enqueue_loop +=3D qbman_swp_enqueue_multiple(swp, + &eqdesc, + &fd_arr[enqueue_loop], + NULL, + num_to_send - enqueue_loop); + } =20 - for (i =3D 0; i < nb_jobs; i++) { - ret =3D rte_qdma_vq_enqueue(vq_id, job[i]); - if (ret < 0) - break; + num_txed +=3D num_to_send; + nb_jobs -=3D num_to_send; } - - return i; + qdma_vq->num_enqueues +=3D num_txed; + return num_txed; } =20 -int __rte_experimental +int rte_qdma_vq_enqueue(uint16_t vq_id, struct rte_qdma_job *job) { - struct qdma_virt_queue *qdma_vq =3D &qdma_vqs[vq_id]; - struct qdma_hw_queue *qdma_pq =3D qdma_vq->hw_queue; - struct dpaa2_dpdmai_dev *dpdmai_dev =3D qdma_pq->dpdmai_dev; int ret; =20 - DPAA2_QDMA_FUNC_TRACE(); - - /* Return error in case of wrong lcore_id */ - if (rte_lcore_id() !=3D qdma_vq->lcore_id) { - DPAA2_QDMA_ERR("QDMA enqueue for vqid %d on wrong core", - vq_id); - return -EINVAL; - } - - ret =3D dpdmai_dev_enqueue(dpdmai_dev, qdma_pq->queue_id, vq_id, job); + ret =3D rte_qdma_vq_enqueue_multi(vq_id, &job, 1); if (ret < 0) { DPAA2_QDMA_ERR("DPDMAI device enqueue failed: %d", ret); return ret; } =20 - qdma_vq->num_enqueues++; - return 1; } =20 /* Function to receive a QDMA job for a given device and queue*/ static int -dpdmai_dev_dequeue(struct dpaa2_dpdmai_dev *dpdmai_dev, +dpdmai_dev_dequeue_multijob(struct dpaa2_dpdmai_dev *dpdmai_dev, uint16_t rxq_id, uint16_t *vq_id, - struct rte_qdma_job **job) + struct rte_qdma_job **job, + uint16_t nb_jobs) { struct qdma_io_meta *io_meta; struct dpaa2_queue *rxq; @@ -531,8 +533,6 @@ dpdmai_dev_dequeue(struct dpaa2_dpdmai_dev *dpdmai_dev, uint8_t status; int ret; =20 - DPAA2_QDMA_FUNC_TRACE(); - if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret =3D dpaa2_affine_qbman_swp(); if (ret) { @@ -541,7 +541,6 @@ dpdmai_dev_dequeue(struct dpaa2_dpdmai_dev *dpdmai_dev, } } swp =3D DPAA2_PER_LCORE_PORTAL; - rxq =3D &(dpdmai_dev->rx_queue[rxq_id]); dq_storage =3D rxq->q_storage->dq_storage[0]; fqid =3D rxq->fqid; @@ -551,7 +550,10 @@ dpdmai_dev_dequeue(struct dpaa2_dpdmai_dev *dpdmai_dev= , qbman_pull_desc_set_fq(&pulldesc, fqid); qbman_pull_desc_set_storage(&pulldesc, dq_storage, (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); - qbman_pull_desc_set_numframes(&pulldesc, 1); + if (nb_jobs > dpaa2_dqrr_size) + qbman_pull_desc_set_numframes(&pulldesc, dpaa2_dqrr_size); + else + qbman_pull_desc_set_numframes(&pulldesc, nb_jobs); =20 while (1) { if (qbman_swp_pull(swp, &pulldesc)) { @@ -561,125 +563,138 @@ dpdmai_dev_dequeue(struct dpaa2_dpdmai_dev *dpdmai_= dev, break; } =20 - /* Check if previous issued command is completed. */ + rte_prefetch0((void *)((size_t)(dq_storage + 1))); + /* Check if the previous issued command is completed. */ while (!qbman_check_command_complete(dq_storage)) ; - /* Loop until dq_storage is updated with new token by QBMAN */ - while (!qbman_check_new_result(dq_storage)) - ; =20 - /* Check for valid frame. */ - status =3D qbman_result_DQ_flags(dq_storage); - if (unlikely((status & QBMAN_DQ_STAT_VALIDFRAME) =3D=3D 0)) { - DPAA2_QDMA_DP_DEBUG("No frame is delivered"); - return 0; - } + int num_pulled =3D 0; + int pending =3D 1; + do { + /* Loop until the dq_storage is updated with + * new token by QBMAN + */ + while (!qbman_check_new_result(dq_storage)) + ; =20 - /* Get the FD */ - fd =3D qbman_result_DQ_fd(dq_storage); + rte_prefetch0((void *)((size_t)(dq_storage + 2))); + /* Check whether Last Pull command is Expired and + * setting Condition for Loop termination + */ + if (qbman_result_DQ_is_pull_complete(dq_storage)) { + pending =3D 0; + /* Check for valid frame. */ + status =3D qbman_result_DQ_flags(dq_storage); + if (unlikely((status & + QBMAN_DQ_STAT_VALIDFRAME) =3D=3D 0)) + continue; + } + fd =3D qbman_result_DQ_fd(dq_storage); =20 - /* - * Fetch metadata from FLE. job and vq_id were set - * in metadata in the enqueue operation. - */ - fle =3D (struct qbman_fle *)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)); - io_meta =3D (struct qdma_io_meta *)(fle) - 1; - if (vq_id) - *vq_id =3D io_meta->id; + /* + * Fetch metadata from FLE. job and vq_id were set + * in metadata in the enqueue operation. + */ + fle =3D (struct qbman_fle *) + DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)); + io_meta =3D (struct qdma_io_meta *)(fle) - 1; + if (vq_id) + vq_id[num_pulled] =3D io_meta->id; =20 - *job =3D (struct rte_qdma_job *)(size_t)io_meta->cnxt; - (*job)->status =3D DPAA2_GET_FD_ERR(fd); + job[num_pulled] =3D (struct rte_qdma_job *)(size_t)io_meta->cnxt; + job[num_pulled]->status =3D DPAA2_GET_FD_ERR(fd); =20 - /* Free FLE to the pool */ - rte_mempool_put(qdma_dev.fle_pool, io_meta); + /* Free FLE to the pool */ + rte_mempool_put(qdma_dev.fle_pool, io_meta); =20 - DPAA2_QDMA_DP_DEBUG("packet received"); + dq_storage++; + num_pulled++; + } while (pending && (num_pulled <=3D dpaa2_dqrr_size)); =20 - return 1; + return num_pulled; } =20 -int __rte_experimental +int rte_qdma_vq_dequeue_multi(uint16_t vq_id, struct rte_qdma_job **job, uint16_t nb_jobs) -{ - int i; - - DPAA2_QDMA_FUNC_TRACE(); - - for (i =3D 0; i < nb_jobs; i++) { - job[i] =3D rte_qdma_vq_dequeue(vq_id); - if (!job[i]) - break; - } - - return i; -} - -struct rte_qdma_job * __rte_experimental -rte_qdma_vq_dequeue(uint16_t vq_id) { struct qdma_virt_queue *qdma_vq =3D &qdma_vqs[vq_id]; struct qdma_hw_queue *qdma_pq =3D qdma_vq->hw_queue; - struct dpaa2_dpdmai_dev *dpdmai_dev =3D qdma_pq->dpdmai_dev; - struct rte_qdma_job *job =3D NULL; struct qdma_virt_queue *temp_qdma_vq; - int dequeue_budget =3D QDMA_DEQUEUE_BUDGET; - int ring_count, ret, i; - uint16_t temp_vq_id; - - DPAA2_QDMA_FUNC_TRACE(); + struct dpaa2_dpdmai_dev *dpdmai_dev =3D qdma_pq->dpdmai_dev; + int ring_count, ret =3D 0, i; =20 /* Return error in case of wrong lcore_id */ if (rte_lcore_id() !=3D (unsigned int)(qdma_vq->lcore_id)) { - DPAA2_QDMA_ERR("QDMA dequeue for vqid %d on wrong core", + DPAA2_QDMA_WARN("QDMA dequeue for vqid %d on wrong core", vq_id); - return NULL; + return -1; } =20 /* Only dequeue when there are pending jobs on VQ */ if (qdma_vq->num_enqueues =3D=3D qdma_vq->num_dequeues) - return NULL; + return 0; + + if (qdma_vq->num_enqueues < (qdma_vq->num_dequeues + nb_jobs)) + nb_jobs =3D (qdma_vq->num_enqueues - qdma_vq->num_dequeues); =20 if (qdma_vq->exclusive_hw_queue) { /* In case of exclusive queue directly fetch from HW queue */ - ret =3D dpdmai_dev_dequeue(dpdmai_dev, qdma_pq->queue_id, - NULL, &job); + ret =3D dpdmai_dev_dequeue_multijob(dpdmai_dev, qdma_pq->queue_id, + NULL, job, nb_jobs); if (ret < 0) { DPAA2_QDMA_ERR( "Dequeue from DPDMAI device failed: %d", ret); - return NULL; + return ret; } + qdma_vq->num_dequeues +=3D ret; } else { + uint16_t temp_vq_id[RTE_QDMA_BURST_NB_MAX]; /* * Get the QDMA completed jobs from the software ring. * In case they are not available on the ring poke the HW * to fetch completed jobs from corresponding HW queues */ ring_count =3D rte_ring_count(qdma_vq->status_ring); - if (ring_count =3D=3D 0) { + if (ring_count < nb_jobs) { /* TODO - How to have right budget */ - for (i =3D 0; i < dequeue_budget; i++) { - ret =3D dpdmai_dev_dequeue(dpdmai_dev, - qdma_pq->queue_id, &temp_vq_id, &job); - if (ret =3D=3D 0) - break; - temp_qdma_vq =3D &qdma_vqs[temp_vq_id]; + ret =3D dpdmai_dev_dequeue_multijob(dpdmai_dev, + qdma_pq->queue_id, + temp_vq_id, job, nb_jobs); + for (i =3D 0; i < ret; i++) { + temp_qdma_vq =3D &qdma_vqs[temp_vq_id[i]]; rte_ring_enqueue(temp_qdma_vq->status_ring, - (void *)(job)); + (void *)(job[i])); ring_count =3D rte_ring_count( qdma_vq->status_ring); - if (ring_count) - break; } } =20 - /* Dequeue job from the software ring to provide to the user */ - rte_ring_dequeue(qdma_vq->status_ring, (void **)&job); - if (job) - qdma_vq->num_dequeues++; + if (ring_count) { + /* Dequeue job from the software ring + * to provide to the user + */ + ret =3D rte_ring_dequeue_bulk(qdma_vq->status_ring, + (void **)job, ring_count, NULL); + if (ret) + qdma_vq->num_dequeues +=3D ret; + } } =20 + return ret; +} + +struct rte_qdma_job * +rte_qdma_vq_dequeue(uint16_t vq_id) +{ + int ret; + struct rte_qdma_job *job =3D NULL; + + ret =3D rte_qdma_vq_dequeue_multi(vq_id, &job, 1); + if (ret < 0) + DPAA2_QDMA_DP_WARN("DPDMAI device dequeue failed: %d", ret); + return job; } =20 diff --git a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h b/drivers/raw/dpaa= 2_qdma/rte_pmd_dpaa2_qdma.h index c9697b4d7..e1ccc19e8 100644 --- a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h @@ -12,6 +12,9 @@ * */ =20 +/** Maximum qdma burst size */ +#define RTE_QDMA_BURST_NB_MAX 32 + /** Determines the mode of operation */ enum { /** @@ -225,7 +228,8 @@ rte_qdma_vq_enqueue(uint16_t vq_id, * Number of QDMA jobs requested for dequeue by the user. * * @returns - * Number of jobs actually dequeued. + * - >=3D0: Number of jobs successfully received + * - <0: Error code. */ int rte_qdma_vq_dequeue_multi(uint16_t vq_id, --=20 2.17.1