From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8E20A052E; Mon, 9 Mar 2020 07:52:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE9D01C044; Mon, 9 Mar 2020 07:51:58 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20066.outbound.protection.outlook.com [40.107.2.66]) by dpdk.org (Postfix) with ESMTP id BA06F1BFFB for ; Mon, 9 Mar 2020 07:51:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M59Ms7q0dNG9GCQGocM/58dLtGKPPQWDa1/8fkJklY9KymuLF8W4jzBinh3OJYrBWwft4dPxiMIHxwxeBFas/KUwzuJcox+O+bMcnPEk5O1+WAAMcBVQHMqQJQnlvKotDTYfKUe+X0QJZkpAYyuU76ZgG80kuuPapVZSGoBci1zj1yK8r3gRe+ImcqxIFxCocqSi4DYLF/MEAedqL1enuDOzrZ9AmH9ifdsjtTM9Ev5vI/bq2+GDb9phIrX9+ksv5NwsxRj2qpOlkkMTvgGQ0sPSWnhZCnieDIp3YFCe6u4vC48cfZShHFn+xn2uKnUBLAlKQxmVfH4PhLT9b2A1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N1CBtpf0tfHF9UhxJu/7kZa6F9qQkQaWr93qjIPCTGg=; b=GzA1zbs8LULzGQC8sP1RxFjjBJoRN3rUI9Wvs44UiMatLuSqFEFWE9XChZEoF8KBKVDgPFN2bpOHwJJMMwd5ieAhr83Q2Vr9L5TPxK/g1kxhmqCttsvHQFyhlDvhY2+hF4fWYRoc26zBdI2JjhRMbnZxr2v/H/OqY/oT9EUorKGHluFdWcLoludzyEDlQpI3e1gl1n1YvzalbYkhwEUg3BcRIiqCH3g3cI0GvLNqDSrENpVCoaAsrvb7FYnq3AFxNOzESsSM7UUchythryUZvAzucovaZUtCBC2SWaxEQ06H+N5nhfZZcTZCkr3ucW5n6/TOvAZIvCFvEayJxIEjRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.176.1.74) smtp.rcpttodomain=arm.com smtp.mailfrom=ericsson.com; dmarc=pass (p=reject sp=none pct=100) action=none header.from=ericsson.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N1CBtpf0tfHF9UhxJu/7kZa6F9qQkQaWr93qjIPCTGg=; b=A3/vEelIEe467fFq9l1kM3iaN//WJagZu+z8Z1hsWtm+bd/96zXQolaJjb3YWSNH4G7l0EEKI7a3aIms8MDcUDB6KzATqP2sg3FX5Da2Ec2L0imNngFQ+BsOCugW3kB8a0qfCdyAIjiK0m6Kt74WPi1UzIJ41QbTsX3kUt7iP2M= Received: from AM6P195CA0002.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::15) by AM0PR07MB5603.eurprd07.prod.outlook.com (2603:10a6:208:100::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.5; Mon, 9 Mar 2020 06:51:45 +0000 Received: from VE1EUR02FT021.eop-EUR02.prod.protection.outlook.com (2603:10a6:209:81:cafe::14) by AM6P195CA0002.outlook.office365.com (2603:10a6:209:81::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Mon, 9 Mar 2020 06:51:45 +0000 Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=pass action=none header.from=ericsson.com; Received-SPF: Pass (protection.outlook.com: domain of ericsson.com designates 192.176.1.74 as permitted sender) receiver=protection.outlook.com; client-ip=192.176.1.74; helo=oa.msg.ericsson.com; Received: from oa.msg.ericsson.com (192.176.1.74) by VE1EUR02FT021.mail.protection.outlook.com (10.152.12.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2793.11 via Frontend Transport; Mon, 9 Mar 2020 06:51:45 +0000 Received: from ESESSMB503.ericsson.se (153.88.183.164) by ESESBMR505.ericsson.se (153.88.183.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 9 Mar 2020 07:51:44 +0100 Received: from ESESSMB501.ericsson.se (153.88.183.162) by ESESSMB503.ericsson.se (153.88.183.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 9 Mar 2020 07:51:43 +0100 Received: from selio1a020.lmera.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.189) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Mon, 9 Mar 2020 07:51:43 +0100 Received: from breslau.lmera.ericsson.se (breslau.lmera.ericsson.se [150.132.109.241]) by selio1a020.lmera.ericsson.se (8.15.1+Sun/8.15.1) with ESMTP id 0296pgIS024126; Mon, 9 Mar 2020 07:51:44 +0100 (CET) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: CC: , , , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Mon, 9 Mar 2020 07:51:06 +0100 Message-ID: <20200309065106.23800-9-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309065106.23800-1-mattias.ronnblom@ericsson.com> References: <20200309065106.23800-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.176.1.74; IPV:; CTRY:SE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(39860400002)(376002)(396003)(199004)(189003)(54906003)(8676002)(4326008)(26005)(478600001)(1076003)(316002)(66574012)(246002)(336012)(107886003)(7636002)(186003)(956004)(6916009)(6666004)(356004)(5660300002)(70586007)(70206006)(86362001)(8936002)(36756003)(2906002)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR07MB5603; H:oa.msg.ericsson.com; FPR:; SPF:Pass; LANG:en; PTR:office365.se.ericsson.net; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e879517-b452-4738-773c-08d7c3f654f4 X-MS-TrafficTypeDiagnostic: AM0PR07MB5603: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 0337AFFE9A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JpL6y4vGHD2g+glEaanufsIdG+VLs78shzlTiYJ4bkQxZ1ADXG9rIkFCWpiwIe8d00YdX1j/2yzIorCUPRQTUV9rn3Ni6X6REY5vH1EWc3qrNa1/9k4aqcVsr6xCJ9KdfIvtC6psjBe2EME4IjPMebp30EZ2wBk7lF8ERNW8CTkpLqyAX4UBNB6YhYX85NnJGZLFEBJL5RA/6HDUpW6QI8bRRZeDpCSt2VbmeTxqn4PSN+zjGYtPyHVkZiehQdKYRUuy3Gkzqt6gTDsvFCY5XxstNpHzAcFSk9a+IVvb3J3D8A4f9tCpFWzECwplNWhaC+ddNhmCfy6sBpZa52RftfwOmcu7UIFxrCH4swD/xBtHMNOOcFRy6SkU2U7x7SyRcSnk0MTLfkSmUyQiPF/4GeW9D/6z4oNV5Yeso/Fw58fiF5VEEqRQ+wgyjni/LWw0 X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2020 06:51:45.0082 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e879517-b452-4738-773c-08d7c3f654f4 X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74]; Helo=[oa.msg.ericsson.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB5603 Subject: [dpdk-dev] [PATCH 8/8] event/dsw: add port busy cycles xstats 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DSW keeps an internal port load estimate, used by the load balancing mechanism. As a side effect, it keeps track of the total number of busy cycles since startup. This metric is indirectly exposed in the form of DSW xstats' "port__event_proc_latency", which is the total number of busy cycles divided by the total number of events processed on a particular port. An external application can take (event_latency * dequeued) to go back to busy_cycles. One reason for doing this is to measure the port's load during a longer time period, without resorting to sampling "port__load". However, as the number dequeued events grows, a rounding error in event_latency renders the application-calculated busy_cycles inaccurate. Thus, it makes sense to directly expose the number of busy cycles as a DSW xstats, even though it might seem redundant. Signed-off-by: Mattias Rönnblom --- drivers/event/dsw/dsw_xstats.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/event/dsw/dsw_xstats.c b/drivers/event/dsw/dsw_xstats.c index d332a57b6..e8e92183e 100644 --- a/drivers/event/dsw/dsw_xstats.c +++ b/drivers/event/dsw/dsw_xstats.c @@ -109,6 +109,13 @@ dsw_xstats_port_get_event_proc_latency(struct dsw_evdev *dsw, uint8_t port_id, return dequeued > 0 ? total_busy_cycles / dequeued : 0; } +static uint64_t +dsw_xstats_port_get_busy_cycles(struct dsw_evdev *dsw, uint8_t port_id, + uint8_t queue_id __rte_unused) +{ + return dsw->ports[port_id].total_busy_cycles; +} + DSW_GEN_PORT_ACCESS_FN(inflight_credits) DSW_GEN_PORT_ACCESS_FN(pending_releases) @@ -147,6 +154,8 @@ static struct dsw_xstats_port dsw_port_xstats[] = { false }, { "port_%u_event_proc_latency", dsw_xstats_port_get_event_proc_latency, false }, + { "port_%u_busy_cycles", dsw_xstats_port_get_busy_cycles, + false }, { "port_%u_inflight_credits", dsw_xstats_port_get_inflight_credits, false }, { "port_%u_pending_releases", dsw_xstats_port_get_pending_releases, -- 2.17.1