From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0049.outbound.protection.outlook.com [104.47.41.49]) by dpdk.org (Postfix) with ESMTP id 72813A48A for ; Wed, 14 Mar 2018 14:53:34 +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=ZJNqKJlrFg1Ubg36jXKqpJ/TrUebCgHATqUlkuoYqik=; b=V/5imKjZqrOCZQfA+JjJ5hjX9DZgNFV6X60mcF+OVdvdx2hq/BrZaxPR6VclN2+kUNeRi7B5uK02GxK8PMZScl8W18Zi+YpuTRmi7PiFOAlIQBJGwxLVUGh9HV5LBi11Qy/OxBdekQflUBh3oPiMArdxAgzMiPjSk9tFf7cEvSM= 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.567.14; Wed, 14 Mar 2018 13:53:30 +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: Wed, 14 Mar 2018 19:22:31 +0530 Message-Id: <20180314135233.31282-10-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180314135233.31282-1-pbhagavatula@caviumnetworks.com> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180314135233.31282-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR20CA0005.namprd20.prod.outlook.com (2603:10b6:3:93::15) To MWHPR07MB3470.namprd07.prod.outlook.com (2603:10b6:301:63::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f877082-683e-4b70-3b6a-08d589b2f9a7 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:wNEtBVDm3t40Bchrp0R4Zq0zdecT9YzKiooN1WORsFXPqM47FnyCVXt34SNiarc2lv/ZY2oPrUjXuBFbmyBsCagwCFwYW2KpOUwuPGAET56t1XBdtwF0SV78fMbmFHTOU+ezwujZM5YQ7fsxXmtGmAkmrBm0t6L/nRdC1ZYdazt4FUx7ChHolI8UL4GZNrAitH+hnJS28pwQI6lqQoxS7fQYDnPWs+8xnLxhb+w1pqhZ95yDEISRE3Hje2AC6qSY; 25:U5zZ88x/sMivyxx/xnwDoxmZKN6TTVJbzqoateGXE8DoxxVPOwAvBq+3a3kY4/4V8SlGgC0fxAVVYzXh9FkxUeaGbtgkKZ9WVLY31FpLOHM/cbrSQjEMi7zLqlZ4xfYgWuwuDfko0k1gdoCKofdSF0+N4cDoh//bBhSR27W/7IG+M46Ac1LyecLNVnIucrlXHoTwhGlJjn/C+zmkeKJOMijHBr3fu7stLDIbNoAY7yix7wlrhIpwlUZqKonxJpr9iltTOo/Mef+YL3NHvAz+i1jOb49kIACJ65V7r8we3sOyqC00YCoZuzR35iNcMgwA+wW/mE20pYq1nRchD8mF0A==; 31:HVACt1kYFttfxkEbPBzIIm6QKuIH9veAuJ65oPt85fE4q8+UtTfzZj2b/cmzHvOhAPWHUrcu9R0+53nCscjGPkftjcjhPJGSx3TSsqmMxa4OPixBO/sZDDtzf38QfRoYb39oQ5NtzOkDUYhlM7QTYm66lmPcutcB+MQszc3iO8IWhyjnydglMt0XDBz++pIk+QkAz1CjFtzpUW/SaG2dxXEiRwSgLerfPnWNRhQTnUI= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:uqxWG9353xiWyLofCP39tvEXt7jbSHWsq1FwJJSnp0tzbWCPJvTrRCK8693j8ddWAJxcj88OWjisLN3l2PEPeK5GbJvnrL61sULi2cDf25g/OidTpVdt/Jz5o1cggHTfQtYwOx5JxFBB9rNZswMJIBmrHSdx1/MOUiFgyNb4vcJ8ODRo4E1cEPsMANIcPdJkJAAvy5oNH9MCvkYHNbN8Q9n2uziQO0xPAIaUQrOVXsZec0JBpIJV/G4T+gYQ7SDoFnNX9Jo7XRNnWgv7n9SgH90wA6lfVY/nEej5HI5WaH/oLlbQW5El68nev6A2bf777YAB6FdJ0NWDySlkNfgsyVNFWq2S2wIdOAfpDPXK/heoLsLMVBpNgV43rS389wxRh168jHXeFFxJr5WbcwrVWR1brr3ZrPpZighcAM2ocj+bFFFY3mLbtSthwlmWtUgi8jqHB0WOjG5ka1BawHvJe/fU3ZBqgW9veQrrMwbQhbhj7A7ohVbzw7Hb67SYc8aiNBVM3tv0lFq4FedVMLq1HDRquQkz/yRg4FWu+s2Eq5QOMiGJq6R4bDEB9vZFs8UTvoprvX0lsb1vQjFj4p46Hq3oVHrZyTOMOWtbcezGnOo=; 4:uO2w7LXciFkyaeUhRYwDS51t3d4NX6nMsschFucq1UmfhWbfNjrimswneS7CVQRsor4RJPIpOWgCbMAhErgU1s/Q0onCRWDIJ15i27WF5squqgXDzRWC67eDqPqvFqRjfBRdl8ioEhttCwl+8ZkC+Aq07kNl53rjotnu4CjRSCNP5wDRI+zLCIHnnl3eWlesrCBj014eZynm+snEo46hEnJD4pWrNEDe+iU0E1JkuI76TDZs0GAZODcMPTwKd+vHvTEQH5g+qC3QIRu4dHFS9g== 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)(944501244)(52105095)(3002001)(93006095)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3470; BCL:0; PCL:0; RULEID:; SRVR:MWHPR07MB3470; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(376002)(39860400002)(39380400002)(366004)(346002)(396003)(189003)(199004)(53936002)(6512007)(3846002)(4326008)(6506007)(48376002)(26005)(105586002)(68736007)(97736004)(47776003)(2950100002)(386003)(1076002)(6486002)(106356001)(52116002)(305945005)(107886003)(7736002)(69596002)(76176011)(66066001)(5660300001)(51416003)(25786009)(36756003)(50466002)(316002)(16586007)(72206003)(53416004)(1857600001)(6116002)(478600001)(8676002)(81156014)(81166006)(42882007)(2906002)(5009440100003)(50226002)(16526019)(8936002)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3470; H:ltp-pvn.caveonetworks.com; 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; MWHPR07MB3470; 23:9TKYKS3QY2igkQA9zFFJ4WNGaDBZk626D1/TsY0gi?= =?us-ascii?Q?eI27H0SX8K86+XHSYXGRL6JkuPfoxVfVF5P9rfpw9kMWnZoBv79OLBxkzb4x?= =?us-ascii?Q?ddfy4ELx+duZosmBDKR13BpF9jCEPvLpJm+XkeR1544GK+8hb4fCHaFfDHgm?= =?us-ascii?Q?npoUiV0Rah4xr5JLypLgsY/QQRbGDwDD9/EpvJhgvGy4eBH+2UMVkOAaL2Vr?= =?us-ascii?Q?xMQDhtHbPglzTXU22vLi8vrDJAae/57KiFbEQrXE9uWz60QvB0OqhHFXr8wA?= =?us-ascii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aM6MEjOMe7RNvbnhizsMbXqWyKwQaFvvpEiojm9979wa+ZtAm5nvM=; 7:mQ4NajOQ8kjOlvSWIRv3PMxBYSp6hGAVA4PdIWMJtGMO3oG/UOmAMHv9EESrC04EA4yUlJxY2ncF0245yx69e54qqADBuGiB9qN1R3FAMub2IGcOFR7LgZ7yC3taMqRxM/rkrDRyg2SdX5DpbFDrku1snZeGqncv5qghdNwDTq9QpkT8o2Fz3MspenWrJaDqKiWb3fY+VHhu4hbSZ3fb5fzS4TxtiR4B51qqtT4jA1b5pW+T+oVUXWDPWJ1iedDF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 13:53:30.8619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f877082-683e-4b70-3b6a-08d589b2f9a7 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 v2 09/11] 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: Wed, 14 Mar 2018 13:53:36 -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 43ec98ce8..abb03acc0 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 06e6a1588..813c9463d 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, \ @@ -208,6 +209,6 @@ int timvf_timer_reg_burst_mp(const struct rte_event_timer_adapter *adptr, int 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 8c1da246c..4f4469f8b 100644 --- a/drivers/event/octeontx/timvf_worker.c +++ b/drivers/event/octeontx/timvf_worker.c @@ -118,7 +118,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.2