From patchwork Wed Oct 5 09:16:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117374 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B66BFA0542; Wed, 5 Oct 2022 11:20:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32F0C42B71; Wed, 5 Oct 2022 11:20:13 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20075.outbound.protection.outlook.com [40.107.2.75]) by mails.dpdk.org (Postfix) with ESMTP id 074FB40694 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=MGO+2usDvTFV3CDUQZ/xsQ6DVaqiqfZB20rT6m/hwuzlVnMfFVSgNFvpLAS/ddYPbfp2Bhz1fCq1/qEPmEBS7RxlTObMs3PDQ1BJ6vK1An5uPuqAvub4PSZHenyfyowvZ3pYYQ6gTfhRrAqIkRSa6oLIUK/3Sbo4MBz933PLnkDJ0yaMO1tEnJiJMURFRt63xd0cDTYtbf6illhhT0K61hM1yL710qf4fUKKWrjeSmQPyMHivZInVbmTUGo/oTQTjmlgvzM7hP+QKHYTs93Drdzp/8TE2XxQFaT7Ho3+I+ZbXavQ17xvcEv22jER4xW5j+18zV6GGkx7fR1V+CfHaw== 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=inZIn2Yoc29YW6CgZpWCofcUjI54USNE4sS6gurDpNE=; b=NnSeGlu+UHl17ymU77Ow4QLNajn33h/lTs2C0tdI06A+daYkKd/Ha73zuOHEbw9nVXtga3IOCrRvwj0Eeh3NwAXm6KmU6SQxmqQXmZR6QSpbI9qo7dpo2+q5cCcczEmv7tUR5aYfixqgNYBCC1qesChyG1J9pBX/HqwugOhxVr5RAQt2i5IyIFoiWZFeGgIAFRiJ166/FLyD0JkXVgEPKcv5xizvGhg3LztWUNi4n0o7+mSnRrV+Y7teBMY3V7VAa31dIii7ATXU0yCUAZx09AvDaXffgHniYlaeOj/45IO7SZ57sRTD4PXckVbsLr3lABG60EG4i/WPmmdKijMHBQ== 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=inZIn2Yoc29YW6CgZpWCofcUjI54USNE4sS6gurDpNE=; b=Aoq/vCiKXnJebdkWuilLsCyzFxMNueh5uYHmGbLrTL4pEQTWbcVbUjvAWnOJC2mIi81QxVuumlbgZk+IbW4E16GHUmq+ONO0uzaxCf0FGV8+rGGL98Sq9VLLpM7aengYhWmAFLlYWi0aiU1PfPSQ+I8XO+R6ai1JfnZFR1MTios= Received: from OL1P279CA0026.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:13::13) by DU0PR07MB9194.eurprd07.prod.outlook.com (2603:10a6:10:42e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10; Wed, 5 Oct 2022 09:20:08 +0000 Received: from HE1EUR02FT019.eop-EUR02.prod.protection.outlook.com (2603:10a6:e10:13:cafe::3e) by OL1P279CA0026.outlook.office365.com (2603:10a6:e10:13::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.32 via Frontend Transport; Wed, 5 Oct 2022 09:20:07 +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 HE1EUR02FT019.mail.protection.outlook.com (10.152.10.70) 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 ESESBMB503.ericsson.se (153.88.183.170) by ESESBMR506.ericsson.se (153.88.183.202) 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:03 +0200 Received: from ESESSMB501.ericsson.se (153.88.183.162) by ESESBMB503.ericsson.se (153.88.183.170) 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:02 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.189) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:03 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id F1B771C0089; Wed, 5 Oct 2022 11:20:02 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v2 1/6] service: reduce statistics overhead for parallel services Date: Wed, 5 Oct 2022 11:16:10 +0200 Message-ID: <20221005091615.94652-2-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1EUR02FT019:EE_|DU0PR07MB9194:EE_ X-MS-Office365-Filtering-Correlation-Id: 59a8e714-55bc-42a5-895f-08daa6b2cbad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KMQ0sTStlMBkvGXSXks5RKchZmmXhbYmPXjW3RjTpNeXH7i0VdXNjywi0+bOf+IX12lkl5bTPiDZI2kbdq1Ey1ZanGSNP8Jtc4rQIPmqXE+Ki6SOT/hbp91bmL05fMbcmZWZgCXD0bL6DM+fjb3sj4VBcdc1cINwtBYOYQcmN6mdDNxXvZVUtXU7MkcrgtNlcyfa0w9OInABuIxF5v5PhjCWyAFdeEmZvOZQ6f8uB4r94W9xr2goH3v0+FGKCo6z6X3/rH33MbpWSERBwQR+gMM8dA6sJpJps/oJkdgDoWnxcooLKYEWmxBwTzxga6Hc19MMjhkSdtms/irs0DX16da/INMzCdIS/dR3pqmnVO32cQy60nnY8W/zPSkZJ+REtGpVKXFeTKwZalbSYr8Vzs59xSjnxcOn3/Ypz/C9cD2tijQrlZp/ZusMk/XBbybllHf0WLKpyda1ITgsm9D6Q8Cfn6gzfyaZJ8gu+/PcEuUKT138PM54EurQy18R0P6GUBMyuAOoCEl46Axgw/ffiUih/M0R6J5YJE225i+/Ce+n2Y7EQE95ui41KYf0fHuG95y5jgBEBPGlBMYUk0SypYetWyHz3iFCEf0yleLYWM+hs4MB5JE25B9rRhcY66L9qWY4/XJQ750JvHMCzPMYmyXr/k9P+b0GtTlghHlmwa3lSkEwWTi21g8HzoOxygQy+fU4YpTymYpIOaNZPLmd8TR+CD8vXDFSnZXPHOirdgHV5KIxNa1Dusx39Esdyf4zkan0muenQuWe+Arz4u4ulkHkmslJLNzoljVdBxz1Qbcsu2YhaFhCVp/y1WmuPEv2 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)(136003)(346002)(376002)(396003)(39860400002)(451199015)(36840700001)(46966006)(40470700004)(1076003)(30864003)(336012)(2616005)(186003)(2906002)(41300700001)(26005)(82740400003)(5660300002)(6266002)(82960400001)(7636003)(86362001)(40480700001)(356005)(82310400005)(83380400001)(66574015)(47076005)(40460700003)(36756003)(36860700001)(6916009)(54906003)(316002)(8936002)(478600001)(4326008)(8676002)(70206006)(70586007)(6666004)(107886003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:07.7571 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 59a8e714-55bc-42a5-895f-08daa6b2cbad 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: HE1EUR02FT019.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9194 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 Move the statistics from the service data structure to the per-lcore struct. This eliminates contention for the counter cache lines, which decreases the producer-side statistics overhead for services deployed across many lcores. Prior to this patch, enabling statistics for a service with a per-service function call latency of 1000 clock cycles deployed across 16 cores on a Intel Xeon 6230N @ 2,3 GHz would incur a cost of ~10000 core clock cycles per service call. After this patch, the statistics overhead is reduce to 22 clock cycles per call. Signed-off-by: Mattias Rönnblom --- v2: * Introduce service stats struct which hold per-lcore service stats state, to improve spatial locality. --- lib/eal/common/rte_service.c | 190 +++++++++++++++++++++++------------ 1 file changed, 128 insertions(+), 62 deletions(-) diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c index 94cb056196..6b807afacf 100644 --- a/lib/eal/common/rte_service.c +++ b/lib/eal/common/rte_service.c @@ -50,16 +50,12 @@ struct rte_service_spec_impl { * on currently. */ uint32_t num_mapped_cores; - - /* 32-bit builds won't naturally align a uint64_t, so force alignment, - * allowing regular reads to be atomic. - */ - uint64_t calls __rte_aligned(8); - uint64_t cycles_spent __rte_aligned(8); } __rte_cache_aligned; -/* Mask used to ensure uint64_t 8 byte vars are naturally aligned. */ -#define RTE_SERVICE_STAT_ALIGN_MASK (8 - 1) +struct service_stats { + uint64_t calls; + uint64_t cycles; +}; /* the internal values of a service core */ struct core_state { @@ -70,7 +66,7 @@ struct core_state { uint8_t is_service_core; /* set if core is currently a service core */ uint8_t service_active_on_lcore[RTE_SERVICE_NUM_MAX]; uint64_t loops; - uint64_t calls_per_service[RTE_SERVICE_NUM_MAX]; + struct service_stats service_stats[RTE_SERVICE_NUM_MAX]; } __rte_cache_aligned; static uint32_t rte_service_count; @@ -138,13 +134,16 @@ rte_service_finalize(void) rte_service_library_initialized = 0; } -/* returns 1 if service is registered and has not been unregistered - * Returns 0 if service never registered, or has been unregistered - */ -static inline int +static inline bool +service_registered(uint32_t id) +{ + return rte_services[id].internal_flags & SERVICE_F_REGISTERED; +} + +static inline bool service_valid(uint32_t id) { - return !!(rte_services[id].internal_flags & SERVICE_F_REGISTERED); + return id < RTE_SERVICE_NUM_MAX && service_registered(id); } static struct rte_service_spec_impl * @@ -155,7 +154,7 @@ service_get(uint32_t id) /* validate ID and retrieve service pointer, or return error value */ #define SERVICE_VALID_GET_OR_ERR_RET(id, service, retval) do { \ - if (id >= RTE_SERVICE_NUM_MAX || !service_valid(id)) \ + if (!service_valid(id)) \ return retval; \ service = &rte_services[id]; \ } while (0) @@ -217,7 +216,7 @@ rte_service_get_by_name(const char *name, uint32_t *service_id) int i; for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (service_valid(i) && + if (service_registered(i) && strcmp(name, rte_services[i].spec.name) == 0) { *service_id = i; return 0; @@ -254,7 +253,7 @@ rte_service_component_register(const struct rte_service_spec *spec, return -EINVAL; for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_valid(i)) { + if (!service_registered(i)) { free_slot = i; break; } @@ -366,29 +365,27 @@ service_runner_do_callback(struct rte_service_spec_impl *s, { void *userdata = s->spec.callback_userdata; - /* Ensure the atomically stored variables are naturally aligned, - * as required for regular loads to be atomic. - */ - RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, calls) - & RTE_SERVICE_STAT_ALIGN_MASK) != 0); - RTE_BUILD_BUG_ON((offsetof(struct rte_service_spec_impl, cycles_spent) - & RTE_SERVICE_STAT_ALIGN_MASK) != 0); - if (service_stats_enabled(s)) { uint64_t start = rte_rdtsc(); s->spec.callback(userdata); uint64_t end = rte_rdtsc(); uint64_t cycles = end - start; - cs->calls_per_service[service_idx]++; - if (service_mt_safe(s)) { - __atomic_fetch_add(&s->cycles_spent, cycles, __ATOMIC_RELAXED); - __atomic_fetch_add(&s->calls, 1, __ATOMIC_RELAXED); - } else { - uint64_t cycles_new = s->cycles_spent + cycles; - uint64_t calls_new = s->calls++; - __atomic_store_n(&s->cycles_spent, cycles_new, __ATOMIC_RELAXED); - __atomic_store_n(&s->calls, calls_new, __ATOMIC_RELAXED); - } + + /* The lcore service worker thread is the only writer, + * and thus only a non-atomic load and an atomic store + * is needed, and not the more expensive atomic + * add. + */ + struct service_stats *service_stats = + &cs->service_stats[service_idx]; + + __atomic_store_n(&service_stats->calls, + service_stats->calls + 1, + __ATOMIC_RELAXED); + + __atomic_store_n(&service_stats->cycles, + service_stats->cycles + cycles, + __ATOMIC_RELAXED); } else s->spec.callback(userdata); } @@ -436,7 +433,7 @@ rte_service_may_be_active(uint32_t id) int32_t lcore_count = rte_service_lcore_list(ids, RTE_MAX_LCORE); int i; - if (id >= RTE_SERVICE_NUM_MAX || !service_valid(id)) + if (!service_valid(id)) return -EINVAL; for (i = 0; i < lcore_count; i++) { @@ -483,16 +480,17 @@ service_runner_func(void *arg) */ while (__atomic_load_n(&cs->runstate, __ATOMIC_ACQUIRE) == RUNSTATE_RUNNING) { + const uint64_t service_mask = cs->service_mask; for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_valid(i)) + if (!service_registered(i)) continue; /* return value ignored as no change to code flow */ service_run(i, cs, service_mask, service_get(i), 1); } - cs->loops++; + __atomic_store_n(&cs->loops, cs->loops + 1, __ATOMIC_RELAXED); } /* Use SEQ CST memory ordering to avoid any re-ordering around @@ -608,8 +606,8 @@ static int32_t service_update(uint32_t sid, uint32_t lcore, uint32_t *set, uint32_t *enabled) { /* validate ID, or return error value */ - if (sid >= RTE_SERVICE_NUM_MAX || !service_valid(sid) || - lcore >= RTE_MAX_LCORE || !lcore_states[lcore].is_service_core) + if (!service_valid(sid) || lcore >= RTE_MAX_LCORE || + !lcore_states[lcore].is_service_core) return -EINVAL; uint64_t sid_mask = UINT64_C(1) << sid; @@ -813,21 +811,75 @@ rte_service_lcore_stop(uint32_t lcore) return 0; } +static uint64_t +lcore_attr_get_loops(unsigned int lcore) +{ + struct core_state *cs = &lcore_states[lcore]; + + return __atomic_load_n(&cs->loops, __ATOMIC_RELAXED); +} + +static uint64_t +lcore_attr_get_service_calls(uint32_t service_id, unsigned int lcore) +{ + struct core_state *cs = &lcore_states[lcore]; + + return __atomic_load_n(&cs->service_stats[service_id].calls, + __ATOMIC_RELAXED); +} + +static uint64_t +lcore_attr_get_service_cycles(uint32_t service_id, unsigned int lcore) +{ + struct core_state *cs = &lcore_states[lcore]; + + return __atomic_load_n(&cs->service_stats[service_id].cycles, + __ATOMIC_RELAXED); +} + +typedef uint64_t (*lcore_attr_get_fun)(uint32_t service_id, + unsigned int lcore); + +static uint64_t +attr_get(uint32_t id, lcore_attr_get_fun lcore_attr_get) +{ + unsigned int lcore; + uint64_t sum = 0; + + for (lcore = 0; lcore < RTE_MAX_LCORE; lcore++) + if (lcore_states[lcore].is_service_core) + sum += lcore_attr_get(id, lcore); + + return sum; +} + +static uint64_t +attr_get_service_calls(uint32_t service_id) +{ + return attr_get(service_id, lcore_attr_get_service_calls); +} + +static uint64_t +attr_get_service_cycles(uint32_t service_id) +{ + return attr_get(service_id, lcore_attr_get_service_cycles); +} + int32_t rte_service_attr_get(uint32_t id, uint32_t attr_id, uint64_t *attr_value) { - struct rte_service_spec_impl *s; - SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); + if (!service_valid(id)) + return -EINVAL; if (!attr_value) return -EINVAL; switch (attr_id) { - case RTE_SERVICE_ATTR_CYCLES: - *attr_value = s->cycles_spent; - return 0; case RTE_SERVICE_ATTR_CALL_COUNT: - *attr_value = s->calls; + *attr_value = attr_get_service_calls(id); + return 0; + case RTE_SERVICE_ATTR_CYCLES: + *attr_value = attr_get_service_cycles(id); return 0; default: return -EINVAL; @@ -849,7 +901,7 @@ rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, switch (attr_id) { case RTE_SERVICE_LCORE_ATTR_LOOPS: - *attr_value = cs->loops; + *attr_value = lcore_attr_get_loops(lcore); return 0; default: return -EINVAL; @@ -859,11 +911,17 @@ rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, int32_t rte_service_attr_reset_all(uint32_t id) { - struct rte_service_spec_impl *s; - SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); + unsigned int lcore; + + if (!service_valid(id)) + return -EINVAL; + + for (lcore = 0; lcore < RTE_MAX_LCORE; lcore++) { + struct core_state *cs = &lcore_states[lcore]; + + cs->service_stats[id] = (struct service_stats) {}; + } - s->cycles_spent = 0; - s->calls = 0; return 0; } @@ -885,17 +943,25 @@ rte_service_lcore_attr_reset_all(uint32_t lcore) } static void -service_dump_one(FILE *f, struct rte_service_spec_impl *s) +service_dump_one(FILE *f, uint32_t id) { + struct rte_service_spec_impl *s; + uint64_t service_calls; + uint64_t service_cycles; + + service_calls = attr_get_service_calls(id); + service_cycles = attr_get_service_cycles(id); + /* avoid divide by zero */ - int calls = 1; + if (service_calls == 0) + service_calls = 1; + + s = service_get(id); - if (s->calls != 0) - calls = s->calls; fprintf(f, " %s: stats %d\tcalls %"PRIu64"\tcycles %" PRIu64"\tavg: %"PRIu64"\n", - s->spec.name, service_stats_enabled(s), s->calls, - s->cycles_spent, s->cycles_spent / calls); + s->spec.name, service_stats_enabled(s), service_calls, + service_cycles, service_cycles / service_calls); } static void @@ -906,9 +972,9 @@ service_dump_calls_per_lcore(FILE *f, uint32_t lcore) fprintf(f, "%02d\t", lcore); for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_valid(i)) + if (!service_registered(i)) continue; - fprintf(f, "%"PRIu64"\t", cs->calls_per_service[i]); + fprintf(f, "%"PRIu64"\t", cs->service_stats[i].calls); } fprintf(f, "\n"); } @@ -924,16 +990,16 @@ rte_service_dump(FILE *f, uint32_t id) struct rte_service_spec_impl *s; SERVICE_VALID_GET_OR_ERR_RET(id, s, -EINVAL); fprintf(f, "Service %s Summary\n", s->spec.name); - service_dump_one(f, s); + service_dump_one(f, id); return 0; } /* print all services, as UINT32_MAX was passed as id */ fprintf(f, "Services Summary\n"); for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_valid(i)) + if (!service_registered(i)) continue; - service_dump_one(f, &rte_services[i]); + service_dump_one(f, i); } fprintf(f, "Service Cores Summary\n"); From patchwork Wed Oct 5 09:16:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117370 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C60A2A0542; Wed, 5 Oct 2022 11:20:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E2D0427EE; Wed, 5 Oct 2022 11:20:09 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2065.outbound.protection.outlook.com [40.107.247.65]) by mails.dpdk.org (Postfix) with ESMTP id 3C46D40694 for ; Wed, 5 Oct 2022 11:20:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hIBS3FJab1dKwphwNe44/5dfFoo6xOs58+rlEDyLmANIQ8R97H+eg+62e826yobrrwZFR7Olz64C79xcLFmXL+E66vDJfDE1AsckFtON1mxUNgdF3SlcddyiDXOCi/VJPPD/5VXLMkOX8/yA96e++5LGUVBvbqibx2f1SNwjQ5zxcRBRjsedMvGLVrRcQiSASvpj54gLrt8Ne6VDMU0ENOzOPx/GoNOX8sl9LDFawPYdmsLjGMpQVllJpCJn3HApESq6YGTVxNInX6ZRRAp5I2Is0udOj38IpS6VimUhyTWmnm9hR8QLl9bj3D/S4XJphX0KvRrdBjP+jOGiWFIeKg== 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=AmOmowWToL5H4fyzescauGMW6KgkQznb3QYfIQnxuks=; b=O8ppIbTWcFiK2/cl9tPCmOd4Jx2CvRXnT48g2BaEOoQx9NAlGzMwnjVHksSkocaPfrCAEvtP1yuiZBc2p+JanPNvtTf2povIJ775SEAFm7NFZTkRi0nBule8qV96W7gOBb6213yF3mTCpB9c6vNK8M9eIi6t1pCB7BnRxhnU0pse05jeEgB4cM1FaqX+ULXbZlKbmaLGz/EBca0A3DRwQbl6JKK/peGu1wBLMgYW9HapRZSp1qUtPnac3Qg0c1oAQlwAIfqjh5KlbqYwpLD5W1Id91yxI2XynkqIcYu6V/ElpyjF/PB1mmd2JAxyQLh+4YcqEE5JSLYFcstrQqX3Dw== 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=AmOmowWToL5H4fyzescauGMW6KgkQznb3QYfIQnxuks=; b=hJBro/pHxslynNLBMYEydT1GHzoXSkEZeD2euSHHGNCXhGZG9FgsFn826bZo2pIz7iyfVpCtKZYef4sm3C8RBnki/V+sJv0qrxXVROxffTjuQo5cvyd1ym7NfW7Nfn6vJ0+bbocQU8n8QnSnHF2t6yQXOGxpfu/xWW0j8fuUY84= Received: from AS9PR06CA0762.eurprd06.prod.outlook.com (2603:10a6:20b:484::20) by AS8PR07MB7367.eurprd07.prod.outlook.com (2603:10a6:20b:2a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10; Wed, 5 Oct 2022 09:20:06 +0000 Received: from AM5EUR02FT069.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:484:cafe::88) by AS9PR06CA0762.outlook.office365.com (2603:10a6:20b:484::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.26 via Frontend Transport; Wed, 5 Oct 2022 09:20:06 +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 AM5EUR02FT069.mail.protection.outlook.com (10.152.8.227) 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:05 +0000 Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESSMR502.ericsson.se (153.88.183.110) 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:03 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.192) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:03 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 95B2A1C006B; Wed, 5 Oct 2022 11:20:03 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v2 2/6] service: introduce per-lcore cycles counter Date: Wed, 5 Oct 2022 11:16:11 +0200 Message-ID: <20221005091615.94652-3-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5EUR02FT069:EE_|AS8PR07MB7367:EE_ X-MS-Office365-Filtering-Correlation-Id: 39ab0699-8061-4340-03f1-08daa6b2ca9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OIjt3MwhnpEsa5Zwberam1Swt6umRC7jUDEO3OKMPOU3fk16anyM2YeUc+OWUD1D6wZG9IqRLHhcgj1Gt3MV8cZKUORnvpPcwoCPSW5+nejR1tfqSt6opy+cB5d6JwO3J2fdZOGIeP20sFFUZsEnYtt0kU3sRPAf/pTcrQBjaQdr7n+CzvP1iCXv9Il3MygDaHIsehH/wtc0XVSpaEED1oil5igDnqVw2KudSUsE8dnK72vIAjEamtp//toYJXoQ42sOiazxv97KEk19/W6xlC3fmPxiwvA0+dMxc+sJeUefpO6QwjqsozPdoM/wwsrdnHkw7EsjctXdHatfZeZcl6b0xCPhH2cOa5USDpt8Em6eiP/I3FhknpAlJG0/WKXTbgVKp5f7n1/MWrJ/IwJ/lewkv2wufpYGiZW2lXc3Y0C6U7tXMFILJR/DguMdCnVHxa4uChZkPzDzN7DQlHdVX0GOLaCePloh4u08N+ohLYV3sxkLjXdmM1L6x5waTsEOE0wUDACptCUwGJeKClLtdf5+Sx/sH0heGfD0/WJKkURdiWlgwjyP714wvILAV7SKkO3ni1j1JTnmRxL07qaWuS8+mLuI8mLZlZ9CcbNDigIIv4JDZ2KIaMD9tipeZkvqOxrTltgmZnjNbo9pgAg1AmchwhkakkpYclUKkzZxHopw9y+xNw1Vg9TvVg3wqgFewtJ7byFT6HCJZWW/j77/2IP+MZbMpt9fBYjKwj6CUFmp4NDCgmvF7F9kb7d/meHaO70FKkKLBLYi3G/NxuigIyYtc5E1/MUEqYcteHqkhx1xHWXo091SJlApbPpwFLY3 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)(396003)(346002)(136003)(39860400002)(376002)(451199015)(46966006)(36840700001)(40470700004)(107886003)(7636003)(6666004)(41300700001)(8676002)(82310400005)(70586007)(70206006)(83380400001)(2906002)(356005)(2616005)(40460700003)(1076003)(66574015)(47076005)(186003)(82740400003)(82960400001)(4326008)(8936002)(36756003)(36860700001)(336012)(6266002)(5660300002)(26005)(40480700001)(86362001)(478600001)(316002)(54906003)(6916009); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:05.9398 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39ab0699-8061-4340-03f1-08daa6b2ca9d 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: AM5EUR02FT069.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7367 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 Introduce a per-lcore counter for the total time spent on processing services on that core. This counter is useful when measuring individual lcore load. Signed-off-by: Mattias Rönnblom --- app/test/test_service_cores.c | 2 +- lib/eal/common/rte_service.c | 15 +++++++++++++++ lib/eal/include/rte_service.h | 6 ++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index 7415b6b686..096405133b 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -403,7 +403,7 @@ service_lcore_attr_get(void) "lcore_attr_get() failed to get loops " "(expected > zero)"); - lcore_attr_id++; // invalid lcore attr id + lcore_attr_id = 42; /* invalid lcore attr id */ TEST_ASSERT_EQUAL(-EINVAL, rte_service_lcore_attr_get(slcore_id, lcore_attr_id, &lcore_attr_value), "Invalid lcore attr didn't return -EINVAL"); diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c index 6b807afacf..4d51de638d 100644 --- a/lib/eal/common/rte_service.c +++ b/lib/eal/common/rte_service.c @@ -66,6 +66,7 @@ struct core_state { uint8_t is_service_core; /* set if core is currently a service core */ uint8_t service_active_on_lcore[RTE_SERVICE_NUM_MAX]; uint64_t loops; + uint64_t cycles; struct service_stats service_stats[RTE_SERVICE_NUM_MAX]; } __rte_cache_aligned; @@ -376,6 +377,9 @@ service_runner_do_callback(struct rte_service_spec_impl *s, * is needed, and not the more expensive atomic * add. */ + __atomic_store_n(&cs->cycles, cs->cycles + cycles, + __ATOMIC_RELAXED); + struct service_stats *service_stats = &cs->service_stats[service_idx]; @@ -819,6 +823,14 @@ lcore_attr_get_loops(unsigned int lcore) return __atomic_load_n(&cs->loops, __ATOMIC_RELAXED); } +static uint64_t +lcore_attr_get_cycles(unsigned int lcore) +{ + struct core_state *cs = &lcore_states[lcore]; + + return __atomic_load_n(&cs->cycles, __ATOMIC_RELAXED); +} + static uint64_t lcore_attr_get_service_calls(uint32_t service_id, unsigned int lcore) { @@ -903,6 +915,9 @@ rte_service_lcore_attr_get(uint32_t lcore, uint32_t attr_id, case RTE_SERVICE_LCORE_ATTR_LOOPS: *attr_value = lcore_attr_get_loops(lcore); return 0; + case RTE_SERVICE_LCORE_ATTR_CYCLES: + *attr_value = lcore_attr_get_cycles(lcore); + return 0; default: return -EINVAL; } diff --git a/lib/eal/include/rte_service.h b/lib/eal/include/rte_service.h index 35d8018684..70deb6e53a 100644 --- a/lib/eal/include/rte_service.h +++ b/lib/eal/include/rte_service.h @@ -407,6 +407,12 @@ int32_t rte_service_attr_reset_all(uint32_t id); */ #define RTE_SERVICE_LCORE_ATTR_LOOPS 0 +/** + * Returns the total number of cycles that the lcore has spent on + * running services. + */ +#define RTE_SERVICE_LCORE_ATTR_CYCLES 1 + /** * Get an attribute from a service core. * From patchwork Wed Oct 5 09:16:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117371 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DB2CA0542; Wed, 5 Oct 2022 11:20:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BFF9427F3; Wed, 5 Oct 2022 11:20:10 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2068.outbound.protection.outlook.com [40.107.21.68]) by mails.dpdk.org (Postfix) with ESMTP id 271D840E2D for ; Wed, 5 Oct 2022 11:20:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oFa+e28QgJXafwXdiAg6hjS++Ju66lYkrVUc6L90ad/ZJNxDhtrNoWftKhBVAMCHKJqkOU4xswhH9aeKh2HMrUJMpPVmiKDurB4Fw8ya4pAarty6hCZKwrA9poNMOhRl7KB4Ihu3kvw7YKKqBmWH7g2Dmvw1/8A3pFnEIwI8wHxOS9p62JpHz0IEPdxEPFJGjzsFdXOCpU/ZNY9ptGBed+54qUok9ZKTQwuFjM1xNAZW2K6gT3ppurKCX69eZnPM1ImRsnFlTP+GHalbutQLd+pwexIk0dyuOUXta3O8f4QOWx79MHmB+JCIre6rVpuLB8VNbQa8gwj5R1fCeVCbUw== 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=58eC5StAEVExrYz9sZYsgCwhm28+XmKmgk6yaCVnjDo=; b=Oq4OgH5qS17clGgbtnRnZLzHgr5YYB3iq/AO8OxpOkTef2YrFpEGq8pWjZ9WfSZDzNac58fC35ujtDIQkSgIeNGY7LB9pv1XoaP0nypaYpD4lZjawIT+WadRrBnCXJ9xUjFYYW9CMQM1zlpLq4xzdc1l5L5pUTYlidlqFx0juWXfaizrg5kXUTe0bap9dRiKqk0OYKgETPJL4oWLhKLSXFXtHKT6hioaO8nqE6R33StAQDjr7C+3GfvnmE3ZLUVKHGXqfvEpEzl5N5+IN/4feRqEkwL2vXHksYxTTLJjRxDXH+ZKz64ysOmu/JEYRum5gk9iW2fs/OFtKDM0XYNScQ== 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=58eC5StAEVExrYz9sZYsgCwhm28+XmKmgk6yaCVnjDo=; b=AaEnc0E3IyG+8c2VWotvvnGXQRaMgT5/U12CQ8mjr0tK47xMeZwfuTbL6hM8z/LPI8nnVdcsRNc8jETNMR2IMwGT9orY2m3ZUbAIEbue1QB1f7srFezNG6l/QB6IS6rAu/kTBICAWgWRZ0trKcDcrjzTIo0xSMXP4f5KIErDz4c= Received: from AM6P192CA0066.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::43) by DB8PR07MB6283.eurprd07.prod.outlook.com (2603:10a6:10:140::9) 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:07 +0000 Received: from AM5EUR02FT049.eop-EUR02.prod.protection.outlook.com (2603:10a6:209:82:cafe::e0) by AM6P192CA0066.outlook.office365.com (2603:10a6:209:82::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.32 via Frontend Transport; Wed, 5 Oct 2022 09:20:06 +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 AM5EUR02FT049.mail.protection.outlook.com (10.152.9.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.5676.17 via Frontend Transport; Wed, 5 Oct 2022 09:20:06 +0000 Received: from ESESSMB502.ericsson.se (153.88.183.163) 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; Wed, 5 Oct 2022 11:20:04 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.190) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:03 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 1E8FB1C0069; Wed, 5 Oct 2022 11:20:04 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v2 3/6] service: reduce average case service core overhead Date: Wed, 5 Oct 2022 11:16:12 +0200 Message-ID: <20221005091615.94652-4-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5EUR02FT049:EE_|DB8PR07MB6283:EE_ X-MS-Office365-Filtering-Correlation-Id: de657893-2cc4-43e2-5c78-08daa6b2cb1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zQAlUAgNdPpSca/HxRyzRt18SxNdXZ17CKjZmuRtWRiB/Z5eHw35EJdC2l0KnLE7ZnP7JKfHeFbTrlbqjx/ijRaUTFCC9hvzAoTzahHSwpmVahg5gbxIYNmKr/GeOSq4qTBmIN5QpdSOPRar3D4fNlkhZy8DHQ9/57JTgr6TBQZISGi7g5xgt+UM42g09BBAAg5jitsvJJpOBgQ2tR+wlKNOFL9UbSQeXWP00ae0SmTyTNcDW9g/2PbsOOU+CKiHoMmFu5Rp0q5Ldvry2iW/KVX+vOkL4iYInaQM2ml8mSm3kTevmM0qD9kfsmusDhcKqJ1o/aeTfOOxl+hsuka6f7IJN7qndF0FHjsMZT+5ybzzqsfDW2okWNDO9JGwEsVtMz8WaUxomDPfFVHNeLP1m0k+imNX2s0pV6p4n0vDlX+x/OlpZfTJ6a1SJWv1Qq6AJUmHDjXOM+Myvnh3CayuD5y9AFlWVw4JfEa9heJwgDuhbS/aEeN77KAsjN4BntoKuUGy7ueyuURW/eNAiquUm6ch8BrsTW0UZZax6RSN5Q08beOs4E5XpbzaQpF79zGS3PK3gePqL99ApOPMdYhTaSPX1ojiwUPyvUMGRnA6p4dyD1SbPeHhlZY2oG5Mfv+gI16ag4b15HdDyC3g3qr6iqgrYHhe89vl81Ptv9hDOJqrnwt9QIZpcTZtvghf/HpH4ta4HQ8ixvYJVdNxFruaDZt0s9VO0S6dxOBM2WMuzgOm+ZGRO/T5eAaXwBtPMdRKkMQDIay/aCnQovmpjbzTGQ== 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)(136003)(346002)(39860400002)(396003)(376002)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(478600001)(6266002)(2616005)(70206006)(186003)(36756003)(70586007)(2906002)(8936002)(5660300002)(66574015)(47076005)(336012)(4326008)(8676002)(6666004)(26005)(316002)(6916009)(83380400001)(40480700001)(86362001)(107886003)(1076003)(36860700001)(40460700003)(356005)(54906003)(82960400001)(41300700001)(7636003)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:06.7613 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: de657893-2cc4-43e2-5c78-08daa6b2cb1a 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: AM5EUR02FT049.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR07MB6283 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 Optimize service loop so that the starting point is the lowest-indexed service mapped to the lcore in question, and terminate the loop at the highest-indexed service. While the worst case latency remains the same, this patch significantly reduces the service framework overhead for the average case. In particular, scenarios where an lcore only runs a single service, or multiple services which id values are close (e.g., three services with ids 17, 18 and 22), show significant improvements. The worse case is a where the lcore two services mapped to it; one with service id 0 and the other with id 63. On a service lcore serving a single service, the service loop overhead is reduced from ~190 core clock cycles to ~46, on an Intel Cascade Lake generation Xeon. On weakly ordered CPUs, the gain is larger, since the loop included load-acquire atomic operations. Signed-off-by: Mattias Rönnblom --- v2: Added build-time assertion to prevent the maximum number of services to accidentally be changed to a higher value than the implementation supports. (Harry van Haaren) --- lib/eal/common/rte_service.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c index 4d51de638d..035c36b8bb 100644 --- a/lib/eal/common/rte_service.c +++ b/lib/eal/common/rte_service.c @@ -78,6 +78,11 @@ static uint32_t rte_service_library_initialized; int32_t rte_service_init(void) { + /* Hard limit due to the use of an uint64_t-based bitmask (and the + * clzl intrinsic). + */ + RTE_BUILD_BUG_ON(RTE_SERVICE_NUM_MAX > 64); + if (rte_service_library_initialized) { RTE_LOG(NOTICE, EAL, "service library init() called, init flag %d\n", @@ -472,7 +477,6 @@ static int32_t service_runner_func(void *arg) { RTE_SET_USED(arg); - uint32_t i; const int lcore = rte_lcore_id(); struct core_state *cs = &lcore_states[lcore]; @@ -486,10 +490,17 @@ service_runner_func(void *arg) RUNSTATE_RUNNING) { const uint64_t service_mask = cs->service_mask; + uint8_t start_id; + uint8_t end_id; + uint8_t i; - for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) { - if (!service_registered(i)) - continue; + if (service_mask == 0) + continue; + + start_id = __builtin_ctzl(service_mask); + end_id = 64 - __builtin_clzl(service_mask); + + for (i = start_id; i < end_id; i++) { /* return value ignored as no change to code flow */ service_run(i, cs, service_mask, service_get(i), 1); } From patchwork Wed Oct 5 09:16:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117369 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2093CA0542; Wed, 5 Oct 2022 11:20:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F21642670; Wed, 5 Oct 2022 11:20:08 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2076.outbound.protection.outlook.com [40.107.21.76]) by mails.dpdk.org (Postfix) with ESMTP id D340A40694 for ; Wed, 5 Oct 2022 11:20:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N6ha+29ivm1E+0xRBPcgnp/b0qb7/QVsZMa3/k/iUOuiH/rQYJr8vbzWaGsremPN663WrXocZHjPk2tSTpidrEO2ERCtsHGdSq0zJXlpeCvNqtJD/WTzomeGsUwD6c6TUcUvUhL+kqH3h62sDbLGv1IRuKyH9DyZCSgAaAXTYvJx7qqsyxuNGwvorbVI01R/9DaSDdHgnIU4b62A9EG/oE1mQr9wrKW2ncUmz+WtCFq4IIhuveQ1/tyuA7cWA5svb2KfA7p8iq4fzqoG4G9FcIQzchQFrBtbSOAhS+kWJ5j0I0bsaVRarrpLQagn3d3+oA2yxobuKrUenTxauqK8lA== 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=RnQBfxfiG4j25vKsnQz4g87/cQnd0+c6alEQTabV+5Q=; b=Yv2VZMSnCAQyedZ4aqPVfcdt+AHlUkU/jce4MeL+HMb98MX3AiE1hFzCUCKvoO0M3EW69HmKyLDBUMeqM3xB3AnxmlczsaYcO8Bd+SK+9PCVkTA9niOCf88tpRAJAvh6rJGqWAG84/71JICBR8oozoXSwLl2KGRq0UdLTBlZ31L0RgleLwhFCAuhQ7nAr33fhh0i9sQfBBysLbl2UkoZVFM2sixrVZ6OIjUE7QWNwYGDPAcsyKLJaEXjLwD0WhxHgl6/NcvWyORLT0nEnO5cRVViI98DWDXhratjOEYvdmQ3nTgJBXfaYMHMFwAEJE7TL9DygYaM7Z6xTo10x5IAVg== 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=RnQBfxfiG4j25vKsnQz4g87/cQnd0+c6alEQTabV+5Q=; b=X2SmPZDxCWMdQD+A0AihwOsxfxbEHsoBIHw9SLRGnT7bpsP6QZ7W8W/NtxvCLYLGt1UcX8m8CDFp06R5xSrWpUBx8uiahyakQRSjAk4ts27WEXGT+dxaOpMbHpreEMS3GdcrtHLZ/r4yGjx9Ti79wjrDYcK8HJdadw0gpcfs1JM= Received: from AS9PR06CA0353.eurprd06.prod.outlook.com (2603:10a6:20b:466::30) by PR3PR07MB6875.eurprd07.prod.outlook.com (2603:10a6:102:7e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10; Wed, 5 Oct 2022 09:20:05 +0000 Received: from AM5EUR02FT099.eop-EUR02.prod.protection.outlook.com (2603:10a6:20b:466:cafe::5) by AS9PR06CA0353.outlook.office365.com (2603:10a6:20b:466::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24 via Frontend Transport; Wed, 5 Oct 2022 09:20:05 +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 AM5EUR02FT099.mail.protection.outlook.com (10.152.9.29) 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:05 +0000 Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMR503.ericsson.se (153.88.183.135) 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 ESESSMB502.ericsson.se (153.88.183.163) by ESESBMB503.ericsson.se (153.88.183.170) 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:04 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.190) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:04 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id CA9C41C0069; Wed, 5 Oct 2022 11:20:04 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v2 4/6] service: tweak cycle statistics semantics Date: Wed, 5 Oct 2022 11:16:13 +0200 Message-ID: <20221005091615.94652-5-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5EUR02FT099:EE_|PR3PR07MB6875:EE_ X-MS-Office365-Filtering-Correlation-Id: a8a5f44a-1e00-4551-272f-08daa6b2ca60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BRqHfXUdZnuGAr03wbYFMng5bQA7Co5VjtlJZq7A+YokO7Z+l8H55bPXG7hbJ0oPiQyP3JtBP26bzHToV7Uv5fmfo9Z1ReONLRX9bbpX+Qpnew/3bXd07NmNBldlVaRuvj24eZ9Tby+jYOHFMCThyxrLsaX48KCjDw84g32t3StYGi/LKwNG8Yf7J4odUmuiWkDo8+BZcGHvnJP3Dqcll8y/2R+hQS7HpOag3P0VbE2epeR3vwyqkGL5jHrcbzpNfHS8PmHTwZqeBoUA9obi8wktcuAo6uPiRSe0wTr2rxlfRpIbTMogFGqmihDyLutwtB7Unox038tXRv0zFSV/ehpCYkgGjXRjMLHRN5N7l1FfJs08k+TZ+qeiHtD6heN5Tu3PZ5mxgX0eAmzQElEXR+u6wshoJWomAlu/7ChiYT5C2m2Ffe1RZeJHIVmClv7Vh7LgmK+lNVGwukcj7f9UNi4kYq5Am4Nlrftw1n+kD8Om2yj85fnXuTSP9Ml696Uh6EASRixjHZ9AhZmJjY6KymVoAau+rINsOvSn2wz7QkflrjAita+tAqXeAD2HkOR9gy2y0MiW8EE8mgznBacFy0YAvh8CwvPS21XdKfFBIdJBjXuBDkreGeDgdY20IXOELxqnJJCW2zG4jXhVwW4252zJ60C0QExbFqLaIeM5T6srtmEgOO0MLlFkX9hDr1nNPB0JHIuKddSQNukD4rtQ0nsNZTF7jSkrXTrGdNhGoUREFFhEoMPkxPboczVKUzSV5FdYVx2j9ObrMpyqR/6UJg== 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)(346002)(376002)(136003)(39860400002)(396003)(451199015)(40470700004)(36840700001)(46966006)(6666004)(107886003)(54906003)(6916009)(478600001)(86362001)(82310400005)(41300700001)(36756003)(8936002)(5660300002)(316002)(70586007)(8676002)(4326008)(70206006)(36860700001)(83380400001)(82740400003)(82960400001)(40480700001)(7636003)(356005)(40460700003)(6266002)(26005)(186003)(1076003)(2616005)(66574015)(336012)(47076005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:05.5566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8a5f44a-1e00-4551-272f-08daa6b2ca60 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: AM5EUR02FT099.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR07MB6875 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 As a part of its service function, a service usually polls some kind of source (e.g., an RX queue, a ring, an eventdev port, or a timer wheel) to retrieve one or more items of work. In low-load situations, the service framework reports a significant amount of cycles spent for all running services, despite the fact they have performed little or no actual work. The per-call cycle expenditure for an idle service (i.e., a service currently without pending jobs) is typically very low. Polling an empty ring or RX queue is inexpensive. However, since the service function call frequency on an idle or lightly loaded lcore is going to be very high indeed, the service function calls' cycles adds up to a significant amount. The only thing preventing the idle services' cycles counters to make up 100% of the available CPU cycles is the overhead of the service framework itself. If the RTE_SERVICE_ATTR_CYCLES or RTE_SERVICE_LCORE_ATTR_CYCLES are used to estimate service core load, the cores may look very busy when the system is mostly doing nothing useful at all. This patch allows for an idle service to indicate that no actual work was performed during a particular service function call (by returning -EAGAIN). In such cases the RTE_SERVICE_ATTR_CYCLES and RTE_SERVICE_LCORE_ATTR_CYCLES values are not incremented. The convention of returning -EAGAIN for idle services may in the future also be used to have the lcore enter a short sleep, or reduce its operating frequency, in case all services are currently idle. This change is backward-compatible. Signed-off-by: Mattias Rönnblom --- lib/eal/common/rte_service.c | 26 +++++++++++++------------ lib/eal/include/rte_service_component.h | 5 +++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c index 035c36b8bb..718371814f 100644 --- a/lib/eal/common/rte_service.c +++ b/lib/eal/common/rte_service.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -373,28 +374,29 @@ service_runner_do_callback(struct rte_service_spec_impl *s, if (service_stats_enabled(s)) { uint64_t start = rte_rdtsc(); - s->spec.callback(userdata); - uint64_t end = rte_rdtsc(); - uint64_t cycles = end - start; + int rc = s->spec.callback(userdata); /* The lcore service worker thread is the only writer, * and thus only a non-atomic load and an atomic store * is needed, and not the more expensive atomic * add. */ - __atomic_store_n(&cs->cycles, cs->cycles + cycles, - __ATOMIC_RELAXED); - struct service_stats *service_stats = &cs->service_stats[service_idx]; - __atomic_store_n(&service_stats->calls, - service_stats->calls + 1, - __ATOMIC_RELAXED); + if (likely(rc != -EAGAIN)) { + uint64_t end = rte_rdtsc(); + uint64_t cycles = end - start; - __atomic_store_n(&service_stats->cycles, - service_stats->cycles + cycles, - __ATOMIC_RELAXED); + __atomic_store_n(&cs->cycles, cs->cycles + cycles, + __ATOMIC_RELAXED); + __atomic_store_n(&service_stats->cycles, + service_stats->cycles + cycles, + __ATOMIC_RELAXED); + } + + __atomic_store_n(&service_stats->calls, + service_stats->calls + 1, __ATOMIC_RELAXED); } else s->spec.callback(userdata); } diff --git a/lib/eal/include/rte_service_component.h b/lib/eal/include/rte_service_component.h index 9e66ee7e29..9be49d698a 100644 --- a/lib/eal/include/rte_service_component.h +++ b/lib/eal/include/rte_service_component.h @@ -19,6 +19,11 @@ extern "C" { /** * Signature of callback function to run a service. + * + * A service function call resulting in no actual work being + * performed, should return -EAGAIN. In that case, the (presumbly few) + * cycles spent will not be counted toward the lcore or service-level + * cycles attributes. */ typedef int32_t (*rte_service_func)(void *args); From patchwork Wed Oct 5 09:16:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117372 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=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 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; } From patchwork Wed Oct 5 09:16:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Mattias_R=C3=B6nnblom?= X-Patchwork-Id: 117373 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43682A0542; Wed, 5 Oct 2022 11:20:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44E7142B6C; Wed, 5 Oct 2022 11:20:12 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by mails.dpdk.org (Postfix) with ESMTP id 12F16427F3 for ; Wed, 5 Oct 2022 11:20:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HPWi2M4kd0TJPpXZTRxttuMywmHvCF/sDbU7rn+HC324a+/OmrvpLEszMR+brozJYTCZ8Y7nzcPQ/SoA8wqalEhV/y7/vx7PA+YInMVuS9CjW72EiuYAW/N0Pb9MNFaLFdl7md8o33cM7bHmT/kcqgOvvntgw6iLwbMe/A7V+JurQRXeukihGspN9oBxkpd7XYWucUOmqoYApkPNXkuSngJzcyxZkA5g+JJvOu2rB2RfCZSP6w3UWtWJOLrkKIRg0LUB7e3Gn+JSbdFRHrc3g36IiTMg1bxrE5rWpKr0h0So142ZUxiMwHKmeexD+w3RitNWRrN2t88OZ7QhbyqCmg== 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=2LS0P000MZ7yF1YZP1Cn00rREYWnihJtZCoXwThnuGs=; b=cfJiqLKOQC8a7gXkOKKiRFIXlXS2s346o9tMM+8Am/miMJWl/nt1Z64UT2QGjCTyauo+zGZNPCAImh9pzV+8egSZnM/lYIbMuiDn3dbQ3u6MdLoC5KG8lHaUKVneoIO1yC0GJEqPMffuv3uWSIpzk7BsABAMwOsEetTjmgVSOLQ4IzZfZcg1EqinY3qcuSMdy4xqrfukBDsKGthadiFMQBCi1seWTPbXG0Y+zNK9ZUxsnPW18RZfcndtDRF4LfZyx7kuckcMoFSV9kQS1TcsJ7MVP6uaXjvGK7qPkGvcnIIkflyIygbwNv1CRxqPEXb2NbxIm61Epq/5XPWJSB7qkw== 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=2LS0P000MZ7yF1YZP1Cn00rREYWnihJtZCoXwThnuGs=; b=Ji6WaOViqytjQfXcr4HqpoAoDsHc30fySTJZf9YYSn3uOF2gnaWP4fsE9rjMreSmXHPqCvy7a5IXYPWGzSSIPxKCqEodmO64ACJMSLwRulGjczn5Osx4NLRK7MIS3T50G1g4rO4FRkbYO5F2x5yoE+MdpDl09hBhvf+Mm0CSyf4= Received: from OL1P279CA0023.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:13::10) by DU0PR07MB8905.eurprd07.prod.outlook.com (2603:10a6:10:316::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10; Wed, 5 Oct 2022 09:20:08 +0000 Received: from HE1EUR02FT019.eop-EUR02.prod.protection.outlook.com (2603:10a6:e10:13:cafe::98) by OL1P279CA0023.outlook.office365.com (2603:10a6:e10:13::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.32 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 HE1EUR02FT019.mail.protection.outlook.com (10.152.10.70) 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:08 +0000 Received: from ESESSMB501.ericsson.se (153.88.183.162) by ESESBMR506.ericsson.se (153.88.183.202) 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:06 +0200 Received: from seliicinfr00050.seli.gic.ericsson.se (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.189) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Wed, 5 Oct 2022 11:20:06 +0200 Received: from localhost.localdomain (seliicwb00002.seli.gic.ericsson.se [10.156.25.100]) by seliicinfr00050.seli.gic.ericsson.se (Postfix) with ESMTP id 05FE81C0060; Wed, 5 Oct 2022 11:20:06 +0200 (CEST) From: =?utf-8?q?Mattias_R=C3=B6nnblom?= To: Van@dpdk.org, Haaren@dpdk.org, Harry CC: , Honnappa Nagarahalli , =?utf-8?q?Morten_Br=C3=B8rup?= , nd , , =?utf-8?q?Mattias_R=C3=B6nnblom?= Subject: [PATCH v2 6/6] service: provide links to functions in documentation Date: Wed, 5 Oct 2022 11:16:15 +0200 Message-ID: <20221005091615.94652-7-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 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1EUR02FT019:EE_|DU0PR07MB8905:EE_ X-MS-Office365-Filtering-Correlation-Id: d4d63a99-4664-49f1-5ca2-08daa6b2cc03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 56jiSDj+xTypOvRxyo5MXNuQH7oANWhEzTe2v0Gt3uvrkYCtkyGEX8U346UChMet3UGaDUzGp6BSlwtOug+G8bLaCatEsuG5HDE0ymzb1R010OJx+E32I3KM7foiJYFKt2d+OV+ynzraNhBzkByBXeKuvBSsEuwaOgdCkgcmINVGXKDssnPgEGeBWVIWUZsL+l5Z+q4890GXBcgKD+SUFxqwhSxnG6lLIiWalSxRYNjlndRqAYbXg3cvolxnBzRZ8YnXM/7MNEGs2n4mVpWGsqyRBIijkwBjCxhbi5u3absY9yBIqrZ5zj9C/CA0DJc+uDJ38UmvErhGA4WfhuEB3HPwTk9TLooX2S0LtDUW8IUIDH1SJ28irp8wQW12abb/2uZt1Q5aA/qXkXn8fYRuIg6WJfxdWcZ2sunhpe/8nEp9T7AsM80LBqXDBHbq8ukhHAostywLZmZiNmIKARCpEZXn7G3jGP6ADuOG6RwX9hGh8GGwZ+nj1b52l8tUavehODxeowzAeAxvpxaB7FpwuwPhMa7OJZCRZOb1flB0AREKPZb8MRZUkbYLXf+zBoYDhjRDr3Ij7c5oa3declFjcnQtoGU8LtcxXusNHmw7G99dc0gE7947Zj0106wSeVwQEtm7b/q6vsr/D2sJzWIT421COpBpK00XcU406BpoxiU8vVHy8i54h4SJXRIOpwiS2q0CYXQuei8QB6+9r4tNInRFVO6bxlnUB6xnY3qyXuA4kpdDIi1TaULZ3JZp8StysnuLs41eG78hBUb4hdQUEg== 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)(136003)(396003)(39860400002)(346002)(451199015)(40470700004)(46966006)(36840700001)(2616005)(478600001)(70206006)(40480700001)(70586007)(36756003)(186003)(1076003)(41300700001)(8676002)(336012)(4326008)(36860700001)(6916009)(54906003)(82740400003)(82960400001)(40460700003)(2906002)(356005)(26005)(6266002)(316002)(7636003)(8936002)(5660300002)(6666004)(86362001)(107886003)(83380400001)(82310400005)(47076005)(66574015); DIR:OUT; SFP:1101; X-OriginatorOrg: ericsson.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 09:20:08.3195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4d63a99-4664-49f1-5ca2-08daa6b2cc03 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: HE1EUR02FT019.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8905 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 Refer to API functions with parenthesis, making doxygen create hyperlinks. Signed-off-by: Mattias Rönnblom --- lib/eal/include/rte_service.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/eal/include/rte_service.h b/lib/eal/include/rte_service.h index 70deb6e53a..90116a773a 100644 --- a/lib/eal/include/rte_service.h +++ b/lib/eal/include/rte_service.h @@ -37,7 +37,7 @@ extern "C" { /* Capabilities of a service. * - * Use the *rte_service_probe_capability* function to check if a service is + * Use the rte_service_probe_capability() function to check if a service is * capable of a specific capability. */ /** When set, the service is capable of having multiple threads run it at the @@ -147,13 +147,13 @@ int32_t rte_service_map_lcore_get(uint32_t service_id, uint32_t lcore); int32_t rte_service_runstate_set(uint32_t id, uint32_t runstate); /** - * Get the runstate for the service with *id*. See *rte_service_runstate_set* + * Get the runstate for the service with *id*. See rte_service_runstate_set() * for details of runstates. A service can call this function to ensure that * the application has indicated that it will receive CPU cycles. Either a * service-core is mapped (default case), or the application has explicitly * disabled the check that a service-cores is mapped to the service and takes * responsibility to run the service manually using the available function - * *rte_service_run_iter_on_app_lcore* to do so. + * rte_service_run_iter_on_app_lcore() to do so. * * @retval 1 Service is running * @retval 0 Service is stopped @@ -181,7 +181,7 @@ rte_service_may_be_active(uint32_t id); /** * Enable or disable the check for a service-core being mapped to the service. * An application can disable the check when takes the responsibility to run a - * service itself using *rte_service_run_iter_on_app_lcore*. + * service itself using rte_service_run_iter_on_app_lcore(). * * @param id The id of the service to set the check on * @param enable When zero, the check is disabled. Non-zero enables the check. @@ -216,7 +216,7 @@ int32_t rte_service_set_runstate_mapped_check(uint32_t id, int32_t enable); * atomics, applications can choose to enable or disable this feature * * Note that any thread calling this function MUST be a DPDK EAL thread, as - * the *rte_lcore_id* function is used to access internal data structures. + * the rte_lcore_id() function is used to access internal data structures. * * @retval 0 Service was run on the calling thread successfully * @retval -EBUSY Another lcore is executing the service, and it is not a @@ -232,7 +232,7 @@ int32_t rte_service_run_iter_on_app_lcore(uint32_t id, * * Starting a core makes the core begin polling. Any services assigned to it * will be run as fast as possible. The application must ensure that the lcore - * is in a launchable state: e.g. call *rte_eal_lcore_wait* on the lcore_id + * is in a launchable state: e.g. call rte_eal_lcore_wait() on the lcore_id * before calling this function. * * @retval 0 Success @@ -248,7 +248,7 @@ int32_t rte_service_lcore_start(uint32_t lcore_id); * service core. Note that the service lcore thread may not have returned from * the service it is running when this API returns. * - * The *rte_service_lcore_may_be_active* API can be used to check if the + * The rte_service_lcore_may_be_active() API can be used to check if the * service lcore is * still active. * * @retval 0 Success @@ -265,7 +265,7 @@ int32_t rte_service_lcore_stop(uint32_t lcore_id); * Reports if a service lcore is currently running. * * This function returns if the core has finished service cores code, and has - * returned to EAL control. If *rte_service_lcore_stop* has been called but + * returned to EAL control. If rte_service_lcore_stop() has been called but * the lcore has not returned to EAL yet, it might be required to wait and call * this function again. The amount of time to wait before the core returns * depends on the duration of the services being run. @@ -293,7 +293,7 @@ int32_t rte_service_lcore_add(uint32_t lcore); /** * Removes lcore from the list of service cores. * - * This can fail if the core is not stopped, see *rte_service_core_stop*. + * This can fail if the core is not stopped, see rte_service_core_stop(). * * @retval 0 Success * @retval -EBUSY Lcore is not stopped, stop service core before removing. @@ -308,7 +308,7 @@ int32_t rte_service_lcore_del(uint32_t lcore); * service core count can be used in mapping logic when creating mappings * from service cores to services. * - * See *rte_service_lcore_list* for details on retrieving the lcore_id of each + * See rte_service_lcore_list() for details on retrieving the lcore_id of each * service core. * * @return The number of service cores currently configured. @@ -344,14 +344,14 @@ int32_t rte_service_set_stats_enable(uint32_t id, int32_t enable); * indicating the lcore_id of a service core. * * Adding and removing service cores can be performed using - * *rte_service_lcore_add* and *rte_service_lcore_del*. - * @param [out] array An array of at least *rte_service_lcore_count* items. + * rte_service_lcore_add() and rte_service_lcore_del(). + * @param [out] array An array of at least rte_service_lcore_count() items. * If statically allocating the buffer, use RTE_MAX_LCORE. * @param [out] n The size of *array*. * @retval >=0 Number of service cores that have been populated in the array * @retval -ENOMEM The provided array is not large enough to fill in the * service core list. No items have been populated, call this function - * with a size of at least *rte_service_core_count* items. + * with a size of at least rte_service_core_count() items. */ int32_t rte_service_lcore_list(uint32_t array[], uint32_t n);