From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 535FFA0542; Tue, 6 Sep 2022 18:16:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C676E4114E; Tue, 6 Sep 2022 18:16:35 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80055.outbound.protection.outlook.com [40.107.8.55]) by mails.dpdk.org (Postfix) with ESMTP id 21150400D6 for ; Tue, 6 Sep 2022 18:16:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQNtPle+37wg8G11dK8PcgxqrnZ7tBg+2lWU2CKzk25QE/Q+x8ZCXRCx/osnjqfHcc29RTPEL/URMBf+1DmEaOH6kvhdRUwrla5PpNZslNU+fHdPBBFUGX3/oCYpP7uQx+s3dLtnJF6EfB89mYB2yZdZQpDAj8/gu9ZMR/H2xuNW0z3Xagt131KFXkk4MiHybVTC+JqS+23oNmcO5CnC9mKt0ZG9IbxaJ3cgiPkZVYx7RTW8ecxp6yCwYL1X/6HzSxvmxvqfmfnXvmQ2u1JBZNxRqaQZnOIAvGRiGGRGqvY5dyxSafbPVXKPQ2BCckur2iH8CfEcZqh2WmNglQ3ovw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=veXA9g1hbNSFMW0epxpc/DkGOgomc2jfR8EDLPxBfu4=; b=EeSdGW9J5YiRXUK5WbCTw4NMLfqpOkJ3WLXMDjHy34OjF9VXa9JwMh2kgn7SGd+4J+lV2BHB1nPIjUQXss/TmBafTDgUqWWR2ZdbN8DGEO2Kv5lUJtaBbD0qbe/Waf8IRNvPlHX/yXS8RpnGmqt7UnYO++kca0LYKHD6TaKeYFykt033DbjJCgT2yCVQI4whCQDBIV5BiTb85JpkBX2vkRml6MjHn6vR9de7SZP0v+1wv9xS3bI//Q1BrkLeVb6zHUmVZh8pvHJRccLp1dOO5DsSBs82Pg705czauG3YP6e8rQoIiEw13Mmo0inq8Lm+NZNMnOr2730JQjb4w5kHGQ== 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=reject 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=veXA9g1hbNSFMW0epxpc/DkGOgomc2jfR8EDLPxBfu4=; b=hleNlpAf8FoZi+vWyE2HhEWCE3eUujvcIVugxYOhhraRTEr9L9Tz/Z/kUaKAWMvAwRrBLoQ5di88max3c1QNWtADjyJs7PBCxOJcgqmjwKtwQFl2bEQ+kf1I4XAZywmTiScxMT1YFaaq/QE5dQ3Ckd/3VgODCDQv1YKTBz30mxg= Received: from AM6PR10CA0013.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::26) by AM6PR07MB3894.eurprd07.prod.outlook.com (2603:10a6:209:3a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 6 Sep 2022 16:16:32 +0000 Received: from VE1EUR02FT004.eop-EUR02.prod.protection.outlook.com (2603:10a6:209:89:cafe::30) by AM6PR10CA0013.outlook.office365.com (2603:10a6:209:89::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Tue, 6 Sep 2022 16:16:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 192.176.1.74) smtp.mailfrom=ericsson.com; dkim=none (message not signed) header.d=none;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; pr=C Received: from oa.msg.ericsson.com (192.176.1.74) by VE1EUR02FT004.mail.protection.outlook.com (10.152.12.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5588.10 via Frontend Transport; Tue, 6 Sep 2022 16:16:32 +0000 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSMR504.ericsson.se (153.88.183.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Tue, 6 Sep 2022 18:16:32 +0200 Received: from seliicinfr00049.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.188) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Tue, 6 Sep 2022 18:16:31 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00049.seli.gic.ericsson.se (Postfix) with ESMTP id 18BBB380061; Tue, 6 Sep 2022 18:16:32 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?UTF-8?q?Morten=20Br=C3=B8rup?= , nd , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Subject: [PATCH 5/6] event/sw: report idle when no work is performed Date: Tue, 6 Sep 2022 18:13:51 +0200 Message-ID: <20220906161352.296110-5-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220906161352.296110-1-mattias.ronnblom@ericsson.com> References: <20220708125645.3141464-2-harry.van.haaren@intel.com> <20220906161352.296110-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4418b41-ae20-47f1-abcc-08da902329c8 X-MS-TrafficTypeDiagnostic: AM6PR07MB3894:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sL6YOm2GC8/QMSEE1pnYoy5Og3ZTEkFVq3wpzl4vqqcvoG+oUXVx53Vhv4TVVJDk/eSXYVdT0Diw3iSop3bUH8i1RhLIz/LIMV8cHIO2O3x/Bbv9aXRNFOW+VzwNIRA1pjmWDytxgc/M6v0GhZTH8qDQQ0ebprc4X6LmDHbpwo2JpcL4bz0jUmEBg4ST+fhze2dG0YuB89NDd02S3ECnL5bCAdzEbmZ2/jXHIs6z5smoo1tOdcse5Eybdq6/U8Y1eKZmDzODtl50d5xfq4IS/EWm7xHMm+Mvkx6qBVfYVyd5NLBOHjiFVQmky44EGjNkjjT4UQm1BdhacrZ0ZPwgHcmggTU7VDWuzoIifk/8XPOpRORzLQLwd0/GYVVn5ZcYp+uEA4LqrwquEmCw42mVhLS1A3hvLP4BXEx5Wl5n8to3XQ6Ev8bx/uZdO7v7WLse8Psihf0DeBCgkHg4xi/6Vnw3PmX6RjGG/S3ohXi3FSHJINuHTfjlpJd3juEiW0efpQSdCs6I2bIy2FYGWiW1rymptB9XifivImvMdFBBiViETFhmgCYZhjPJRshwHuWNWPwBogWRbvEM0MdEiduK3qGa9ZTwZhU+CPuzLS4FaroerKBbZ6mlVkb0MrkT3Nr74yvuCcjyhcqFRGmQgSQNc8w8T1M6rG6ZGYKue4bB7+v8wS14FNOaUHDxUkWCykArI8kbzeYd8s6n4dEf0W2tAYZMS43y7LsvLFaqc6J/yTZnazjK8qQJ2vLVb1kJsaTs8XGZUoJc1AcyHaxwGm5Luw== X-Forefront-Antispam-Report: CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net; CAT:NONE; SFS:(13230016)(4636009)(376002)(346002)(136003)(39860400002)(396003)(36840700001)(40470700004)(46966006)(356005)(7636003)(82740400003)(36860700001)(54906003)(40460700003)(83380400001)(82310400005)(82960400001)(40480700001)(336012)(316002)(4326008)(8676002)(70586007)(70206006)(2616005)(1076003)(47076005)(186003)(36756003)(2906002)(86362001)(478600001)(41300700001)(6266002)(6666004)(26005)(107886003)(5660300002)(6916009)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB3894 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Have the SW event device conform to the service core convention, where -EAGAIN is return in case no work was performed. Prior to this patch, for an idle SW event device, a service lcore load estimate based on RTE_SERVICE_ATTR_CYCLES would suggest 48% core load. At 7% of its maximum capacity, the SW event device needs about 15% of the available CPU cycles* to perform its duties, but RTE_SERVICE_ATTR_CYCLES would suggest the SW service used 48% of the service core. After this change, load deduced from RTE_SERVICE_ATTR_CYCLES will only be a minor overestimation of the actual cycles used. * The SW scheduler becomes more efficient at higher loads. Signed-off-by: Mattias Rönnblom --- drivers/event/sw/sw_evdev.c | 3 +-- drivers/event/sw/sw_evdev.h | 2 +- drivers/event/sw/sw_evdev_scheduler.c | 6 ++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index f93313b31b..f14c6427dd 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -933,8 +933,7 @@ set_refill_once(const char *key __rte_unused, const char *value, void *opaque) static int32_t sw_sched_service_func(void *args) { struct rte_eventdev *dev = args; - sw_event_schedule(dev); - return 0; + return sw_event_schedule(dev); } static int diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index 4fd1054470..8542b7d34d 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -295,7 +295,7 @@ uint16_t sw_event_enqueue_burst(void *port, const struct rte_event ev[], uint16_t sw_event_dequeue(void *port, struct rte_event *ev, uint64_t wait); uint16_t sw_event_dequeue_burst(void *port, struct rte_event *ev, uint16_t num, uint64_t wait); -void sw_event_schedule(struct rte_eventdev *dev); +int32_t sw_event_schedule(struct rte_eventdev *dev); int sw_xstats_init(struct sw_evdev *dev); int sw_xstats_uninit(struct sw_evdev *dev); int sw_xstats_get_names(const struct rte_eventdev *dev, diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c index 809a54d731..8bc21944f5 100644 --- a/drivers/event/sw/sw_evdev_scheduler.c +++ b/drivers/event/sw/sw_evdev_scheduler.c @@ -506,7 +506,7 @@ sw_schedule_pull_port_dir(struct sw_evdev *sw, uint32_t port_id) return pkts_iter; } -void +int32_t sw_event_schedule(struct rte_eventdev *dev) { struct sw_evdev *sw = sw_pmd_priv(dev); @@ -517,7 +517,7 @@ sw_event_schedule(struct rte_eventdev *dev) sw->sched_called++; if (unlikely(!sw->started)) - return; + return -EAGAIN; do { uint32_t in_pkts_this_iteration = 0; @@ -610,4 +610,6 @@ sw_event_schedule(struct rte_eventdev *dev) sw->sched_last_iter_bitmask = cqs_scheds_last_iter; if (unlikely(sw->port_count >= 64)) sw->sched_last_iter_bitmask = UINT64_MAX; + + return work_done ? 0 : -EAGAIN; } -- 2.34.1