From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0084.outbound.protection.outlook.com [104.47.36.84]) by dpdk.org (Postfix) with ESMTP id 3D29C7D15 for ; Thu, 15 Jun 2017 11:00:49 +0200 (CEST) Received: from BN6PR03CA0015.namprd03.prod.outlook.com (10.168.230.153) by BY2PR0301MB0599.namprd03.prod.outlook.com (10.160.125.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 15 Jun 2017 09:00:47 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::118) by BN6PR03CA0015.outlook.office365.com (2603:10b6:404:23::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Thu, 15 Jun 2017 09:00:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Thu, 15 Jun 2017 09:00:46 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5F8xWSk012830; Thu, 15 Jun 2017 02:00:43 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 15 Jun 2017 14:28:52 +0530 Message-ID: <1497517136-11824-17-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> References: <1495735361-4840-1-git-send-email-nipun.gupta@nxp.com> <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131419908469246420; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39840400002)(39410400002)(39450400003)(39850400002)(39380400002)(39400400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(53936002)(189998001)(8676002)(5660300001)(110136004)(8656002)(305945005)(77096006)(33646002)(36756003)(38730400002)(50986999)(105606002)(104016004)(76176999)(8936002)(54906002)(498600001)(2906002)(106466001)(50226002)(48376002)(85426001)(6916009)(50466002)(2351001)(6666003)(4326008)(5003940100001)(81166006)(2950100002)(86362001)(47776003)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0599; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:nA5SqHAOV1utN01zsQ4bpr5vsXDTyJxoAZIYpg6yjtGsxN0TBnHdfxQ9IU1GYDzxnbh5ntp5HWKak1DtopQnj03nSmeBMB6zHvEk4UaJqE7k9Ye05FA35LcE38a6E+77JoQOhBhY1izm4UxduEIYATXilQmdKkNoFE/wUGqOElbd0xXe2cHmH6Txo5Xy5SEIHzdGa26EeuiLpiOEp5nu0jm78nYabpW3H97FDWcbESDnzTksO1EF2vvwwFmjWdanmoX7p/ZKvJGuv421llHjPNwhScZ4YbhE5LURiVb4lTNwZTiZCZma7peFsuVOPjRZ2RX/LkQHnR5afwPD/HxXsI9WT+CRTfopwaMfV4ThYbyYuEwZ7bb4yVJX/4n7yoyLL3XciX06uymTJzeizN6r/1YeSplNmHamE98GBQ3I5cYWdzcMOVbTv4b8PkP05L4cH9JzXRYabam3p5+5srg7+X9ZzuQ6+XVK6E3ayFZnFniXsyQrmFhPAKlchfjjhvA0JL9KOwLBvKtt23YL3CWEpGoCgddzlfmwsfiZb9ePdMFnYuNesosdr+QFr5qUtQFjIblRR/eroySGM/L5+75lRclhPUF+5m3pNB7OXzfPnLXIoQEiD5mSXrY2rhXsqqKtZieNdkSJzYYdeZjDgGZNpmUZj4A44jnQPQBNX7pAtFS/fxB6vFIuHbupBoO8ixkJyyXEwVkRVgEDKscntKqMQAeIn2Xdgxtm0YcN2g9Wu6I= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY2PR0301MB0599: X-MS-Office365-Filtering-Correlation-Id: 2b8c88b1-2416-426e-871a-08d4b3cd032b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY2PR0301MB0599; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0599; 3:0L3wm3u1JJO5o8QAwpr1h9ztbt8G4jLhNBNdECtE/tNruPQGt+bUKprXvioQNyWUNJkEzWPYWAyD8kmTKXhM7rLpvb1IAY4/yleO1w9Qr8R3Rgn1YGrRSzapkJ0I+Q6pqjD/qkY4z5NsHUBCbppbzLqezWE1JGuDkNJfGLMLu3xj+HAE8VswwcloOZZHlhFkHscDWSaycxJugKkAEOXY6lEv5w5DEDae5sGjqsx3BLpz3CLn09yL3GwH8+97lQ0UPlRtKprd8UNxSjnFL8rG3IzPQT4rZ93kPXAgqkyx1S6f6PNoBTbogJJB2Hjd5bEVXrgocJ6d2LGLubA7wwyUsYY31OlCkRmSDeqA6o8e3mzd04kYtDT/kPWcB1q1CFJ1BOmqY9iUQ38QZksRTsF1FvLPfhcVd57z7YBBLMhZOKE3gHauip6QBb/bvJ8jNqXl; 25:TCEkUHrTaKGEV6/ZrFOYa1Y3/DnS7kR17HAnXIHXkmkF/IEoHPaZDT8AQOixceiz81JSdu4k4h/GYQ4Qa3U8Ojiu6bYqhfqwh1WD/o4h1tfuJA95y0/EnBAB+dtxzwvEExs3nsTp+EN3bcB4JWXmgA5DkFwlw08/bA3eicVx1BoD4SnljvF9NsP3sD6p7yMN/PzS/d4xrT/RKsKA0C5tO1mfxSF083ypOYBd3P5OZQMI+gbijDmlVLYCbAlNcF2Y5iiwWv4noi7beIbWjGaJQEGngm9de8F4NAAuThdnhCj+Ac3kEAMEeCMuina30zul7lOs+TBwHnWM4YC/on+CpdzPqxzleAEenIo/jlH0uGJ2j1CAlpxaQR12ThMvzOyPvi90jpYHlY39kzd7WorqNdXr7BVvJMHbC4TUBaQ3wgEMSRlUxB+lFM9I1b8YKOzoBG1kv4M5J3Id2rsnz7jqrpwHFGIbu1Lp4ydLs0aR0GE= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0599; 31:KCBBdXtD5P1vEcT7pP63C0pDng4RRidELJbZD6eLWdu8yN1UwOo6ccaKcLJ6Eq/YY/LFy/1x5QuSrYsz9PtVXI3JBancj9HZeVX9gfp+T7P5yfxNlX1JWUSmrd1GXlzHCV60bR/lQZ6/GWpQDg2Dp4XCbYQk+emngaZotNgNwAbNvoHFDHYoDEmkvnk0cq/r3wviyauporDKY3GCcBCGTFZQLhywKNsnxJP84VxxsQIyA+BJjXlCaCEXtyd6dfEb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0301MB0599; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0301MB0599; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0599; 4:nTDT26Yj5hqtQ5DkrS/3PpAsUj/DlJqNJV9hNBi6?= =?us-ascii?Q?tI1mELIXi2qV9ThB8GKohLYMCZmACt72CuxqjHyUORQYY6joQDYuF/gazBa8?= =?us-ascii?Q?9T/G65QBH0GW4/ojvwkuriAsKnTC2MX3yMDGPqsgz8wXJfnlvqLYYJW2PlSC?= =?us-ascii?Q?lK4XZFWmUaw7uAofDhlXC6bgxc+syhnbzi7vw+5zguloLOeXaaO6JDAHL2JW?= =?us-ascii?Q?xGJkbO2ocmDv6I9mUFviMum+NFiCPxDPGD9OApu5sDW7/w/Vyxf+wPgV953m?= =?us-ascii?Q?nxpToN20OjhRdoBq/bZ4A6wPMH+7JPkR2gXttJBUAN8AuXmW4nKXJJ/xKikj?= =?us-ascii?Q?fWJUYdOKY5rw9iZbKn6JIYIVbu5/gfy/Dw4Wt9DvVUPQGlGjk/i3y76Pxxhs?= =?us-ascii?Q?g705lgS492v7dn/d3TA9FdtNLrW/mhBU8WmRZbRdLzOPyX9nkQXTP6au4jN9?= =?us-ascii?Q?k+Jh5GuvAurGTCw67UCvq6Yp+R57ORYPMvJV1O+WUZ4dt48f3XiPa21GKGDV?= =?us-ascii?Q?EPdAtl9Ox88ZWPdOq5vBJD1TL6gQqPtP9o7KOTkR5a8z1jY+aX3QX+rQKyha?= =?us-ascii?Q?ZXHsNqmzd7DRdT0HJXje61LwEMmHhRnSiR+ewS1/NyQ+1MQRDdfI7oEvd5dJ?= =?us-ascii?Q?VtG8LUBn3UR/wfKD1NabwgI1a9uqBfa2IyWAeupDNgNBQZVC0DZ61tp86tv8?= =?us-ascii?Q?RYpNawcY2PqtmhDcTG+xhMglJVV/qkTCrIIuDLkMorOy2JIQc+qhHU1MmOw7?= =?us-ascii?Q?PXFu1G5qe/NJthmFHix5UKMrLO4Drlsk5AXpaTOTJgyhPm+Y6hiM+Ypi6cfF?= =?us-ascii?Q?jw4rymI8lAeopJCofSb5j3F4S3w4/YyldQYJyDq3e2lfZcHSjGdeVgu5iuzB?= =?us-ascii?Q?diGb3lcvF1copI4aBcO7u+dxNSafkYDdE02y2QjkWr8vO4TUC5elUWTavfxn?= =?us-ascii?Q?zfanvW/tXoUfS3IE71sZWcNn9tXUvLNrcIufe4PV8UT9ebvtvogBsxQpCiqx?= =?us-ascii?Q?2fcho0UDRE9tfzvdA5m+d/EN6zNfAOHNkJgdCfvRQ+7RqwWCoQ3+aI1KKa+p?= =?us-ascii?Q?gxruQicwoOmk0S2vPQR2DuMjeL151mkjpJwf911rMgSpO9iDpooi9VKXWS+0?= =?us-ascii?Q?8wllpxDcAaNdeumQUnMqSI/edZdfpi6jMJ9nvPa4rLcQkZPKi9MFovQi7XYC?= =?us-ascii?Q?Lj0z+TzIPZnA7xPI7GXRbGypixA1T8w5Z2wUO5jedIg+UoqcCTapseDHWiV6?= =?us-ascii?Q?61wulwgalcLb1/2WB33tJCXMMiGmHUrbz6yflqSLiK6WZZXuC5cJYNXbDZTf?= =?us-ascii?Q?2Q=3D=3D?= X-Forefront-PRVS: 0339F89554 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0599; 23:loP9ZULt1OSgoAXsHrJe7Al81tp43aaXm7u+XfU?= =?us-ascii?Q?17KUS9mfYxX4oOImRb/K3mUxlAMS9VBu5JnD6Oba31GiVKKDug7x5EMpPQep?= =?us-ascii?Q?hclAqUZd0nKEXljczAR1ctdY5QffW2WTm0aN4+n5Ktvp0WAtR/uwzlnzX3kt?= =?us-ascii?Q?rwNv8urbe+PoKAwWYCjP4s4kL2sKyFQ6ap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c+tHo5zMJEfHUT7dq9NY7RzDZP70OpxYOmn6xvsXy69LdvOEzpaeUYPcF0ibVGGk3VlG5qYUyDQY+LNl7mGyQEzisPCq/GGTNWMDPBXut65o75WtzPCAN5bGAlLz1RaUVh5gf9LbHJojdldAkLsNKvBP8WUeYs2UgBMFSxsJibgGd4yiAi7DaqRn4JlUZzDDSBD4MO4rE4gd2CHBlMy0RGLHgxdLwxzQSjZI/TCgl+b6fgsTp5e9vkT36hqtTahFokRsYtNMtzQ4wdQkAS8IRGMl622nAcJ1AQhdEG+oaI0vA==; 24:0Z9bNC8VhrCXb56y3+wtgRm/O5pFIDOFg4RIQVs3FPjTlhK9Z8N75YiqJtp/5mJqluTyh7+peqLvzCXVk8gAiS4wijzbcLIl4eh7McXrkck= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0599; 7:SXqx2gaX8XNgXCHvbNVYmayyTJLMCnWQp3pjDsaargo3JWBHBn5y36/OrZDk+M6I4PcvvBcdWxTH7gjYnFn03D+Coaq6EPdzo1jmI680xSQ778HlBdMw62i3vTxPY5TGB8OOsn+csaUa7nGHGDbGKdgu32z59DFaGd1gSkhGbe8c89UQJRdBt6M8877dJa8F3zJF0cnYwz3qWf3fr9gVmUnGGY1KSazjUzXkhxgU7hSvIeATqvPutvIJ0GkZ7WT0gM8OjKonCXkppE3ETTCfcSZJbBU5zpKaxb9Cbx9Z2yzTwfq8wh+GpsnZNpC9gBsA13mdO4wwHZsvKamJ5RwK9A== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 09:00:46.7374 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0599 Subject: [dpdk-dev] [PATCH 16/20 v2] event/dpaa2: add enqueue and dequeue functionality 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, 15 Jun 2017 09:00:50 -0000 Signed-off-by: Nipun Gupta --- drivers/event/dpaa2/dpaa2_eventdev.c | 170 +++++++++++++++++++++++++++++++++-- 1 file changed, 163 insertions(+), 7 deletions(-) diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index c00db7a..a7f8516 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -74,11 +75,85 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], uint16_t nb_events) { + struct rte_eventdev *ev_dev = + ((struct dpaa2_io_portal_t *)port)->eventdev; + struct dpaa2_eventdev *priv = ev_dev->data->dev_private; + uint32_t queue_id = ev[0].queue_id; + struct evq_info_t *evq_info = &priv->evq_info[queue_id]; + uint32_t fqid; + struct qbman_swp *swp; + struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; + uint32_t loop, frames_to_send; + struct qbman_eq_desc eqdesc[MAX_TX_RING_SLOTS]; + uint16_t num_tx = 0; + int ret; + RTE_SET_USED(port); - RTE_SET_USED(ev); - RTE_SET_USED(nb_events); - return 0; + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + PMD_DRV_LOG(ERR, PMD, "Failure in affining portal\n"); + return 0; + } + } + + swp = DPAA2_PER_LCORE_PORTAL; + + while (nb_events) { + frames_to_send = (nb_events >> 3) ? + MAX_TX_RING_SLOTS : nb_events; + + for (loop = 0; loop < frames_to_send; loop++) { + const struct rte_event *event = &ev[num_tx + loop]; + + if (event->sched_type != RTE_SCHED_TYPE_ATOMIC) + fqid = evq_info->dpci->queue[ + DPAA2_EVENT_DPCI_PARALLEL_QUEUE].fqid; + else + fqid = evq_info->dpci->queue[ + DPAA2_EVENT_DPCI_ATOMIC_QUEUE].fqid; + + /* Prepare enqueue descriptor */ + qbman_eq_desc_clear(&eqdesc[loop]); + qbman_eq_desc_set_fq(&eqdesc[loop], fqid); + qbman_eq_desc_set_no_orp(&eqdesc[loop], 0); + qbman_eq_desc_set_response(&eqdesc[loop], 0, 0); + + if (event->impl_opaque) { + uint8_t dqrr_index = event->impl_opaque - 1; + + qbman_eq_desc_set_dca(&eqdesc[loop], 1, + dqrr_index, 0); + DPAA2_PER_LCORE_DPIO->dqrr_size--; + DPAA2_PER_LCORE_DPIO->dqrr_held &= + ~(1 << dqrr_index); + } + + memset(&fd_arr[loop], 0, sizeof(struct qbman_fd)); + + /* + * todo - need to align with hw context data + * to avoid copy + */ + struct rte_event *ev_temp = rte_malloc(NULL, + sizeof(struct rte_event), 0); + rte_memcpy(ev_temp, event, sizeof(struct rte_event)); + DPAA2_SET_FD_ADDR((&fd_arr[loop]), ev_temp); + DPAA2_SET_FD_LEN((&fd_arr[loop]), + sizeof(struct rte_event)); + } + loop = 0; + while (loop < frames_to_send) { + loop += qbman_swp_enqueue_multiple_eqdesc(swp, + &eqdesc[loop], &fd_arr[loop], + frames_to_send - loop); + } + num_tx += frames_to_send; + nb_events -= frames_to_send; + } + + return num_tx; } static uint16_t @@ -87,16 +162,91 @@ return dpaa2_eventdev_enqueue_burst(port, ev, 1); } +static void dpaa2_eventdev_process_parallel(struct qbman_swp *swp, + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct rte_event *ev) +{ + struct rte_event *ev_temp = + (struct rte_event *)DPAA2_GET_FD_ADDR(fd); + rte_memcpy(ev, ev_temp, sizeof(struct rte_event)); + rte_free(ev_temp); + + qbman_swp_dqrr_consume(swp, dq); +} + +static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct rte_event *ev) +{ + struct rte_event *ev_temp = + (struct rte_event *)DPAA2_GET_FD_ADDR(fd); + uint8_t dqrr_index = qbman_get_dqrr_idx(dq); + + RTE_SET_USED(swp); + + rte_memcpy(ev, ev_temp, sizeof(struct rte_event)); + rte_free(ev_temp); + ev->impl_opaque = dqrr_index + 1; + DPAA2_PER_LCORE_DPIO->dqrr_size++; + DPAA2_PER_LCORE_DPIO->dqrr_held |= 1 << dqrr_index; +} + static uint16_t dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks) { + const struct qbman_result *dq; + struct qbman_swp *swp; + const struct qbman_fd *fd; + struct dpaa2_queue *rxq; + int num_pkts = 0, ret, i = 0; + RTE_SET_USED(port); - RTE_SET_USED(ev); - RTE_SET_USED(nb_events); RTE_SET_USED(timeout_ticks); - return 0; + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + PMD_DRV_LOG(ERR, PMD, "Failure in affining portal\n"); + return 0; + } + } + + swp = DPAA2_PER_LCORE_PORTAL; + + /* Check if there are atomic contexts to be released */ + while (DPAA2_PER_LCORE_DPIO->dqrr_size) { + if (DPAA2_PER_LCORE_DPIO->dqrr_held & (1 << i)) { + dq = qbman_get_dqrr_from_idx(swp, i); + qbman_swp_dqrr_consume(swp, dq); + DPAA2_PER_LCORE_DPIO->dqrr_size--; + } + i++; + } + DPAA2_PER_LCORE_DPIO->dqrr_held = 0; + + do { + dq = qbman_swp_dqrr_next(swp); + if (!dq) + return 0; + + fd = qbman_result_DQ_fd(dq); + + rxq = (struct dpaa2_queue *)qbman_result_DQ_fqd_ctx(dq); + if (rxq) { + rxq->cb(swp, fd, dq, &ev[num_pkts]); + } else { + qbman_swp_dqrr_consume(swp, dq); + PMD_DRV_LOG(ERR, PMD, "Null Return VQ received\n"); + return 0; + } + + num_pkts++; + } while (num_pkts < nb_events); + + return num_pkts; } static uint16_t @@ -397,11 +547,17 @@ int ret, i; /*Do settings to get the frame on a DPCON object*/ - rx_queue_cfg.options = DPCI_QUEUE_OPT_DEST; + rx_queue_cfg.options = DPCI_QUEUE_OPT_DEST | + DPCI_QUEUE_OPT_USER_CTX; rx_queue_cfg.dest_cfg.dest_type = DPCI_DEST_DPCON; rx_queue_cfg.dest_cfg.dest_id = dpcon_dev->dpcon_id; rx_queue_cfg.dest_cfg.priority = DPAA2_EVENT_DEFAULT_DPCI_PRIO; + dpci_dev->queue[DPAA2_EVENT_DPCI_PARALLEL_QUEUE].cb = + dpaa2_eventdev_process_parallel; + dpci_dev->queue[DPAA2_EVENT_DPCI_ATOMIC_QUEUE].cb = + dpaa2_eventdev_process_atomic; + for (i = 0 ; i < DPAA2_EVENT_DPCI_MAX_QUEUES; i++) { rx_queue_cfg.user_ctx = (uint64_t)(&dpci_dev->queue[i]); ret = dpci_set_rx_queue(&dpci_dev->dpci, -- 1.9.1