From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0072.outbound.protection.outlook.com [104.47.34.72]) by dpdk.org (Postfix) with ESMTP id 66FEC1B7AA for ; Tue, 3 Apr 2018 17:05:56 +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=BC19FD5b0+hJm+nLNTbjgSsr7mR6hiOeq9IFSo2m2MA=; b=Twt2W4UXoNncZIRH4JB0oBUBJPlJhwc9pGMI8XByDrVtG4W8CMEgVuiYehOLSlkQ601PdvpIqEWrl+MncQjyUm3Hzh12XLz0pONIUePniYPZGSf/BteMxGjYy59ISW8mMKjKU09GBUJHoWzFXEzMy0/AcxC3cBngiglWCgsqTj0= 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:05:53 +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:07 +0530 Message-Id: <20180403150514.24201-6-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: 678e89a0-7d48-4253-54c3-08d5997465ec 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:1MRj4RJfk8TS+rjdRydOVXhp3Vfe2NLdSC62P7mui7hsCXSJwdF9FkUD2I4TUyip4syYNDApuPfWmSSmQ7kKzJ5pjwHVWFw+WAgqsO0BLgfGACCjWoyGhhVIDjxKI8unce38c4EZE17DGXLprlo7lR0H8mikwbLmkFl5MATFtYkRNd5dX9ex3dToshPlPs9LtQKaFnpLWbesMRC66RTftHXZ4XiqAbc1grZWCQyoNbSZcyn2EF9MW+DoE8lwc4eN; 25:C5n8wngQqTOlHJ7B9VAilgjSVmiHrdbpPDX8dIp6MVdqLnCoW2pGq4Szp+CcjM3vx8wbK6qcRxTZ8vn3DHCHiFCpr5ZvgIybJfXWwnFctNn802w1D2hCe47yldq9G+Pk8Cvko2PwavJuzFxjkDTyLWNsVoMfuRQIkiWSNmYeuOpFCNgT9hNE3zvvsHBmigsrOxHDiHZOlGEhxt646CaOMvGhY6CllcpOSNZBqeTbjx/AVO8J613v83lQ35bt9z6DXQwcEHQ9WN4nE6TJjP3TaGiWAuJPN4hvFEUUyjN0ZhIlFTupyx9iXzHYT/uxoiYwaVKxQEyRqpYL2ZWaAzuxow==; 31:o/+F0WNP0wOHQfMsv/rCqWxU88HbGNNtJj0Gir0dubP+jgolkmqBL0onqMTEtQjOnxREc7WFMWOrEzSvWmsuY4YBdvQJ0onpqstWztjIX8M3pvbi9h+WRA2jBwHSvTdxmB+mjl/hCiGw0pcCeJSPKoMSLaaUwSRNNQdBtQBUvzaeoP06SVdIbDyls5sog5Q56Hdvm+XxMKyW+Jpn5gvJ9hUEKIw3UMJLotveL5g2Hp8= X-MS-TrafficTypeDiagnostic: MWHPR07MB3470: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 20:l35s46+3ZB6tAMjLsA14wJs3K/yng7kr9RXvUQVC1PUvg2RrgGXttBcL5cK+4hpZD39A+vk8XKIJxOP2r1B0sV0CQh+2THtOFJb7huwYuvHnCBV43+oAUPn8W0oDkvaS6lUg9gxrG7fawcGghm3vuNIT92BIJMaYBfBNj2OeBetYc82DZWWiZAzLgEC84oxOcNdo+UM2Xfsj+IGx/9Tk9hxld+VDCS7QylDdzs5CItCvbhWXM85odt7zMvNUL+bsjWWs46boVXfhtyDKt7sWxBCdFAR0MqjLJgu/2PktGJ/9RimFwmqLHY+tWImZC/asDCx1hMTTqtPo9//ZXTjeUZjHbUMkUwasAWP+DCGpxiFMLkTrqJBLghAWGW4nTTNby4pOi4a0caXrZmZXPiK9f/hwrv5Llx3CNjeEwVWsxYw+KbXP5BDjFNcD/YhivB5s6Eb9d9/hooDvfiKCrhKn1UqO84hDBcFwK84zlKK+RW8aKomX0LILEzgcrALz3luaquOVcmC+ce/uJbnCctms84IFiLaabNnkjBvBv31mK6zxS4mU3uTwUnA0FEu7kE2AlxPATbaCF4JUHr66+trJPuej9FYNKAyzPs4c6y5Pxas=; 4:ub8Lp1WLyW1ZOEq/GNLeKicptB5kvOTIf5mwvFYCHnuCV9sr/3utb9tjtiNFTr1FonxYXx74pnpBY9NxlHdT6A2Z9ZgiLXnkGEIxl9qy4c4EbVNjajGplrmCb7uQlb0NlwSTqx4q++yJjkTiuF7emyZ9dabLQDsyQTq8yhm76M1kQtn/LRpAbgk/jLcZPAA0ggksxZr6vjPLsX8+m4WQOebsRpBtCs/PrYAbfn3LJUBhbn/YQ7/1sMM0EbkQTUO0F+haFgXxe+ejkMQTo7ZmPA== 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:Xi5U7PDS1z5ATnbbn8NCbapjNm12aqK7wXAp03SOX?= =?us-ascii?Q?DzgET1J+/aJu2JMYfH0bl+6kMcGefuJXEh0satDnKKOCQctlGRAnxSWz9A39?= =?us-ascii?Q?R4oRuv5xvRLo0KsbyO5XU6/4oyQOmq4MGqcZFkcoqS09NFE/VHWEilSqsvED?= =?us-ascii?Q?H6lJoxGy1sXpmP8ZZ6jusksqJm0+0508UMfwrG3Q1bN0nvUAE6doNaqMQf5T?= =?us-ascii?Q?TrfcQPRrLc5cFBjh8vxfFk33ox43UUUpagi1rDEv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9CwIXREl3j/6WtyYJ0CF31HiL8npvXlKaGZGyQv?= =?us-ascii?Q?Lc0Z25VHgVGVaJeAU2doXl4ItR52cpRBQwguHUnEcY6XVn8GM+/zuoA4hEve?= =?us-ascii?Q?+iKYwHMTk5ifqvWAKa5UpW+ttP/nHnMUV7BL4aKUUSKFGHBpBiSo9iA0hQv4?= =?us-ascii?Q?PkZh8z9eOrcd6PrlusDTQpKTgL7HTaJWOwaPNT6tB0A?= X-Microsoft-Antispam-Message-Info: AxykgYuyRxdrC8wZJiThbrMtQ5/bAgoSXhH7nqdkzj+inf9uClWjNq8yNDByAek4oUcP+vh2GoNVRL0qYOBPmSCBQehmdG4RwoJLBzeHgGrdWFBrHuYkEbi3by2XZQUHpgLiwiT/0N0DlDzu6/siaX3m9HHQUzhh0541b5h0uoUBam9nEQy4t7w+GvO8h/C6 X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 6:7UlB7jNxrlYE3kvJmXlyrpCwUGPHwbQ+iXYjTI5l6c52Mrp6p3cn+DudKwkpj68ILHOD6EYEJZqeFd+0fHdtzpuzq2Fanob1VxgVgw8rfokIu8wpxo1MFcJr9Nd2/YjC81Dkf1TWpLQu4ByfY6s7YQo+wqFBpUGfVODSaf2YbYUBwCffn4ciblyiI4V20gWRgafnxVfnHZTY653La0kp/buMQEiKw40SDnelLd7F8DBGMx3azSr2XRn0S0l64+F/i52Iahy6vJt+nnbmd480n2+57OWNeoavjOhMS9IDt2hgRthJZygfgyIy7CuwBWqma3mPQDZOw26ceIy9a65n5KLX64bJN4J+pOUsicfozEChOkM2f2VWOU53SmGFuL2U63h0VHL96YgHEaNiB0SDMnhTzdeXUMPkhufeVNix7u8s9uqjkeTIxZtP/KRzAD+6vZWlghW9s6OgkYMCwrqp9g==; 5:ACAQbuOLcpfwJRj63Gxyhk5NKN6Sys+5XpV/MZMkEaH5ogi7KhVA/DAK5m2WNxsehUofWdkHtM120ewvZe01hXkDFu7au+RP28EO3CnST9j3XO8L42zTBogOMb2aWiHZd5fhYM6BjT+apX/ifcnd9tWYl3pxYG+NydzDK8+EKa0=; 24:Y37w8HOSReOCq8EIWhzAliGYSZDw8XJYTf70wISXWcys6jReQ/VQFZ0dVdXLrldVT1hfPNwhj8LrhTVa8fkQvfZDel7sRnixkVUuRi4xMTQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3470; 7:D21cBE/v+7uiPnmCO3g9oFdDqiJbD7n8pCt7O7OrYZeRO3BcyB8ptJf587PHSRwZQFCPxtNYrYZhssRXlQSvkP2oTOrrDozSfoOskjdgwQFoMD7tfeLfqHdwpW3hBJnJgLtUXmretbn5WBRVqhMmrIo81+HacDefGa9zHMEDGCOC5xLv8im+18n9QbwdZ9DjSQdzrIM+8i1JkczADUmHnlNCA2jjDR8/7cAbcqTUiKdALESiE1YlcBsH/E+u14nG X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2018 15:05:53.0223 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 678e89a0-7d48-4253-54c3-08d5997465ec 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 05/12] event/octeontx: add event timer stats get and reset 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:05:57 -0000 Add functions to get and reset event timer adapter stats. Signed-off-by: Pavan Nikhilesh --- drivers/event/octeontx/timvf_evdev.c | 26 ++++++++++++++++++++++++++ drivers/event/octeontx/timvf_evdev.h | 1 + 2 files changed, 27 insertions(+) diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c index ccf724115..4db10cdd0 100644 --- a/drivers/event/octeontx/timvf_evdev.c +++ b/drivers/event/octeontx/timvf_evdev.c @@ -281,12 +281,38 @@ timvf_ring_free(struct rte_event_timer_adapter *adptr) return 0; } + +static int +timvf_stats_get(const struct rte_event_timer_adapter *adapter, + struct rte_event_timer_adapter_stats *stats) +{ + struct timvf_ring *timr = adapter->data->adapter_priv; + uint64_t bkt_cyc = rte_rdtsc() - timr->meta.ring_start_cyc; + + stats->evtim_exp_count = timr->meta.tim_arm_cnt; + stats->ev_enq_count = timr->meta.tim_arm_cnt; + stats->adapter_tick_count = rte_reciprocal_divide_u64(bkt_cyc, + &timr->meta.fast_div); + return 0; +} + +static int +timvf_stats_reset(const struct rte_event_timer_adapter *adapter) +{ + struct timvf_ring *timr = adapter->data->adapter_priv; + + timr->meta.tim_arm_cnt = 0; + return 0; +} + static struct rte_event_timer_adapter_ops timvf_ops = { .init = timvf_ring_create, .uninit = timvf_ring_free, .start = timvf_ring_start, .stop = timvf_ring_stop, .get_info = timvf_ring_info_get, + .stats_get = timvf_stats_get, + .stats_reset = timvf_stats_reset, }; int diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h index e155b6ce2..e98ab631a 100644 --- a/drivers/event/octeontx/timvf_evdev.h +++ b/drivers/event/octeontx/timvf_evdev.h @@ -145,6 +145,7 @@ struct timvf_meta { struct tim_mem_bucket *bkt; void *chunk_pool; uint64_t tck_int; + volatile uint64_t tim_arm_cnt; }; struct timvf_ring { -- 2.16.3