From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0057.outbound.protection.outlook.com [104.47.42.57]) by dpdk.org (Postfix) with ESMTP id 4F5DD1B2B2 for ; Wed, 17 Jan 2018 06:24:26 +0100 (CET) Received: from BN3PR03CA0113.namprd03.prod.outlook.com (10.174.66.31) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 05:24:24 +0000 Received: from BY2FFO11FD040.protection.gbl (2a01:111:f400:7c0c::181) by BN3PR03CA0113.outlook.office365.com (2603:10b6:400:4::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Wed, 17 Jan 2018 05:24:24 +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 BY2FFO11FD040.mail.protection.outlook.com (10.1.14.225) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 17 Jan 2018 05:24:23 +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 w0H5O79r027272; Tue, 16 Jan 2018 22:24:21 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Wed, 17 Jan 2018 17:09:12 +0530 Message-ID: <1516189154-28331-5-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131606402641310185; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(39860400002)(396003)(346002)(376002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(5660300001)(53936002)(106466001)(105606002)(36756003)(2906002)(47776003)(2351001)(86362001)(97736004)(575784001)(356003)(305945005)(6666003)(2950100002)(59450400001)(6916009)(4326008)(104016004)(76176011)(508600001)(26005)(296002)(77096006)(316002)(16586007)(51416003)(50226002)(54906003)(85426001)(81166006)(8936002)(50466002)(68736007)(48376002)(8656006)(8676002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD040; 1:kmTEPUWWVl0UY4QGVxpIZC+YGzl7gRw5M2HJkOIb4K2x7nSI5tIA7ka8k1GLz/yah70iakzuRIOHiVSdMAvvXmVm6lVb4iOA09O0vwQiPj5vf5tE7MBOUzP5VX26AGKl MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 415b8c4e-ac8e-407a-31e9-08d55d6a9211 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:CvkISKlqRxa4rFmYkzaiGR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qhflZDlLWwBjeqTXNr6gsUT5L8il/RwitgxZdwFYYJmaD35lPR8NeCLlfjbe7e6VOfgPeRYhRu9TRps+5xpLF2jgGUieFV+R3SKNv1fGQ5qtPWHmHBkElAOgtlWgtbj62v85JICB37C1ZAgq0HM9pt0XECngJV7NgJKoX7LZs+8GN5jjVagenzn8CqqeIubBNsRhj2NaXfTozTjB8RO9uUT4918kn6IKRHRYRzcpfN6Vr49tlE6N4sTlPZtxoOr52f5AbmoaSXiN6JLfgNhBu8VrUMChV7N9BbVYqyu4w= 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)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231023)(944501161)(3002001)(6055026)(6096035)(20161123556025)(20161123565025)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(201708071742011); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0555EC8317 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:rB4WDPo95CQ0n6skmkUyYJcsQaFzRB4Dv+6KYPvMg?= =?us-ascii?Q?X/tQ0a9vRLpIdhoLsqs9MB8Bh665HxN2eo710KOsfabYDhrfDsWAetrA4b9M?= =?us-ascii?Q?nkYjX6Ek0TNpW+YT7Ip/CwB2R++FvQcZpDTr8YHBDUwU1H1Xz+vYA6VWQHta?= =?us-ascii?Q?a+LiIDSvqiLY+9umHR8BnDgU+aDBQcjtC22rYTJ+kH3Ai3dcuEn/WlOhR78H?= =?us-ascii?Q?55HCMwcq9LmjC1YMfpbs/FgPdRTROGpZJZdxdhUFe/YhmkBEPX2LY8fyQLJP?= =?us-ascii?Q?2HUcVVN/C21W3kMq3dKtHuaiq/ueEHyUlbKagyVnHN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PR03MB2694; 6:c4BhmEV79GUYky8m01HtPAc9hdRBBfNH+XBBM8g+tlPWnS1QQDDYmAtgv1Bnp9ZWBP+fr3pdaZTaFm6o837Kr31r25j5NZGs7kmApW/vLkgEdFUg/mDJ2qtWg/nQHH3pgXBWH8sAUiK/blB81HKx8axEMSam6kaNLsLfpAw/7Bgh7bIvE1AXQYbcCsFZWKJGmn7qbTkEz2BW4PcYkm+tiVq4pEVUy9cyJo1zHhY1tfrMU8eAAEqJOnIBTuU9lz5ScIvzEEu0IMusYYIGDJ6sk2ezZ3cV5AQQzyS5lDu5+zJU98IfHOYqF1C0gy5nMDRxa1+4J/hLWT9zYdgKNxf6zaehaNZ5OiqeJtyKBIGYE+g=; 5:DrnP7it4h24R+b/oZE7s8GIFBU0jP8KgryK5w6Uor+E+wk4cQPimusX2Y3m09vnDvIahIxAINPZ+8unU5fgCrllZzPkkagPp471ySWmJ1uESRo1h3LZ/lHshVErX6SjKe9ylagyZ23444+bXLOuviuMSZx3r5N6wvZryvOOHfLQ=; 24:sZ+DY8R0aO3GLfOU2KW0r8k5enc0uweOhX3a3nybR9ZCYl2H1xyVL3fauzJ40l7aH8LPZgyJYKTSX1STDSJu+5DgDSlbOJZ3NTn4UmHIfsU=; 7:EPH0MGiqNKVfxBbYaueGEHeY869Iaah96hU545dMYa3R9q6IhPaFeWcKZ0hxHmne4Zu63CYoDIqBSbaZcXD2NNIiIi9zk8EbN+j3NpHNz/vf8goHHy9lYlLBB5+Z4sz7WFHLxqdunY0m4NXdV+1wg+i9M6XYl5zGlflIBCkRksBX6aCFfbCxusoSSDNOCFznSuipX2g+o9oax0504Z1x5ccrw2FhLJ1aEj0P2uupe6KWNj1UItbrLahjnfI2e6KH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 05:24:23.9438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 415b8c4e-ac8e-407a-31e9-08d55d6a9211 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: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH 4/6 v3] 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: Wed, 17 Jan 2018 05:24:26 -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 Acked-by: Hemant Agrawal --- 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 | 18 ++++++++++++++++++ drivers/event/dpaa2/dpaa2_eventdev.c | 25 +++++++++++++------------ drivers/mempool/dpaa2/dpaa2_hw_mempool.h | 2 ++ 6 files changed, 36 insertions(+), 14 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index acc275a..8fe08f6 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -35,6 +35,8 @@ return rte_fslmc_bus.device_count[device_type]; } +RTE_DEFINE_PER_LCORE(struct dpaa2_portal_dqrr, dpaa2_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 b9dd063..09ec05f 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_dpaa2_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 c447b06..69d0fec 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -129,6 +129,24 @@ struct rte_fslmc_bus { /**< Count of all devices scanned */ }; +#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, dpaa2_held_bufs); + +#define DPAA2_PER_LCORE_DQRR_SIZE \ + RTE_PER_LCORE(dpaa2_held_bufs).dqrr_size +#define DPAA2_PER_LCORE_DQRR_HELD \ + RTE_PER_LCORE(dpaa2_held_bufs).dqrr_held +#define DPAA2_PER_LCORE_DQRR_MBUF(i) \ + RTE_PER_LCORE(dpaa2_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 65c2c7a..88dd930 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