From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0055.outbound.protection.outlook.com [104.47.2.55]) by dpdk.org (Postfix) with ESMTP id 95A703421 for ; Thu, 3 May 2018 18:34:30 +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; bh=x8kToQCxaDvqKXAsaYoqvOWNSfzhq/626EQCv6vnBPU=; b=rMM/SNuwTTH8wjhjB2/nIizQdF0dsuRetr7cqRKvpt3xDcd839ZgZh8N7YSOSrRMgM4NC0ucEvChQAQrtXPz93YIvZNKMnpHx9NsVKv0HP7yXOZgooa+gpW4Eqp4CQFEmx4y+U4XucxC3POoU6pl8Q2DFNMOi9Jtngm6INPplBQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.18; Thu, 3 May 2018 16:34:27 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Thu, 3 May 2018 22:03:52 +0530 Message-Id: <1525365233-5956-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> References: <1525281329-27984-1-git-send-email-nipun.gupta@nxp.com> <1525365233-5956-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0071.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::33) To HE1PR0401MB2425.eurprd04.prod.outlook.com (2603:10a6:3:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0401MB2425; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 3:TuQSwfRZm1rjLHLPcUSjKbuxCicL8HbnokiW1U4ntzpKnWMt2AYZWDU510yluz0tnPFY76cvF/k9SagbVKurOhnc1pg0rkT6nkNmM/q1TeI5bsW72b89QbRvE4fN8m2bfyoWm/+widvbCBm9BjwQXuapQ801rTDkNBHdyrTl4+MzwowjobLGVZsTeBu0AQhejiLXyaVvmNnVDfVOFyf/UPlbRZMnU0Pl6v7L9lX/hAAsQpybWDl/0WI0LavWRWxs; 25:3NKGelO3mKQHADrwJYoNEhyCBBfORR+J2UCwOyqEkixstXuVlWJOtGo8Cu3XwQcZ/MG/ef7P4LOkFaVIEOmdIUZJ/9vIlVfRw+fe7MEcwKd3MSevqpfTu335tO8m9eQjDlplJOzVJGkhfG/l4mOYxul0LCKl9cRAs6MVmmJuDnoGy2epXovANGHNvlF5hwum56qhA00XCVyDS8TM/xDm+I3Ml0f9dlTRM3FmsbrhoTDXk0jIH+QcSqbxalRNr9B4hHwz1tclJj4RruyZsnEqD01vVuXMOtzbvCLGAUdFI2elz+WUOCJcKUCjEDcqD6wZXtWlrVVd9+ifut5juiefJA==; 31:kQ1DMD497Buave6U3xm6LR6MCLPurA+HYgWUvuQnADUu4Np1FymjFox1PqgcxFAXhgboV0/CZukZUMIgFg+Lp8jBH+NTzZLtirc98/HnasJvfFBXMTmebH8KfA3SnY3Wp1fheZDQPxs/TIKI+tFaerRhotrJzO4Yh7SQZhr9hZup3NTDJplgzICyVpHNcoj6GL2KRD0NRNw5uObKa/3HN3YcMU9VByuu8lOC2XP5yfs= X-MS-TrafficTypeDiagnostic: HE1PR0401MB2425: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 20:opU1iMzYRLqZjnkd5zm9wvaj1qeYkf1lFLLlGXGBe6wp5My7WBjiiKbwQg2UFeBFXuLZwwJpwEbX2DOnrUI9oJmexdDp8Vi+AB4x94GDilm4kDU5k2pzLHGnp3bnSEiVc+p/z1A/dpAkBPivK9Jg1KL700JWnXN4TNdwjQvWNGdt12uYb18sx5uYYDyGxxHukpgkvuQrmUaRJuWDjMKOu8va1Ld8nBOVUplxBowKXYLG15moNbNSKedHaT1qE4Q0es+8AJUtNsMr1f5L9dEDHn+R3onbzBMbfxh1651nzwva7PFrqt3H8b1Mm1g/MazEmmNwOjhU2pz1THnq++aO/EDAak+JH9xExZ3R/OTgtAMvK7UP5+7kLEq7t3t7NvhqHFGbQpiU4PHvzYnot2Z9f4w5On9uKm7G+CcBRevUoiNyIRTkHSXzoRhIQ9J4b6/RJohR3aDCE2PS/v7hzOjxdG5kRhUCDvjiy3osiPUd7ol2csC2NNNzif3Vto87YWFT; 4:62COXJibx9TtKxJRmuDIFgs1FDgEl3rybAj/GrXbraQh1mlMhhi9RwViDpXa1UjzCkqUo5ED80x5v34dCj5PtBYpp51r4bbkczvgsFMaabhnWA3fys5Mqt7bXrjFYnzmp+4eLtR+O6GD/zhhjtRGMRIPFYG1ju30jhDMxrx0/+xeOdMb3Qc78+I4kB+XwKWDuoGj2WkIGYjSS30ZDM554B6EJ+1N69xfYTOR0m5LsgxukV3+IQhBzN2H7q63HeJkCT9Ms0UT5kcQcFUsDoGQZmT2gH28XB04k8YeZk4aectN4gQbakgzghSNkJnr8h0fDxq86VxjRD38Ta7YyZfw5do3B+33U9JIAuyT2l5AU2o= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0401MB2425; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0401MB2425; X-Forefront-PRVS: 066153096A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(396003)(39860400002)(346002)(376002)(189003)(199004)(86362001)(97736004)(6486002)(68736007)(478600001)(5009440100003)(316002)(16586007)(6512007)(5660300001)(4326008)(48376002)(106356001)(105586002)(53936002)(25786009)(8936002)(36756003)(81156014)(81166006)(47776003)(305945005)(8676002)(26005)(2906002)(66066001)(956004)(50226002)(7736002)(50466002)(6666003)(6636002)(11346002)(59450400001)(2616005)(386003)(6116002)(6506007)(186003)(55236004)(3846002)(76176011)(52116002)(486006)(16526019)(446003)(51416003)(44832011)(476003)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0401MB2425; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0401MB2425; 23:RtvZajx/6EyCCl532yCpwYLWn2DJFv07PA69pEh?= =?us-ascii?Q?GFMEmIIe3okFBRwmlaDd1Rci2JMUO0w6Q+5mlTra0GqEmPDNUocJUqIOuwVn?= =?us-ascii?Q?uHTvYjjsPhwro2p3In0GlEHw9o7yNCkf602ITbv6Pla6rlZrCiMtd03jJpyd?= =?us-ascii?Q?psf5omk6jdD93FbHIBc1JygffJipVAL+7+PuZSHOBK3Nt+5aOvELaLMwqJU4?= =?us-ascii?Q?Ar2d2hljtqoupR225W76xtdqA+v2A/X1x7ni1T+flfmiYXjoRYH1iwTIT98k?= =?us-ascii?Q?Oa9JopI6s/YtFAlV12q696RX0f5b7pQYvUuS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qPmwx6ZN6g7AIKyp2o6eiwTcVft3H1p/ZNEWvxZygnB7xtHyHMd3EhsrSU22TSUqxlDTz4HTfnd4tScWdrEFM8+ITwnIPMwLu3NGOowwOYU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0401MB2425; 7:puuVx1k11Xxg0MaM3kW28Ns+HUTqk1dYnzX9Gc33bpHFQFTbmv3NRy9At5Iq6VbSiMMz8hdWOreGoDjJw88BW/BMffzrR4/AMnlfhbNrgXyM8dzedENGFiGMXayofJ0M0iyhjAG8i6jw/xXBRy4inoxaHbunHBjcvfznh3X3eyvrvZreQmgdjXJOmSphv1tExsgX9Y+uKOHBKWusVPQKaues8IaRvysXYduwg0IN2PFuYxaKMIEsoacpg/dBJhqS X-MS-Office365-Filtering-Correlation-Id: 408cd3c8-ca93-42ec-fbdd-08d5b113bde8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2018 16:34:27.9575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 408cd3c8-ca93-42ec-fbdd-08d5b113bde8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0401MB2425 Subject: [dpdk-dev] [PATCH v5 6/7] raw/dpaa2_cmdif: support enqueue dequeue operations 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: Thu, 03 May 2018 16:34:31 -0000 Signed-off-by: Nipun Gupta --- doc/api/doxy-api-index.md | 1 + doc/api/doxy-api.conf | 1 + drivers/raw/dpaa2_cmdif/Makefile | 2 + drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 136 ++++++++++++++++++++++++++ drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h | 23 +++-- drivers/raw/dpaa2_cmdif/meson.build | 2 + drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h | 35 +++++++ 7 files changed, 194 insertions(+), 6 deletions(-) create mode 100644 drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index dd57f55..55d075c 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -39,6 +39,7 @@ The public API headers are grouped by topics: [bnxt] (@ref rte_pmd_bnxt.h), [dpaa] (@ref rte_pmd_dpaa.h), [dpaa2_mempool] (@ref rte_dpaa2_mempool.h), + [dpaa2_cmdif] (@ref rte_pmd_dpaa2_cmdif.h), [dpaa2_qdma] (@ref rte_pmd_dpaa2_qdma.h), [crypto_scheduler] (@ref rte_cryptodev_scheduler.h) diff --git a/doc/api/doxy-api.conf b/doc/api/doxy-api.conf index 71fb6b2..aa66751 100644 --- a/doc/api/doxy-api.conf +++ b/doc/api/doxy-api.conf @@ -38,6 +38,7 @@ INPUT = doc/api/doxy-api-index.md \ drivers/net/i40e \ drivers/net/ixgbe \ drivers/net/softnic \ + drivers/raw/dpaa2_cmdif \ drivers/raw/dpaa2_qdma \ lib/librte_eal/common/include \ lib/librte_eal/common/include/generic \ diff --git a/drivers/raw/dpaa2_cmdif/Makefile b/drivers/raw/dpaa2_cmdif/Makefile index 5f9b8bf..9b863dd 100644 --- a/drivers/raw/dpaa2_cmdif/Makefile +++ b/drivers/raw/dpaa2_cmdif/Makefile @@ -31,4 +31,6 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV) += dpaa2_cmdif.c +SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_CMDIF_RAWDEV)-include += rte_pmd_dpaa2_cmdif.h + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index bdd7c16..7ff111e 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -53,8 +53,144 @@ return 0; } +static int +dpaa2_cmdif_enqueue_bufs(struct rte_rawdev *dev, + struct rte_rawdev_buf **buffers, + unsigned int count, + rte_rawdev_obj_t context) +{ + struct dpaa2_dpci_dev *cidev = dev->dev_private; + struct rte_dpaa2_cmdif_context *cmdif_send_cnxt; + struct dpaa2_queue *txq; + struct qbman_fd fd; + struct qbman_eq_desc eqdesc; + struct qbman_swp *swp; + int ret; + + DPAA2_CMDIF_FUNC_TRACE(); + + RTE_SET_USED(count); + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_CMDIF_ERR("Failure in affining portal\n"); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + cmdif_send_cnxt = (struct rte_dpaa2_cmdif_context *)(context); + txq = &(cidev->tx_queue[cmdif_send_cnxt->priority]); + + /* Prepare enqueue descriptor */ + qbman_eq_desc_clear(&eqdesc); + qbman_eq_desc_set_fq(&eqdesc, txq->fqid); + qbman_eq_desc_set_no_orp(&eqdesc, 0); + qbman_eq_desc_set_response(&eqdesc, 0, 0); + + /* Set some of the FD parameters to i. + * For performance reasons do not memset + */ + fd.simple.bpid_offset = 0; + fd.simple.ctrl = 0; + + DPAA2_SET_FD_ADDR(&fd, DPAA2_VADDR_TO_IOVA(buffers[0]->buf_addr)); + DPAA2_SET_FD_LEN(&fd, cmdif_send_cnxt->size); + DPAA2_SET_FD_FRC(&fd, cmdif_send_cnxt->frc); + DPAA2_SET_FD_FLC(&fd, cmdif_send_cnxt->flc); + + /* Enqueue a packet to the QBMAN */ + do { + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); + if (ret < 0 && ret != -EBUSY) + DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); + } while (ret == -EBUSY); + + DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); + + return 0; +} + +static int +dpaa2_cmdif_dequeue_bufs(struct rte_rawdev *dev, + struct rte_rawdev_buf **buffers, + unsigned int count, + rte_rawdev_obj_t context) +{ + struct dpaa2_dpci_dev *cidev = dev->dev_private; + struct rte_dpaa2_cmdif_context *cmdif_rcv_cnxt; + struct dpaa2_queue *rxq; + struct qbman_swp *swp; + struct qbman_result *dq_storage; + const struct qbman_fd *fd; + struct qbman_pull_desc pulldesc; + uint8_t status; + int ret; + + DPAA2_CMDIF_FUNC_TRACE(); + + RTE_SET_USED(count); + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + DPAA2_CMDIF_ERR("Failure in affining portal\n"); + return 0; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + cmdif_rcv_cnxt = (struct rte_dpaa2_cmdif_context *)(context); + rxq = &(cidev->rx_queue[cmdif_rcv_cnxt->priority]); + dq_storage = rxq->q_storage->dq_storage[0]; + + qbman_pull_desc_clear(&pulldesc); + qbman_pull_desc_set_fq(&pulldesc, rxq->fqid); + qbman_pull_desc_set_numframes(&pulldesc, 1); + qbman_pull_desc_set_storage(&pulldesc, dq_storage, + (uint64_t)(DPAA2_VADDR_TO_IOVA(dq_storage)), 1); + + while (1) { + if (qbman_swp_pull(swp, &pulldesc)) { + DPAA2_CMDIF_DP_WARN("VDQ cmd not issued. QBMAN is busy\n"); + /* Portal was busy, try again */ + continue; + } + break; + } + + /* Check if previous issued command is completed. */ + while (!qbman_check_command_complete(dq_storage)) + ; + /* Loop until the dq_storage is updated with new token by QBMAN */ + while (!qbman_result_has_new_result(swp, dq_storage)) + ; + + /* Check for valid frame. */ + status = (uint8_t)qbman_result_DQ_flags(dq_storage); + if (unlikely((status & QBMAN_DQ_STAT_VALIDFRAME) == 0)) { + DPAA2_CMDIF_DP_DEBUG("No frame is delivered\n"); + return 0; + } + + fd = qbman_result_DQ_fd(dq_storage); + + buffers[0]->buf_addr = (void *)DPAA2_IOVA_TO_VADDR( + DPAA2_GET_FD_ADDR(fd) + DPAA2_GET_FD_OFFSET(fd)); + cmdif_rcv_cnxt->size = DPAA2_GET_FD_LEN(fd); + cmdif_rcv_cnxt->flc = DPAA2_GET_FD_FLC(fd); + cmdif_rcv_cnxt->frc = DPAA2_GET_FD_FRC(fd); + + DPAA2_CMDIF_DP_DEBUG("packet received\n"); + + return 1; +} + static const struct rte_rawdev_ops dpaa2_cmdif_ops = { .attr_get = dpaa2_cmdif_get_attr, + .enqueue_bufs = dpaa2_cmdif_enqueue_bufs, + .dequeue_bufs = dpaa2_cmdif_dequeue_bufs, }; static int diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h index 5eb0885..598a621 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif_logs.h @@ -9,18 +9,18 @@ extern "C" { #endif -#include - extern int dpaa2_cmdif_logtype; #define DPAA2_CMDIF_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "%s(): " fmt "\n", \ - __func__, ##args) + rte_log(RTE_LOG_ ## level, dpaa2_cmdif_logtype, "dpaa2_cmdif: " \ + fmt "\n", ## args) + +#define DPAA2_CMDIF_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, dpaa2_cmdif_logtype, "dpaa2_cmdif: %s(): " \ + fmt "\n", __func__, ## args) #define DPAA2_CMDIF_FUNC_TRACE() DPAA2_CMDIF_LOG(DEBUG, ">>") -#define DPAA2_CMDIF_DEBUG(fmt, args...) \ - DPAA2_CMDIF_LOG(DEBUG, fmt, ## args) #define DPAA2_CMDIF_INFO(fmt, args...) \ DPAA2_CMDIF_LOG(INFO, fmt, ## args) #define DPAA2_CMDIF_ERR(fmt, args...) \ @@ -28,6 +28,17 @@ #define DPAA2_CMDIF_WARN(fmt, args...) \ DPAA2_CMDIF_LOG(WARNING, fmt, ## args) +/* DP Logs, toggled out at compile time if level lower than current level */ +#define DPAA2_CMDIF_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, "dpaa2_cmdif: " fmt "\n", ## args) + +#define DPAA2_CMDIF_DP_DEBUG(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(DEBUG, fmt, ## args) +#define DPAA2_CMDIF_DP_INFO(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(INFO, fmt, ## args) +#define DPAA2_CMDIF_DP_WARN(fmt, args...) \ + DPAA2_CMDIF_DP_LOG(WARNING, fmt, ## args) + #ifdef __cplusplus } #endif diff --git a/drivers/raw/dpaa2_cmdif/meson.build b/drivers/raw/dpaa2_cmdif/meson.build index 91a77ce..8c90943 100644 --- a/drivers/raw/dpaa2_cmdif/meson.build +++ b/drivers/raw/dpaa2_cmdif/meson.build @@ -5,3 +5,5 @@ deps += ['rawdev', 'mempool_dpaa2', 'bus_vdev'] sources = files('dpaa2_cmdif.c') allow_experimental_apis = true + +install_headers('rte_pmd_dpaa2_cmdif.h') diff --git a/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h new file mode 100644 index 0000000..483b66e --- /dev/null +++ b/drivers/raw/dpaa2_cmdif/rte_pmd_dpaa2_cmdif.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef __RTE_PMD_DPAA2_CMDIF_H__ +#define __RTE_PMD_DPAA2_CMDIF_H__ + +/** + * @file + * + * NXP dpaa2 AIOP CMDIF PMD specific structures. + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** The context required in the I/O path for DPAA2 AIOP Command Interface */ +struct rte_dpaa2_cmdif_context { + /** Size to populate in QBMAN FD */ + uint32_t size; + /** FRC to populate in QBMAN FD */ + uint32_t frc; + /** FLC to populate in QBMAN FD */ + uint64_t flc; + /** Priority of the command. This priority determines DPCI Queue*/ + uint8_t priority; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __RTE_PMD_DPAA2_CMDIF_H__ */ -- 1.9.1