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 007AFA0093; Mon, 7 Nov 2022 17:01:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95F6C4067C; Mon, 7 Nov 2022 17:01:49 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id C399740156 for ; Mon, 7 Nov 2022 17:01:47 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id u8-20020a17090a5e4800b002106dcdd4a0so15074779pji.1 for ; Mon, 07 Nov 2022 08:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=+xdh9ysg/DEdXpTI39oFyheQTdBbbHf7f+zLnj4mpNM=; b=rHic/IFXF2iGAQocIFVd0AOfMhfLpL+un0wy91ymmQmHrjrbtiMlgA8mk5Gi4eF+p5 8TjS7i1yrjQ3OrKjwDbUwooa/gyy9JxXiPP+AmL0xDoS51ojNZNGRfaIeXnHIfDdwztP a13jXHZXC26RskrPIkVCW/0TV53HTLd+vJE4XTEo8w6Y5tEW8Jdo9wh5gcVHPZo1+/gp VMgmwwX6MJC74BMG55naPeKBrVnRWdpQ9vOoA6TPlBZoSVjE4E/W0w5d39MV7UXbnGHi k3xpBGifJPuoEbcbkqhoTdVgDcm8bHHkP2XDUMI45uTaxj46+Vj6d4bqQbhrtl9lUCWR Wrlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+xdh9ysg/DEdXpTI39oFyheQTdBbbHf7f+zLnj4mpNM=; b=H6zYqeWEu+TVWtKbUoAIEipGM2teucHoIGHyQLFzdwjtDGG6mQzcXOFjFv6O8xMsi6 4GFJpJLckNcBLl+lT/9YFmrS0DjPEmrFoICrmuaLSJjeW35ZuBOfI2MTbQ7vAjZBH/79 WfDytyRfo+5FbUIu1Mva7Ccp/pg0zT7H635fLZlGoYW53bknub94sbtUTYZttDwpyz+l M6OGoGQsTTy6W+M8D7DFVtDGGHrHaHVSFPoj0QOzWgOIMEdu7zhvbAgcbDj1Birmus+h D5cDISbVHZ9YrXUzYpoxwRQ8l7bZ/WNDCsHsG+J06QW5tr4+Da2aANgHmrevmDMwDzLq 6JiA== X-Gm-Message-State: ACrzQf17Y5jnS/6plZ7aVzvbUgkoFtipI+LhKlv4BQfx0ve8KK00R01w SDuY6UzKZWFiWUZCfxaKxWwzwg== X-Google-Smtp-Source: AMsMyM6Vh1uuihodkxrwdV/RTfpJRn5HyjTtlH7BLiY4Zfe7UxVyHHeZGeTPBTzIIJK7M6wtdSr/oQ== X-Received: by 2002:a17:902:ce8a:b0:186:9d96:b93c with SMTP id f10-20020a170902ce8a00b001869d96b93cmr52699224plg.123.1667836906717; Mon, 07 Nov 2022 08:01:46 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id y188-20020a6232c5000000b0056ded8d5918sm4655063pfy.134.2022.11.07.08.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Nov 2022 08:01:46 -0800 (PST) Date: Mon, 7 Nov 2022 08:01:44 -0800 From: Stephen Hemminger To: Feifei Wang Cc: David Hunt , dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, nd@arm.com, Ruifeng Wang Subject: Re: [PATCH v2 3/3] examples/l3fwd-power: enable PMD power monitor on Arm Message-ID: <20221107080144.34cdde78@hermes.local> In-Reply-To: <20221107070449.3319078-4-feifei.wang2@arm.com> References: <20220825064251.2637274-1-feifei.wang2@arm.com> <20221107070449.3319078-1-feifei.wang2@arm.com> <20221107070449.3319078-4-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 7 Nov 2022 15:04:49 +0800 Feifei Wang wrote: > + /* Ensure the main lcore does not enter the power-monitor state, > + * so that it can be used to wake up other lcores on ARM. > + * This is due to WFE instruction has no timeout wake-up mechanism, > + * and if users want to exit actively, the main lcore is needed > + * to send SEV instruction to wake up other lcores. > + */ > + unsigned int main_lcore = rte_get_main_lcore(); This can be done in a simpler an cleaner manner with a continue statement earlier in the loop. diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd3ade330f82..115535fd4cd7 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2984,6 +2984,16 @@ main(int argc, char **argv) } if (app_mode == APP_MODE_PMD_MGMT && !baseline_enabled) { +#ifdef RTE_ARCH_ARM64 + /* Ensure the main lcore does not enter the power-monitor state, + * so that it can be used to wake up other lcores on ARM. + * This is due to WFE instruction has no timeout wake-up mechanism, + * and if users want to exit actively, the main lcore is needed + * to send SEV instruction to wake up other lcors. + */ + if (lcore_id == rte_get_main_lcore()) + continue; +#endif /* Set power_pmd_mgmt configs passed by user */ rte_power_pmd_mgmt_set_emptypoll_max(max_empty_polls); ret = rte_power_pmd_mgmt_set_pause_duration(pause_duration);