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 82CA941EB1; Thu, 16 Mar 2023 17:17:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6EDFF42D61; Thu, 16 Mar 2023 17:17:47 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id ADEE042D69 for ; Thu, 16 Mar 2023 17:17:45 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id c18so2278685ple.11 for ; Thu, 16 Mar 2023 09:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678983465; 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=pZmb3j4CHJwbrp+N2h7GxRsRtbw2Rk71Q+w7vKN5R/w=; b=n4f5NSUZ65jQQ+OcVLyuMBO5xuYH5yONnvX2kmhcSZ8M09e6OTNos8OopP6TUxms10 7rC9X94fwhHMw/2FDiiqRhf0PQAhqMfC41bgErfkyfa7VUHx51o8W1VcoMD8tC5wIFYd qI8b54yKqRKb3N56GrPSgu0v7SYvlwXW9SAg3+y+MSJ7LcpbAiQ65lr7/0KkolZoKF93 AE+YKIS7T3CQzCPmKFftjGn58W7nfuGpMwMG6I1ZkDNKgh1TJ2rG3qQ5tRNBAdtIK9oG EkkvGpB+z8GdyLxmWi38wi9NUKaCsCoqpod9XWAv9LFpf9dQneoOIGf/a+1h+yENOFLs iIkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678983465; 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=pZmb3j4CHJwbrp+N2h7GxRsRtbw2Rk71Q+w7vKN5R/w=; b=a/AOaRqUKvZBmBNgOUI7y+/766XPMmhckx47D9AcLz++ENG77k6kqf4Epie2PS64Jr +1XJnGxVERrtFmCC3qYo+3tWGckQ8SFp9A4IDHryAiQnwH71GWPsTu+1OW74ladGMfW0 PNtKgT+N5gw4re7pFLq/bz3DTi/oABUyzRZMotSQT/3d1ajsLDkp8O7VfwgC4wOJOqmT 9DiqcpewDiK2/LiuFEfDNPYObxmp7wPvIvcy7pqh06E9kVxCVUBNxHkQtR5ll8yUSpXF ZnZtXtnssE8u+IonJwAn7stiME51h1oKe+0itOP1Us3upRYFjIgsUmZLZMELMd+xwXkN TS2Q== X-Gm-Message-State: AO0yUKWbROHB4cK1OlsKBANR2cl/zbilJdcZsnNep8+Wmf/93ZcAi+WY gvHr1vYsrkkBO9ACqLF/HmI4H3qcVi4UDFwxjETFsg== X-Google-Smtp-Source: AK7set9BIij0fDJlU0QHtwJcCjHuutNAQi24DRAJJIOwi1DZtweis45FXfnpLU/jJIv0GolrVs70Lg== X-Received: by 2002:a17:90b:1d06:b0:234:b35b:f8ee with SMTP id on6-20020a17090b1d0600b00234b35bf8eemr4705674pjb.0.1678983464916; Thu, 16 Mar 2023 09:17:44 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id w23-20020a17090a15d700b00233b5d6b4b5sm3352255pjd.16.2023.03.16.09.17.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 09:17:44 -0700 (PDT) Date: Thu, 16 Mar 2023 09:17:43 -0700 From: Stephen Hemminger To: Anthony Harivel Cc: Aman Singh , Yuying Zhang , dev@dpdk.org, rjarry@redhat.com, david.marchand@redhat.com, ktraynor@redhat.com Subject: Re: [PATCH 2/2] app/testpmd: add testpmd based sleeping Message-ID: <20230316091743.1652bf17@hermes.local> In-Reply-To: <20230316151438.186241-2-aharivel@redhat.com> References: <20230316151438.186241-1-aharivel@redhat.com> <20230316151438.186241-2-aharivel@redhat.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 Thu, 16 Mar 2023 16:14:38 +0100 Anthony Harivel wrote: > Sleep for an incremental amount of time if the fwd engine has processed > less than at least half a burst of packets (i.e 16pkts with default > setting) on a polling iteration of testpmd. > > Upon detecting the threshold of >= 16 pkts on an Rxq, reset the sleep > time to zero (i.e. no sleep). > > Sleep time will be increased on each iteration where the low load > conditions remain up to a total of the max sleep time which is set by > the user with the "--max-sleep-us NUM" command line argument or when in > interactive "mode set max_sleep NUM". > > The default max_sleep value is 0, which means that no sleeps will occur > and the default behaviour is unchanged from previously. > > Testing has been performed on AMD EPYC 7702 server with --nb-cores 12. > The results were obtained via turbostat for each individual lcore: > > max_sleep 0 ====== ======== ======== ======== > idle 4Mpps 16Mpps Bursts > =============== ====== ======== ======== ======== > C1-state % 0 0 0 0 > C2-state % 0 0 0 0 > % usage 100 100 100 100 > Watt / core 1.14 1.18 1.19 1.14 > =============== ====== ======== ======== ======== > > max_sleep 500 ====== ======== ======== ======== > idle 4Mpps 16Mpps Bursts > =============== ====== ======== ======== ======== > C1-state % 99 85 74 98.6 > C2-state % 0 0 0 0 > % usage 1 15 26 1 > Watt / core 0.04 0.18 0.28 0 04 > =============== ====== ======== ======== ======== > > max_sleep 1000 ====== ======== ======== ======== > idle 4Mpps 16Mpps Bursts > =============== ====== ======== ======== ======== > C1-state % 0 85 74 0.3 > C2-state % 99 0 0 97.6 > % usage 1 15 25 1 > Watt / core 0.02 0.18 0.28 0 02 > =============== ====== ======== ======== ======== > > On most cases, the consumption of the cores is greatly improved while > still performing zero packet loss. > > Latency test has been performed on each tests above. The CPU has a C1 > latency of 1us and a C2 latency of 400us. On the worst case scenario, Tx > Burst of thousands packets every seconds, the following latency in us > (micro seconds) has been observed: > > =========== ==== ===== ====== > max_sleep 0 500 1000 > ----------- ---- ----- ------ > max latency 14 560 1260 > min latency 5 5 6 > Avg latency 7 305 617 > =========== ==== ===== ====== > > link: https://www.github.com/torvalds/linux/tree/master/tools/power/x86/turbostat > Signed-off-by: Anthony Harivel Testpmd is already grown beyond the original intended scope. This seems like a feature which would be better added to forwarding example apps. This is just feature creep here.