From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id 84EC11B7A4 for ; Sun, 8 Apr 2018 10:10:06 +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=j63iwJKeOOdpFtYJxKE2Lu8h4MrjlfeI8835RPKldmg=; b=dBiMXSp0ZMdW3+RNkh5oIU55JVSd1iKUS629XD/du7fzijdUzSreJQT/IXCenJUkKvewi8KHILx4ZwLuN+Hi/HyIk30aHYc0Rd2taEnEpqRjoSNgYKo/VTLxPy4k70d7fXf1uS96EXeUOGQ7xgJCdWWTRyIBtDrZUL8XgVsyGhE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (122.178.210.9) by BN3PR07MB2513.namprd07.prod.outlook.com (2a01:111:e400:7bbf::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Sun, 8 Apr 2018 08:10:03 +0000 Date: Sun, 8 Apr 2018 13:39:45 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com, dev@dpdk.org Message-ID: <20180408080940.GF6880@jerin> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-10-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180403150514.24201-10-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [122.178.210.9] X-ClientProxiedBy: MA1PR01CA0112.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::28) To BN3PR07MB2513.namprd07.prod.outlook.com (2a01:111:e400:7bbf::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1f4b5db-53b6-4be7-ceb3-08d59d2822e4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603328)(7153060)(7193020); SRVR:BN3PR07MB2513; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 3:G/BdF65tnx4N7TWIOxdQ3PVK5PgTWXiJ/aAhTMvWLEPdLybfxwtpQOHmgdXwbfN1I/2XCjLF57W7ZXsSkdyTql7cWBmN1FLGfQFc5r4YnRz4H/ZTT5wEp0e/1d3/7r2Sbh72RZVHpD8F7YH/PuJ6+Da/JhD2cSMlhr+Pr6IXNQQ2bG2X3YTTX4mReTyfZw25OPvjWND8UhbbC8SajN+vz3w1a0xZlpC/8WNwE2k+9tgh/+amQJ6hP61YHagSiqtX; 25:FTQnTbYz0aOo1otmpDftuEFBO5r8geZYgtOWrh6s1noNpJpwkYjqCx7YyiZTrTWYZtPLx6AHIMWT1fPd3APK47/iNGQ8dsuzckyf4/+zOQrCr8+aCOBRzneHOsvRlAtQUvqpAS7ysys/LvGCpRkIFfrwg3G27LG+nnaTHJ+3zP1wJJp+t7BwceQ4xRyzp+vCFNgmP91Opj3Q58ARa795k0TDYNZAW2PtedlYIYjWqRVTmA6stRHsRI5YqsM2s4zqtkT0goUhWZlxgPsyDh8n41B88AiMqrljZevN4+hwua65xg9JWvbHbm2IfGzIaIjdnr5h2tDnAcNPxTlmN8UbZQ==; 31:lf80oj3t3maoNGpHTuUQi18LVUXB00ugrXQ7Vo7Y6OkjtTqna0fosgSewdx28mYi0daA9N/0lluWs/tC/EF/Ny2ddjseIXAVW1V0o9kbiYdNh3twQ3/tmcwe+fKsDWLUj+u2Z9bEzRi9IhnXRlLKdeAC7cqfYyVldaEtX98FZ2ZfdEzSnYst5KrHJIkNNGuwW8sYzbrYn16n8GphNounC35y1msIKipNSja6MmiFMSI= X-MS-TrafficTypeDiagnostic: BN3PR07MB2513: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 20:RFVCLcF4628HGMTyO+Fm7YRGkz89mQ9ni+MB73CeKoc1EVGcPAD56KEqmhZFgqZdTBMnTJ7TZoo1FJrhapvzEOpsvrPwqmauMVmouPPptsPxUQVJ7DPAUoZ98WzyHhKSrcn2tbEBUEvy0SilHGTtqdApM80NTE7Djq/oOs659nmcAWc8NDJx4z2UPDRj4RbA0M1VCe5JsS0ZucJfr2mOqjbGNNQHWiCYzbeXcefaYMpHdyokXrvADU5yvZrcbxBttl7oXCcuyp4bpQoYGYB6/tspWy1mMJmk6/5wQLXOvFtLwhm1ykqFgOYcCbQSvusDgCYJ1cqLy0hLAgsOXJoVDNy8nEJdBJL8IhyJwDzg3n/u+csbU4KzAQjGpTRXw6FONf+p693DK1DsLlSxgfOvp/SXNznkLENZRlkKxmacxflaKUOlMJwTWybvUOHcLwlGUd0CRRT5ZoRvb2ySXjva/9wM+ijb4PY/Gv0o8p5RPGXIfIM2RT/yP+Qe3m6isDINDIv9Y5SY5YPjIHJgY+NrlXODGjSwVWMMBL5YDd82IOk30Fvvpeqk2XLC7osUDnnYvd31TTghseA3YbW4ij66/6/ez140kNFcPzwwIpRg//g=; 4:nMTzf1h782D9W7/CASVWkMTSzhAT81WRGdf7ZFw/U2Qy8MVAM6v2cORMV92tVRfu9zZf+rs9GP01diE8bS7wluutOxhGr8gVhwIkJkglrCqAvQn499vFrFpxfIuJdWnEEakJnBwQKHFzhIY3+2sEoJawknBWgbrb3M2fhxI5eY+Z5YcVBsFLFcaAT1Z1ECRFFCtegb1NaD3yaAHvyjG0jDbynLAHEcLjK2Ved0KANnhuJxnc3swXNZamB7hYYm7ALmicb3P1kME78rAM6AsGhYrp206yuNFoYc5NV7vGPSqOK8sPqPO35XIOswbHHmDi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(10201501046)(3231221)(944501327)(52105095)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BN3PR07MB2513; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2513; X-Forefront-PRVS: 0636271852 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(39850400004)(39380400002)(376002)(13464003)(189003)(199004)(316002)(3846002)(23726003)(66066001)(1076002)(478600001)(6666003)(2906002)(6636002)(476003)(9686003)(76176011)(6116002)(6862004)(47776003)(106356001)(8936002)(386003)(6246003)(25786009)(42882007)(53936002)(486006)(5660300001)(4326008)(50466002)(33656002)(7736002)(956004)(446003)(68736007)(16526019)(305945005)(229853002)(26005)(16586007)(8676002)(81166006)(81156014)(105586002)(11346002)(58126008)(97736004)(6496006)(52116002)(33716001)(33896004)(55016002)(72206003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2513; H:jerin; 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; BN3PR07MB2513; 23:wFdAgeRLJBHMc38GaxtBiqGu1amHPE2AbvS4JdGVj?= =?us-ascii?Q?bQHc4j3gqCHIDql1167TzXZoiJkuQjMdhdnkgL9ET1hvDavCb68dGeiWsPIg?= =?us-ascii?Q?HrPXc3Bh4cn2W52JbRlPSSMAfqg+PHQkhkk/ZzxwZxSIDYRTqOm20vmQi0f9?= =?us-ascii?Q?lUQiMIFByukI65ihjBvp6yayj+aXLMLlmAvriN3dRnv670W8SwN4pBymUnmY?= =?us-ascii?Q?nepq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O6cqbLhSD5jD50npgQovl6ZVC1h8/RzT0geN1N8akLqkTPPY7QGLr1xbJ0CzNe8OhobICHcxmAs/Nvd0qkjWgrk=; 24:EgFTXVeXzRCANVDAOcqMEmiDthrQGwfZSB1w0BgdkJbJ0JyJVNhNSwNb4QR9GiPOEjFnP70jSDgEhePL9eKzWY1Pe8dqYIhDxDTiEzS2D5A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2513; 7:xvItGLY4rdO6X7MCvNQT3lEog66Q4xM9H1CtJRXyuJyh6XNalW8cOD1l/StCnhojBRc+zQ61YrtvkzsDDltuOqp0+rgNQJ7mpzEykeR4pbXkPx9bMYRn9FDLl90NKlAoeuyy9AkTYTO9P1lvoJPhviv2i75u1nCy8oVvW1Sp6S0QqCbSwW5P8/YXxEX2ce559zQJAOw3PyYTQj16JqzpWFxm7mAF4vlyeT9nuW5iGGjyfrLsjIYI23WlvaQ0oz1M X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2018 08:10:03.6312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1f4b5db-53b6-4be7-ceb3-08d59d2822e4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2513 Subject: Re: [dpdk-dev] [PATCH v3 09/12] event/octeontx: optimize timer adapter resolution parameters 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: Sun, 08 Apr 2018 08:10:07 -0000 -----Original Message----- > Date: Tue, 3 Apr 2018 20:35:11 +0530 > From: Pavan Nikhilesh > To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, > erik.g.carrillo@intel.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 09/12] event/octeontx: optimize timer adapter > resolution parameters > X-Mailer: git-send-email 2.16.3 > > When application sets `RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES` flag > while creating adapter underlying driver is free to optimize the > resolution for best possible configuration. > > Signed-off-by: Pavan Nikhilesh > --- > static int > timvf_ring_start(const struct rte_event_timer_adapter *adptr) > { > @@ -217,7 +256,7 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) > } > > timr->tim_ring_id = adptr->data->id; > - timr->tck_nsec = rcfg->timer_tick_ns; > + timr->tck_nsec = RTE_ALIGN_MUL_CEIL(rcfg->timer_tick_ns, 10); > timr->max_tout = rcfg->max_tmo_ns; > timr->meta.nb_bkts = (timr->max_tout / timr->tck_nsec) + 1; > timr->vbar0 = octeontx_timvf_bar(timr->tim_ring_id, 0); > @@ -227,6 +266,13 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) > > timr->nb_chunks = nb_timers / nb_chunk_slots; > > + /* Try to optimize the bucket parameters. */ > + if ((rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES) > + && !rte_is_power_of_2(timr->meta.nb_bkts)) { > + optimize_bucket_parameters(timr); > + timvf_log_info("Optimizing configured values"); You could print the adjusted values here. > + } > + > if (rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) { > mp_flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET; > timvf_log_info("Using single producer mode"); > diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h > index d8a6d111f..22c8c2266 100644 > --- a/drivers/event/octeontx/timvf_evdev.h > +++ b/drivers/event/octeontx/timvf_evdev.h > @@ -192,6 +192,12 @@ bkt_mod(const uint32_t rel_bkt, const uint32_t nb_bkts) > return rel_bkt % nb_bkts; > } > > +static __rte_always_inline uint32_t __hot __hot may not be required here as it in as inline function. > +bkt_and(uint32_t rel_bkt, uint32_t nb_bkts) > +{ > + return rel_bkt & (nb_bkts - 1); > +} > + > int timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags, > uint32_t *caps, const struct rte_event_timer_adapter_ops **ops); > uint16_t timvf_timer_unreg_burst(const struct rte_event_timer_adapter *adptr, With above change: Acked-by: Jerin Jacob