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 45575A0542; Wed, 5 Oct 2022 11:20:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B6E442836; Wed, 5 Oct 2022 11:20:11 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) by mails.dpdk.org (Postfix) with ESMTP id 80DA2427F3 for ; Wed, 5 Oct 2022 11:20:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nUn3J2gvpPlN4lBmIth4Glyu2c+E9PDY0Fy1z49N6kwStUVx9JR4TgeMARgfR6E5GL7ql/3VG/CqtlFA764xyGLQcOcZmzm7FX5msznETSIgXHpkSM1IERFlxDeTki6M0d1rmjGIL6fuf2rAzbU+JqjhcQPoMDufhm5IZIf98VI+8zYF01EpGd4qTWQc+d3JUWv0gylNoDFA1uOZjMhP7irwyMu+tvjcqgapV0nBRp/DPdFRaxctvzZ3uff+OhCq2OXXQ6CeKYgk6LdquLtY0OkcZDM//jbWN2Rci8QTmUOXKA4qdiezor0e+VFtzBB1OD+RvbyNtH3hCCuNsQklQA== 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=ooyxHGdBsXTHPgt+QdohuBUxPhOwGtSxNH7Vv54pI8o=; b=G5UIFfqgUIS5Xp7ghPapZNWExm7yYoejkzi3qVqQYc2jS7BAkA1dT280g9d1Z1bQ5TcAdFdvDaUguPsNF0FQB7vxaSqt0pCPxK3ldL8zJwKukx9PIllLaXEUdIwdeDv8iMoLLxPVFS1CD5JZpGS+HRq2QlbRMLbvrLOhtiZlJJjorxjkjJsUo+3olyz0J9EcBEr0LUXKCNvbqmquMUeD4xh55KPtXmduyTmLsd9JPOGlagAO5j7ene60mp3bUz/I4lmxfg6nIDLNE16jojOyb9e/Kp7cI2syF2dPcy2nypT48Si8ZQ19lDs+KrQDcK4OVMui79ZfXyJ6WUmSXMMlRg== 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=ooyxHGdBsXTHPgt+QdohuBUxPhOwGtSxNH7Vv54pI8o=; b=EretqYHt8RYApfzHjjgSJWTyKBD4mCR/UArlxfiHb4QCDY1pzrn7FDy0RQgav1yH6mrCpNCoXujs5O/yctNoOO36pFMrZK8A4//jH/cCjsMZrXCidokjlxsQ1clrkYqd+jfeW3WJcpOiWPphCZ5z5ht11UKprWzPaEGac2l2+J4= Received: from AS8P250CA0021.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::26) by DBAPR07MB6840.eurprd07.prod.outlook.com (2603:10a6:10:17c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.9; Wed, 5 Oct 2022 09:20:08 +0000 Received: from VE1EUR02FT105.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:330:cafe::aa) by AS8P250CA0021.outlook.office365.com (2603:10a6:20b:330::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31 via Frontend Transport; Wed, 5 Oct 2022 09:20:08 +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 VE1EUR02FT105.mail.protection.outlook.com (10.152.13.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5709.10 via Frontend Transport; Wed, 5 Oct 2022 09:20:07 +0000 Received: from ESESBMB501.ericsson.se (153.88.183.168) 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.2375.31; Wed, 5 Oct 2022 11:20:05 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.184) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:05 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 679551C0060; Wed, 5 Oct 2022 11:20:05 +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 v2 5/6] event/sw: report idle when no work is performed Date: Wed, 5 Oct 2022 11:16:14 +0200 Message-ID: <20221005091615.94652-6-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221005091615.94652-1-mattias.ronnblom@ericsson.com> References: <20220906161352.296110-1-mattias.ronnblom@ericsson.com> <20221005091615.94652-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-TrafficTypeDiagnostic: VE1EUR02FT105:EE_|DBAPR07MB6840:EE_ X-MS-Office365-Filtering-Correlation-Id: 42e676b9-35c8-4d55-01fe-08daa6b2cbce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V0d4f13kpo+MTwq6wjx+1Uoj3ez+k9ppu/3lMp9i/Dl10pq9yvynjne8jQ4aWVC3XJ1Bq94XaqvX4rgsjObBzmMdGPLnYfgSoBQn7vwSoUVB23BCmt3bXTibZipbKeC4pQOyzOyUPHh93oEBbleQ4L7kgy1m8Ly+u0MG0itZOe20TIojiYL4vV9Q/9+8Tt8npLDAEhd2rRNeHsGYkxAxfk1+OQfgBYE8iaCZLqyo9iyBHO77gc1IMk6oY3uR9wzC0kPcy5QsxQ2hXWGPBxgfbeceIkdQnB6iKHK3Yb0JpeKvCdw6UPPhGXO7+lxiGU+LsAzfrl8ISOqgj5g5PUhYv3BocWhRhAOwbl4IPEGtnKvQhGkY8yPGze6rQfLCYrD9R3bKpqq14IuymUuhfrKydoxTH4ke6p1iMPN9QojBGZAjph1a6L+/nnlkbyFxjSYPsLUeY/3eCHUnjgLjadNdo4aPsPBF50LerSSr9giKcK3Zeyz/Hv8rG6IF2aw0GsYhDhJN4uVODWbGcqWlK3na/5kBMz2c0QWK29mMAuWHoUFTNhIivBGiN5QHVbutOCjZyPhZIUOvHFhbRy1GM/L2wj+AkZXplFmG1tdVvBQXU0oZBD3YFGfGKAOI4VrP5Qruuq9ewbRd5B6bilAXsngadgOpsLMdzgVCMcwiH7DmHSjt0jKWE9lHqZUP7r2VJuoxHA2+xytl8WAdRt0RMSxhFwiVefqLSGaFhBDOkJDl8lAdcq93hYhgO/oPuoG6zt6D3dzjD5uKQK1xOmF8Qb7fjQ== 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:(13230022)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199015)(40470700004)(36840700001)(46966006)(4326008)(40460700003)(26005)(6266002)(70586007)(6666004)(107886003)(7636003)(478600001)(70206006)(8676002)(40480700001)(82310400005)(316002)(6916009)(54906003)(36860700001)(2616005)(86362001)(36756003)(336012)(47076005)(82740400003)(82960400001)(1076003)(186003)(83380400001)(356005)(5660300002)(8936002)(41300700001)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:07.9230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42e676b9-35c8-4d55-01fe-08daa6b2cbce 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-AuthSource: VE1EUR02FT105.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR07MB6840 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 bfa9469e29..3531821dd4 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -934,8 +934,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