From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0085.outbound.protection.outlook.com [104.47.34.85]) by dpdk.org (Postfix) with ESMTP id 7B2C81B329 for ; Fri, 16 Feb 2018 22:37:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oMnVRBDCjiRpoW3HjqOWbC0AoqC25EsbKrVshWFsgj4=; b=VhbaVwhQrEoq2yu+6Jy54CHI2c6heHMdxWgYjxnqwXnPjLgYHEftza630RTeUYblPzQr4gUiwu9KFBF81D/I3NKqOlgmMpoMVwPfuFVCWlt7j13BnwR9YCJZmGuBYNzWFtc3EndXqTCGy83v6IExMgGK0Byo9yXqCYV/9Fh9WgA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (2603:10b6:4:67::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Fri, 16 Feb 2018 21:37:51 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Sat, 17 Feb 2018 03:06:58 +0530 Message-Id: <20180216213700.3415-9-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SG2PR01CA0090.apcprd01.prod.exchangelabs.com (2603:1096:3:15::16) To DM5PR07MB3467.namprd07.prod.outlook.com (2603:10b6:4:67::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 037ac828-7719-44f0-4d47-08d5758588f9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:2AFEb1u7Zw/0AYbAx4l/l4/OZdcXdb084/Bninm84fxYxnVcHLBIssbjSAlHcqGuctPnAty6kLaRPfroPCgQ6ozSyd4xNt2UKHsS93CU3qU9OVDFO32NrtlazSe6itGZlk917O3+VJ2JjbuS7+82xZlM6JKC9hWt+CdozBBrUA5Z79TqJrhmF6a946r6uGozNH+be+U1VCRpFJE+fbHdpjxb8FQVjHRUhGc7KvTX38ZJ6LAXjbJ0O1geLJWGubUD; 25:CPbkcPE2EU0ucYIk1/1ZqtvQvjFYarlX3r6g8Q+WHAiP0f3oR1/9IzGNVFKn5e/pEPaya45tWPhRbsl83VtB3XahUu8nnvWtEDr4ZxsXolziONwyUc4Bn6Gp2GEwivKcigjpkTYXJp0Ht1CHUz9sSknHdJMtOS3MEZCU/RfWj41IuhNfRWw8sIvjBRzdFDQljwAd44ilcE83Py5JD8+Qld+SGtnR2A6s6sMLUqnPHtz3D+EKDrRHX0MeJccm3UIBYyajmNIemiUctGM5XK1put52l5F8BlVrQ4B86bFhZip0CqTLImbzLMS3p4fnQaWuz42PN7ULuGs5xi61KV2+9g==; 31:HNwDKyNGj8tDnl4teXhXyViMZjooKIo5KL1difBVgaZRcbUs77RzgWXKafwbcXaU+pULvCAPL9ZQwhewVQeGnHRDo2g5zpB5S0Jye1PccC8wgf+GlMOh4boPvmYCYcO56Rzsobb+QzajUxaYXhSZ2JLcSu4laOpZe9TycWuJDQC0RO9Qh3VofJOD0vxc/2DFFf5mFuEl5aer92XaxdnVRfrbUlKw0SqsQnTve5nMGnE= X-MS-TrafficTypeDiagnostic: DM5PR07MB3467: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 20:fCORfyTEC4gDGMYrP/W9j8oSJFmoee/lMMsljk2Fi7eHi3p0StVa42Miaz+Gm+N+2qjbyw5wb16+GBUr6N7Csd6HQhP+/EuiZ+FLr4AZm2oF+ISrBoQl1DFlHlRXOC5sDIejjywAZWt7yVXAm3fZCir2O1YpPtp6b8+vQrMhJCylTKA882Bd1MPa1faQ/FFNwhnOWjzzXgku4zVtLhkFK+JFiOAIhzay4+rHHdfjMCOvUd5k81BMzSQpOqFSbLqBZ7KixoKY28wNJeawXuAgV1KOxhBfk3KLfVCt+KIvllv4kLiJ7qNPDQtiyu8LmhY4z0qNFsfFqJ3X46QjbD3QN903FiCWB1iG7Xcw89eH7AK55MV6wbqRmxeN0xauEQvr7n0W2qaqz26zoj+xFsqwwVwZ084KCquJGbIYP0xv6QCQUCZuebhmLxYcatNdvLuvYnzLzMLNF3LS68GP54VrFf8B6d4nlxiSPMNJtxmSIvpqSWNiIspv8n+X+TqxB9z0zQ+Vs+7sgPzXA/oSjPUb5B0Hyg6YN2PLPn6uIsTBLmbZWdHxz6domGbEqlR0S6jRaaoihGe4FRxshfOHeO/nQz8JO6FVV7STnOQa9t5FePs=; 4:rNALVfW4ysgVQlMTiKJNjhNKw/+vv8UIK7Bvo++VftyqHlfX+goVTFYMbQEL1HpNLCAv0n2xEO6jMU+DMMQmtMQsopBLyzQuxNFUlO4VPuvdB1V3cwxc4INllxleIZpYheq2pTqwj0FKDn0Nyth1yn9nht6runyoAUEIquw3enYjibqsAk0199Hr8P/OFUagFL57GBT+nXdv2YIxjNuPMX0JnzT29w0MwIVRaeCjJMIlHu7YVu4+Xu04wZAohMyGSfFHhpL0fHEpd/JhF7RW1A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(3231101)(944501161)(93006095)(3002001)(6041288)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3467; X-Forefront-PRVS: 0585417D7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(396003)(39860400002)(39380400002)(376002)(189003)(199004)(6486002)(25786009)(2950100002)(386003)(6506007)(53936002)(42882006)(5009440100003)(4326008)(107886003)(59450400001)(6512007)(16586007)(106356001)(316002)(105586002)(36756003)(478600001)(2906002)(47776003)(6116002)(76176011)(3846002)(1076002)(97736004)(66066001)(8676002)(51416003)(50466002)(48376002)(81156014)(5660300001)(68736007)(8936002)(52116002)(16526019)(26005)(305945005)(1857600001)(72206003)(81166006)(50226002)(7736002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3467; 23:LYNsIKclgrK2SYVowsmavFG5RONrj444VclctIwpF?= =?us-ascii?Q?1zEocd5KwVH324v4gugRoc6igYpI+Bqc/FMnM4lgLS24QMl1ms3Jol0mLvPL?= =?us-ascii?Q?ZyFLmkS85GFSjQrJpdAcPW45ZGEm2qQw5mM+MiZDx2IfbuO237yoYSVXsOlA?= =?us-ascii?Q?YXhN4VcalrceSdARJAsGCF8TdELU7+ECNmA0qvT4cvl14MwbUpcGz5QI2asK?= =?us-ascii?Q?se4vSS6uBaTHe8GTShGbr4OcGY8ex3Z3tKB2jxwssO0InJLwa97bydhcR34P?= =?us-ascii?Q?R+W7BvrJgoN3590NbWmS3eM2/SUdjlp08kfO6P6Qa0zdOx1u7xZWKiB+Z7JM?= =?us-ascii?Q?MEM6drENrvxi+EdU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3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 6:1LRUHvA8MVQei9vo7lVJ0Cy4WFO83dVwl9fz1NZhdAbNsC+4rB0/dXFHA9KdBliOmm913op7+paYJBSHfvxxVffeYBGo6B/21Fte2uYvkLNeb70hCVXzWHPtchb6h3aKxOtELO0GTe+BthAuLwlliG6LEyZp7rMTwXxFi8P0yceEsHX1aWyjlj+7XC7x3mmChdQg1xQAsvqbOnY7H8YEEpbL2LTPWqEa1oXneCaVZ05vGZiJ99n47irExCRUo6nCsmWKHm1zKcFjyBfFXHz0bFQY+Sf/IrqfhItosEtQ9JhIP6KPBxTefxIs19ucLcLCL4ejak5/rHU7FfG32Jt4B5G9kyMg/UFchfT2C36bj2k=; 5:r5NxAtSnBe11+d1ZkiHsmZ5Bf7zCOkdgd+Z0pvyk365HK1OMpxG16TPCOF+0QS+DemrINyBmU6IErttmRlxwdX0k4O//nKTz1P7q45P2C6NfYhbvzOkgb02GUX8PG9xpjXKDbzKryOb4l1kzx8YrfyO3dKGIscls4RKxZkCXiP8=; 24:sMW1ehyQYVvyVUmGFwAKixUt+l27uebBVE3r9q6hIh92OVLIY8+xXPZ+EPZpy5kCWRxfm58RN6jgstVEodwiKpXuddjRdMCmoZ3NAxBhJ+s=; 7:hNXKV+QZZrFFrWvPEN8AYC57fzSl30b2LVHGBI1uyCB8UfohXddC+bvwUZb8Jtsfo6PXMR/dbnK81QnDyT+2m3P+psmFE885pPw1lAiFriz7IScFgBeSc1IEkdKVAphdHL05GBEpogppbZ9h+qG5z1OUQXdlhYJ0h7oN+vrHdmd1TDrw2Hhkjoe6CiAhT4rLdlAHMTnzyKqbQ9ekXWXsSai94vxwbNDOayQQWou7AsAAHsVQ6brXGUC5GbcAzz7Z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2018 21:37:51.2401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 037ac828-7719-44f0-4d47-08d5758588f9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH 08/10] event/octeontx: add option to use fpavf as chunk pool 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, 16 Feb 2018 21:37:55 -0000 Add compile-time configurable option to force TIMvf to use Octeontx FPAvf pool manager as its chunk pool. When FPAvf is used as pool manager the TIMvf automatically frees the chunks to FPAvf through gpool-id. Signed-off-by: Pavan Nikhilesh --- config/common_base | 1 + drivers/event/octeontx/timvf_evdev.c | 23 +++++++++++++++++++++++ drivers/event/octeontx/timvf_evdev.h | 3 +++ drivers/event/octeontx/timvf_worker.h | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/config/common_base b/config/common_base index ad03cf433..00010de92 100644 --- a/config/common_base +++ b/config/common_base @@ -562,6 +562,7 @@ CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV=y # Compile PMD for octeontx sso event device # CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=y +CONFIG_RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF=n # # Compile PMD for OPDL event device diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index ffdfbb387..386eaa08f 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -162,10 +162,27 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) 1ull << 48 | 1ull << 47 | 1ull << 44 | +#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF + 1ull << 43 | +#endif (timr->meta.nb_bkts - 1); rctrl.rctrl2 = (uint64_t)(TIM_CHUNK_SIZE / 16) << 40; +#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF + uintptr_t pool; + pool = (uintptr_t)((struct rte_mempool *) + timr->meta.chunk_pool)->pool_id; + ret = octeontx_fpa_bufpool_gpool(pool); + if (ret < 0) { + timvf_log_dbg("Unable to get gaura id"); + ret = -ENOMEM; + goto error; + } + timvf_write64((uint64_t)ret, + (uint8_t *)timr->vbar0 + TIM_VRING_AURA); +#endif + timvf_write64((uint64_t)timr->meta.bkt, (uint8_t *)timr->vbar0 + TIM_VRING_BASE); if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) { @@ -296,9 +313,15 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) return -ENOMEM; } +#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF + ret = rte_mempool_set_ops_byname(timr->meta.chunk_pool, + "octeontx_fpavf", NULL); + timvf_log_dbg("Giving back chunks to fpa gaura : %d", ret); +#else ret = rte_mempool_set_ops_byname(timr->meta.chunk_pool, RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL); timvf_log_dbg("Not giving back chunks to fpa"); +#endif if (ret != 0) { timvf_log_err("Unable to set chunkpool ops."); diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index 5e526a36a..02bd99a34 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -24,6 +24,9 @@ #include #include +#ifdef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF +#include +#endif #define timvf_log(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \ diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h index 320eb6ac1..c3f37372a 100644 --- a/drivers/event/octeontx/timvf_worker.h +++ b/drivers/event/octeontx/timvf_worker.h @@ -144,6 +144,7 @@ timr_bkt_clr_nent(struct tim_mem_bucket *bktp) return __atomic_and_fetch((uint64_t *)&bktp->w1, v, __ATOMIC_ACQ_REL); } +#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF static inline __hot struct tim_mem_entry* timr_clr_bkt(struct timvf_ring *timr, struct tim_mem_bucket *bkt) { @@ -159,6 +160,7 @@ timr_clr_bkt(struct timvf_ring *timr, struct tim_mem_bucket *bkt) } return (struct tim_mem_entry *)bkt->first_chunk; } +#endif /* Burst mode functions */ static inline int __hot @@ -241,7 +243,16 @@ timvf_add_entry_brst(struct timvf_ring *timr, const uint16_t rel_bkt, bkt->first_chunk = (uint64_t) chunk; } } else { +#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF chunk = timr_clr_bkt(timr, bkt); +#else + if (unlikely(rte_mempool_get(timr->meta.chunk_pool, + (void **)&chunk))) { + timr_bkt_set_rem(bkt, 0); + tim[index]->state = RTE_EVENT_TIMER_ERROR; + return -ENOMEM; + } +#endif bkt->first_chunk = (uint64_t) chunk; } *(uint64_t *)(chunk + nb_chunk_slots) = 0; @@ -355,7 +366,18 @@ timvf_add_entry_sp(struct timvf_ring *timr, const uint32_t rel_bkt, } *(uint64_t *)(chunk + nb_chunk_slots) = 0; } else { +#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF chunk = timr_clr_bkt(timr, bkt); +#else + if (unlikely(rte_mempool_get(timr->meta.chunk_pool, + (void **)&chunk))) { + timr_bkt_set_rem(bkt, 0); + tim->impl_opaque[0] = + tim->impl_opaque[1] = 0; + tim->state = RTE_EVENT_TIMER_ERROR; + return -ENOMEM; + } +#endif *(uint64_t *)(chunk + nb_chunk_slots) = 0; bkt->first_chunk = (uint64_t) chunk; } @@ -438,7 +460,20 @@ timvf_add_entry_mp(struct timvf_ring *timr, const uint32_t rel_bkt, } *(uint64_t *)(chunk + nb_chunk_slots) = 0; } else { +#ifndef RTE_PMD_OCTEONTX_TIMVF_USE_FPAVF chunk = timr_clr_bkt(timr, bkt); +#else + if (unlikely(rte_mempool_get( + timr->meta.chunk_pool, + (void **)&chunk))) { + timr_bkt_set_rem(bkt, 0); + timr_bkt_dec_lock(bkt); + tim->impl_opaque[0] = + tim->impl_opaque[1] = 0; + tim->state = RTE_EVENT_TIMER_ERROR; + return -ENOMEM; + } +#endif *(uint64_t *)(chunk + nb_chunk_slots) = 0; bkt->first_chunk = (uint64_t) chunk; } -- 2.16.1