From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41]) by dpdk.org (Postfix) with ESMTP id ED36A1B7B0 for ; Tue, 3 Apr 2018 17:06:07 +0200 (CEST) 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=HoR1OgxfgBer4g7aXI++qqtcrB7C2LHpbGvjGGlCAmc=; b=AkLKjByrHDhGOT0oa0KBQJp4WI2Z60zrsNetfImVUE6Gi0KyWNG+EO6dgIuLN4+UMgI5AgSmJjpc2HPGoVy6O6EmG7Kl0+r+/JnoxLEDQi41gBQ+CD22kLOZTs+vM+HljeQA8rfX+s7SEYax0J2zPpeGcz/uO2gM/q6EaEoMIfI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn.caveonetworks.com (111.93.218.67) by MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Tue, 3 Apr 2018 15:06:04 +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: Tue, 3 Apr 2018 20:35:12 +0530 Message-Id: <20180403150514.24201-11-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR0101CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::32) To MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34b4822c-ac70-4caa-ddd9-08d599746cea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:MWHPR07MB3470; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 3:TnCvvn7yStcce8p0o+cQQdPHGPBoSb+Tk+ptjASSzXtQdKXvwM0f+rUgH9AHDIOD1KuD6ymPJiENIJahQRA1Sg7isUAVvifZv5dE8K7SYIHHStuguQLsBuG0yEAVN6j/wtKjeDI4lYUBdONeB/rCRcYMndSYPrEONjPHUc//pQYQVm++b9Y2F8jNeBmSubutOpx+ITkUIMlEcfGJJAS+zvVxusygt9Yyq6t+rDsRcFZQwiSqAXXcojoxW+tDYl6e; 25:O4c8WxFKY777n6RIvP7tm+vwMms5bbxpIXzFSkdyjCO43MaFTdEWue/62DCDYzNw1hl9+XExv3WbSlcLzqGlarRIE94uup3gGGHywLud8YVaKBvmH0wZteRsVcAEd+55cDLQFylNYZsJjkodWf/h1ZEK5Aj8jI/RePrI7I3HcHul6AAa5gogiJk4RDYZuCWMLE3cbLfE3jVACdkTDeaIlKe8LryXwHQMshIXarrgtiDmDO6+DTK0BrhrhZU9kZ583oiPjbwRGcpYhVXhTptcX7cxYdD8UBwCF55V5pNOzRauqQf6goE08aOIeSs2dkKTqv3Es4CSdubAuYFSxSWrIg==; 31:Y8FdukyqW/7KVBOoIK4JEoVR2W3/B9+7ZFjg6GEFDen6wBljY8LX/PsHLcp5qMGYhEw/jWUa+/mRC/o+LWe4MZ5pr5FB+r1xIGJD7P6CuZCHK4v32PYDfcwyxDTEbTU55dIn8VUnn3Y3LOK1coAoQaSXGld+EhJ1CuMCLae61eA/KqP46iQaayLVlTu++Ui4onK2x64/km5tXsT6U6DIEYh458KnVTJfnixeKKWNdIg= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:iB6JxoKUNsgxfmd12q1pvKQjjb1QCGSHKVj2UDwqnXN8sjwZkiQBj2bb0ebsh8oRlntlRe5C2nAFhZVltzViMkN0D56E7XPGSdR4b/vb3ZJw8nJti0NVwBZanYT9Vdmaor0bNvdTT8P2VsVRRsGu41jzzz0AD1Qks3vJ+xls6MnpM0/HAKUHeaGIIPWIIxD7m0MrFSLci+4UnzAFm90smHJuXbetSxb4Vb/lKt4niuYEggXR+GBfx4YPacBNX25UZLCeyLIAMFECeAIQ+uBnhS+g/GH2Cshd8SgUcTTvCRzjjXrRoB7Ywb7BEnY1JI3+nYfgF3Vw9BX7+3Kxz5yep+eWsxtcyLeYddKxbiTbkXhJWMKrmlkW5Xu7ISqRgU+hmRt9k6fsJ3L0MmkXzzdXzmsskyEZ2cHccJWAHtHP1DS7ZjWV3v/FTO4uYfkLTysFysimv/mkZiMELFxdKjBWkbzMipKR0DVOsHnTUZGODZ1uYLjW8qhOB/HoXau9g3i4Wq0wloAm5o/Ua/s4jbhLxOVYSKQmiPX58u3yHNux8JYrm4ktnMfk2QRFF8a8oCirCzZGE9xtVuHdZRgJnrweOXH83Zx+SE/QtdSUUh2Hnho=; 4:+rVt1ju4UuGHC7OM3PKDjvBy5PAdJcAX1NSiESYAxfUgXWNVK+nAFfFGm4Eiznm3Q0JwkCGlNXLhwYc5PtfuNUt9dCILIsnjCijaVTUTtC32acve47GJxk0BSWGamDd766JNCk/atqNMg1SKSGZkNqCLIgFIQunHiQIUGapYZo6MNHqhEUC57FCVIx9IQ6cAdgFzstVIZo5dTNT4X/cGXcRVvDGtJ9AeOmaY/a7n3jBGm9C9T9BRqSSADtgBYukjEkSyf3f7HSIfVNzki4eA5g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3470; X-Forefront-PRVS: 0631F0BC3D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(346002)(39850400004)(376002)(366004)(189003)(199004)(47776003)(305945005)(66066001)(72206003)(386003)(6506007)(16586007)(478600001)(316002)(48376002)(7736002)(76176011)(36756003)(52116002)(51416003)(5009440100003)(50466002)(68736007)(106356001)(4326008)(25786009)(486005)(476003)(2906002)(107886003)(6512007)(11346002)(6116002)(2616005)(53416004)(26005)(16526019)(5660300001)(6486002)(3846002)(1076002)(81166006)(81156014)(446003)(956004)(486005)(69596002)(8676002)(6666003)(97736004)(42882007)(50226002)(105586002)(8936002)(1857600001)(53936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:ltp-pvn.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3470; 23:lhLcRxikkT6K9TCmTnuO0yT0jJzXCnRgsmitTNUAc?= =?us-ascii?Q?Grm9U8QzG81iRggcxANgnakdKHS5VMyfSb1jwZ69Bujxz86b3w7C6PdV8qqc?= =?us-ascii?Q?vsaqCD1zs4bYZI8OlT7FHfNfir/cTxRP+nthKq8C472nYVEAeHzrgE49nqfg?= =?us-ascii?Q?OrxjoC5FQlDGWFo5gJVFQz/xEt9M+dC9WMUBXfeyRTGGbzdpvtKxHY0XPhKk?= =?us-ascii?Q?slT6j4Mby5Pxo2nRElt35kmqbI4WfHQctf705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a2YUOyzJWTzi76gQOSIeseQyNjTs3gnZjoNpvD9ElD+IIweLS6ZvYUA3pX3i10EHXeNod3XpOTMG08aaXGoibe8=; 24:RIyHsD10zDpnhdVTlU+z1dNBBl3Siivahjxt5Z3gfGA/BUbxymeSlreXIer+sv9Wr4CYdbJ9Vb4eL6u4+w3e5I8p3vGz+bll76vLOCOZ4tA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 7:JpJb1YgMQfBQtTeXe/dUSc2al2dbdTmZEkjO57QqU/3683ny2nL7FD3duWKIOoAQ/Mwqw1zwTJ2bVwJkwCLvbanilQ773KJjD7VcE1Nn7H9659+DLnq6Y84IlNenPN/w2AJROiD++5uqDFKq93Iw6hGmC8fi1PWEdWaowJwBp1uTm6sES74P4kEs2I+41r/yPdLGiNeL7ij1juUDzkaOnOZh+DDMMMtxmYBouKPGEws3DneszLRnpGH7K5rXhCI1 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2018 15:06:04.7255 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34b4822c-ac70-4caa-ddd9-08d599746cea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3470 Subject: [dpdk-dev] [PATCH v3 10/12] 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: Tue, 03 Apr 2018 15:06:08 -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 --- drivers/event/octeontx/timvf_evdev.c | 22 +++++++++++++++++++++- drivers/event/octeontx/timvf_evdev.h | 3 ++- drivers/event/octeontx/timvf_worker.c | 7 +++++-- drivers/event/octeontx/timvf_worker.h | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index d1f42a3bd..75dd5cd65 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -125,7 +125,9 @@ static int timvf_ring_start(const struct rte_event_timer_adapter *adptr) { int ret; + uint8_t use_fpa = 0; uint64_t interval = 0; + uintptr_t pool; struct timvf_ctrl_reg rctrl = {0}; struct timvf_mbox_dev_info dinfo; struct timvf_ring *timr = adptr->data->adapter_priv; @@ -151,6 +153,9 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) break; } + if (!strcmp(rte_mbuf_best_mempool_ops(), "octeontx_fpavf")) + use_fpa = 1; + /*CTRL0 register.*/ rctrl.rctrl0 = interval; @@ -163,9 +168,24 @@ timvf_ring_start(const struct rte_event_timer_adapter *adptr) rctrl.rctrl2 = (uint64_t)(TIM_CHUNK_SIZE / 16) << 40; + if (use_fpa) { + 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); + } else { + rctrl.rctrl1 |= 1ull << 43; + } + timvf_write64((uint64_t)timr->meta.bkt, (uint8_t *)timr->vbar0 + TIM_VRING_BASE); - timvf_set_chunk_refill(timr); + timvf_set_chunk_refill(timr, use_fpa); if (timvf_ring_conf_set(&rctrl, timr->tim_ring_id)) { ret = -EACCES; goto error; diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index 22c8c2266..96fd33ee2 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -25,6 +25,7 @@ #include #include +#include #define timvf_log(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, otx_logtype_timvf, \ @@ -209,6 +210,6 @@ uint16_t timvf_timer_reg_burst_mp(const struct rte_event_timer_adapter *adptr, uint16_t timvf_timer_reg_brst(const struct rte_event_timer_adapter *adptr, struct rte_event_timer **tim, const uint64_t timeout_tick, const uint16_t nb_timers); -void timvf_set_chunk_refill(struct timvf_ring * const timr); +void timvf_set_chunk_refill(struct timvf_ring * const timr, uint8_t use_fpa); #endif /* __TIMVF_EVDEV_H__ */ diff --git a/drivers/event/octeontx/timvf_worker.c b/drivers/event/octeontx/timvf_worker.c index f4f40d150..26ec4cc74 100644 --- a/drivers/event/octeontx/timvf_worker.c +++ b/drivers/event/octeontx/timvf_worker.c @@ -152,7 +152,10 @@ timvf_timer_reg_brst(const struct rte_event_timer_adapter *adptr, } void -timvf_set_chunk_refill(struct timvf_ring * const timr) +timvf_set_chunk_refill(struct timvf_ring * const timr, uint8_t use_fpa) { - timr->meta.refill_chunk = timvf_refill_chunk_generic; + if (use_fpa) + timr->meta.refill_chunk = timvf_refill_chunk_fpa; + else + timr->meta.refill_chunk = timvf_refill_chunk_generic; } diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h index 9dad5c769..39ce4535c 100644 --- a/drivers/event/octeontx/timvf_worker.h +++ b/drivers/event/octeontx/timvf_worker.h @@ -201,6 +201,7 @@ timvf_refill_chunk_generic(struct tim_mem_bucket * const bkt, nb_chunk_slots) = (uint64_t) chunk; } else { + bkt->first_chunk = (uint64_t) chunk; } } else { @@ -212,6 +213,28 @@ timvf_refill_chunk_generic(struct tim_mem_bucket * const bkt, return chunk; } +static inline struct tim_mem_entry * +timvf_refill_chunk_fpa(struct tim_mem_bucket * const bkt, + struct timvf_ring * const timr) +{ + struct tim_mem_entry *chunk; + + if (unlikely(rte_mempool_get(timr->meta.chunk_pool, (void **)&chunk))) + return NULL; + + *(uint64_t *)(chunk + nb_chunk_slots) = 0; + if (bkt->nb_entry) { + *(uint64_t *)((struct tim_mem_entry *) + bkt->current_chunk + + nb_chunk_slots) = + (uint64_t) chunk; + } else { + bkt->first_chunk = (uint64_t) chunk; + } + + return chunk; +} + static inline struct tim_mem_bucket * timvf_get_target_bucket(struct timvf_ring * const timr, const uint32_t rel_bkt) { -- 2.16.3