From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0068.outbound.protection.outlook.com [104.47.40.68]) by dpdk.org (Postfix) with ESMTP id 7F2A61B171 for ; Fri, 12 Jan 2018 16:08:08 +0100 (CET) Received: from BLUPR0301CA0008.namprd03.prod.outlook.com (10.162.113.146) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 12 Jan 2018 15:08:06 +0000 Received: from BN1BFFO11FD047.protection.gbl (2a01:111:f400:7c10::1:189) by BLUPR0301CA0008.outlook.office365.com (2a01:111:e400:5259::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Fri, 12 Jan 2018 15:08:06 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BN1BFFO11FD047.mail.protection.outlook.com (10.58.145.2) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Fri, 12 Jan 2018 15:08:06 +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 w0CF7oP0020468; Fri, 12 Jan 2018 08:08:04 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Sat, 13 Jan 2018 02:52:59 +0530 Message-ID: <1515792181-11836-5-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131602432866608502; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39380400002)(39860400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(47776003)(8676002)(105606002)(51416003)(50226002)(68736007)(8656006)(316002)(296002)(16586007)(498600001)(8936002)(81166006)(81156014)(6916009)(356003)(76176011)(2351001)(106466001)(5660300001)(54906003)(6666003)(2906002)(86362001)(575784001)(104016004)(50466002)(97736004)(2950100002)(48376002)(59450400001)(36756003)(4326008)(77096006)(53936002)(305945005)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD047; 1:RcKYPWsG72B1/PULzK3rP8xbWPb08hUR5OPclAdll6YONdqMo8KeXOiC2YLKxtbspoancpLHKFVGaLWX2P84D2GePqv9SqEZ4uGBZfSzE+mnGwgr+nQbkDZWgPz6DxJs MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60d41a15-ac8e-48cd-6576-08d559ce490e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020083)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:vI4e5Wt3KHlY41DRe7PWyA+fQVef2r+qlAI2869w/ONqNMuEpkjH6ylm6LgWtdTsJmM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SvtAfh0kkKcuxiH6AaX2M2vjZX/XfM9eHbi36+gctHsMFUcbEqXJoY55vJtqx0J55Z3gct1rTABismWLR/4Cda9NSyFnErtjeIvk37F7Jz3rUp0obvDh126r0xBrzU/mKJNPT4vUHd7UqAe3cjECeDQIds5LHmB5i2I4KlyILOH3w0rOh07d6w1pROG3XJMqNB09kvJAEQrYDWaO7fC/l7ilGK1bY2pogIag2JiQPblZ6qfw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3231023)(944501144)(93006095)(93001095)(3002001)(6055026)(6096035)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703151042153)(20161123559100)(20161123563025)(20161123556025)(20161123565025)(20161123561025)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 0550778858 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:rLSSa3imsfykcNr6ZyYUvAyT9Y5SDP7Sh03wEfrFS?= =?us-ascii?Q?5B+2RutlMAmzBtf7gu76TGxNfHhwz5Qa2QkGdxfbjWtgA1SrtnI6KCV5SXI7?= =?us-ascii?Q?6vGSIKnvh4XPSdhEAl3DQ014m5dRfP36S3w4YMgATlc8dc0JxN6VB8hXufHT?= =?us-ascii?Q?Cdfyr6jLTVvr7i/aHfx2kSDMzpXCLKSF7jU8/UqMB3JEkwA4xo3w8rEyTZDS?= =?us-ascii?Q?FuKq+jRqpnx7BBfaUpS6D9U1i8IsuykYucvH3LrZpyWcYfEgcbKWHOOP948+?= =?us-ascii?Q?XXGLXIl4tJeSFKLiuCY03iDEz/bj0wO41A8fXReyMOlcT8aZq4/gRDVS19pA?= =?us-ascii?Q?GcQxgyVNFrZJKeyrr6xnlcOzJ96eRa1w5it0Jx8ZSyR8FupJzUAP+IGThftx?= =?us-ascii?Q?DyyGx1gA00sDo08qHCKZEQhg1+zqWa/ORUQI1vQwd/UxOEho70Z1z8zEN8Qh?= =?us-ascii?Q?tOkHJLLzh9JVdFCTR7U2Pxaj8HvHceRjSlydJNjpXFr/3VRetNbvrre+jz0D?= =?us-ascii?Q?zrGB3ZSf/d8CjC65BciLWTojH3aebXzlGzONwJgpGm8bwcpme39LJ0maM0F9?= =?us-ascii?Q?Lly7MvBN6T8BEc+A4vApBkuH233Fm4I1+4gRu+LfgjjuK6zlSzRfO6WgjLyh?= =?us-ascii?Q?N7EjRalKvBMAgwURfzlpPLm+5JlZodrAeQEOuoGv+b5X+5bqc2essrLRsGqv?= =?us-ascii?Q?cj7ARjaLirdAL1ekRp1aPz90yk7lxqq+R1z3Aoss+lZNVQGkMnEOOx1svH4I?= =?us-ascii?Q?P1484CA2B89S+5RP0Z/guk+IT0GKbP5sl1THLkU/WvlHeDCfWbeX8zsyKGj9?= =?us-ascii?Q?ZOphnT92dncOBmEQW/1JslMtfYzopff4D3RTYZMjGGIe2G690m1dxbJAbbNp?= =?us-ascii?Q?SoqeM3m2+iiub1F7fbPgtCGh4j6F0TO2lARVloYvEP+E+RMU4+880N6I3wPC?= =?us-ascii?Q?CJ8q5v3UUKS+oe/CY/f063YVSQ8VTgmU/X/JLJX2KsjMSYiYK/CiDuSSMN2P?= =?us-ascii?Q?/jAEC3qFD7+JnlGa6nGo+TcPK0nbUL/BQhwSTtcZdY/4DJYhDUTH+niRKDSd?= =?us-ascii?Q?0N9H9z53XFidOor2h6jbvnBJDw2BifrX3WfUwvP9kYBauOphK9DsyVT6NjeN?= =?us-ascii?Q?B/oORd1Tw1wOWzprLKe/c1F6Zz7f5xc?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 6:YBvuOeMzavdizANUN05CGH8H4vax6JVGFMU+QkUnxNtczBgm6x2a7W25E+DS9pXQAkF2Q+MyoFcjGqnKFGaTm0YkVRmh0tNcC+0uDtVqrMOdev5pFiWqTQTiv6gouRoBID22szV9QU4/8+y1D/ziCY1tqS2HsWU3DFeMfqwFISD8zEEN6yNjj954b2klj8ZCHUax9D6E2s4JgRpdXq3ww9t3h9f3pyllbMzJLoh/yWgZYyanACu4D1FOX7UyfdAUVeB9oKc1vwQwqS+6RSLXKkY7fgC48yEcDAWf9fcmnv/x4fcaySEvw365BnYtmSdBzADPuqmBv4RXK/C1V/MzN73yac2j/UQCoiC7MNYMqk4=; 5:9S07t+y5QoPRm6srPafobyl53gAgR7zJBgnwHghwj7JUpeEc1dVJsE8bud7i1wRWTE+3txSHQ4kgrzbQmivTMYpx6JR4b4mcA+nefTscx89hEx1C48ON2zLpaMSQQvkoboczraxhr5/wxoX1Fpj6iOmJWuY+aw9Y0xai/pKSew0=; 24:B4JfIlYC2vBP9eQWY/5B8ckcfhCQsP9dkVZxy2PNvIB+0J0kYwKQwT02z1SiFRiJj4aiw4dqj2U4P5YFp/DVkA+kF4EVRosvoFjqUT2qJ/o=; 7:5RIybdC0+qpeY1kE5PT6SUPSTA32f7J/KmRlDO38RQcXy69fzLD2MScJMWeZAMPKxYAGaruY/MrA92Tcarb2MxA3VS/319w+lLj9yzGizmfY7jsf/HxbkjAw2W8ujHG57BXLLFgEDlLejW5L0OrqcBTgT6bRqq+mQe8xLKV1DTrL6Imyb6J1MnVuQZvzEHtQeHaCr1jECVEa7uq0VHzJFT28i1fyprvlQ6XpCswScAIfG35IgiDw8XejovlJlCng SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 15:08:06.4580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60d41a15-ac8e-48cd-6576-08d559ce490e 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: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH 4/6 v2] event/dpaa2: have separate structure to hold dqrr entries 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: Fri, 12 Jan 2018 15:08:09 -0000 This patch provides cleaner approach to store the DQRR entries, which are yet to be consumed in case of atomic queues. Also, this patch changes the storage of the DQRR entry index into the mbuf->seqn instead of ev->opaque Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/fslmc_bus.c | 2 ++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 -- drivers/bus/fslmc/rte_bus_fslmc_version.map | 1 + drivers/bus/fslmc/rte_fslmc.h | 15 +++++++++++++++ drivers/event/dpaa2/dpaa2_eventdev.c | 25 +++++++++++++------------ drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 ++ 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index f0d3a6e..7024c87 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -27,6 +27,8 @@ struct rte_fslmc_bus rte_fslmc_bus; uint8_t dpaa2_virt_mode; +RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, held_bufs); + static void cleanup_fslmc_device_list(void) { diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 2e79399..46f1e75 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -79,8 +79,6 @@ struct dpaa2_dpio_dev { struct rte_intr_handle intr_handle; /* Interrupt related info */ int32_t epoll_fd; /**< File descriptor created for interrupt polling */ int32_t hw_id; /**< An unique ID of this DPIO device instance */ - uint64_t dqrr_held; - uint8_t dqrr_size; }; struct dpaa2_dpbp_dev { diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 17e0ee4..5b6b31d 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -95,6 +95,7 @@ DPDK_18.02 { dpaa2_svr_family; dpaa2_virt_mode; + per_lcore_held_bufs; qbman_fq_query_state; qbman_fq_state_frame_count; qbman_swp_dqrr_idx_consume; diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index 1524df8..71145db 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -128,6 +128,21 @@ struct rte_fslmc_bus { /**< Optional: Count of devices on bus */ }; +#define DPAA2_PORTAL_DEQUEUE_DEPTH 32 + +/* Create storage for dqrr entries per lcore */ +struct dpaa2_portal_dqrr { + struct rte_mbuf *mbuf[DPAA2_PORTAL_DEQUEUE_DEPTH]; + uint64_t dqrr_held; + uint8_t dqrr_size; +}; + +RTE_DECLARE_PER_LCORE(struct dpaa2_portal_dqrr, held_bufs); + +#define DPAA2_PER_LCORE_DQRR_SIZE RTE_PER_LCORE(held_bufs).dqrr_size +#define DPAA2_PER_LCORE_DQRR_HELD RTE_PER_LCORE(held_bufs).dqrr_held +#define DPAA2_PER_LCORE_DQRR_MBUF(i) RTE_PER_LCORE(held_bufs).mbuf[i] + /** * Register a DPAA2 driver. * diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 37e3e1c..76c2214 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -99,13 +99,13 @@ 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; + if (event->mbuf->seqn) { + uint8_t dqrr_index = event->mbuf->seqn - 1; qbman_eq_desc_set_dca(&eqdesc[loop], 1, dqrr_index, 0); - DPAA2_PER_LCORE_DPIO->dqrr_size--; - DPAA2_PER_LCORE_DPIO->dqrr_held &= + DPAA2_PER_LCORE_DQRR_SIZE--; + DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index); } @@ -207,9 +207,9 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *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; + ev->mbuf->seqn = dqrr_index + 1; + DPAA2_PER_LCORE_DQRR_SIZE++; + DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; } static uint16_t @@ -231,18 +231,19 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, 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)) { + while (DPAA2_PER_LCORE_DQRR_SIZE) { + if (DPAA2_PER_LCORE_DQRR_HELD & (1 << i)) { qbman_swp_dqrr_idx_consume(swp, i); - DPAA2_PER_LCORE_DPIO->dqrr_size--; + DPAA2_PER_LCORE_DQRR_SIZE--; + DPAA2_PER_LCORE_DQRR_MBUF(i)->seqn = + DPAA2_INVALID_MBUF_SEQN; } i++; } - DPAA2_PER_LCORE_DPIO->dqrr_held = 0; + DPAA2_PER_LCORE_DQRR_HELD = 0; do { dq = qbman_swp_dqrr_next(swp); diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h index 3390d67..4d34687 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.h +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.h @@ -10,6 +10,8 @@ #define DPAA2_MAX_BUF_POOLS 8 +#define DPAA2_INVALID_MBUF_SEQN 0 + struct buf_pool_cfg { void *addr; /**< The address from where DPAA2 will carve out the buffers */ -- 1.9.1