From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 964BBA00BE; Wed, 27 May 2020 19:34:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0B5011D9FD; Wed, 27 May 2020 19:34:18 +0200 (CEST) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by dpdk.org (Postfix) with ESMTP id 9DC421D9D3 for ; Wed, 27 May 2020 19:34:16 +0200 (CEST) Received: by mail-io1-f68.google.com with SMTP id y18so6519709iow.3 for ; Wed, 27 May 2020 10:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7LK3Jigw9tCg+kIhfYW2MBcvzMjZuZLqtpbGHeQKJwM=; b=SX1TqigE6wLoqTlRgB3D82zt6ZxPtCMR1pmSHpGUA9gGZ0u9cPowRKGxiDIZrhTMRw U6KR6RJgZ1EX2CFOsalwG4a8xZNmHuV4U2BPfSdePQz+spM5pY7QasV9X2y2FBeK4qxE +wxs6ref3RE+6XJDHUgOg6Xf1pU2g/FIDE0YE5wVBSnbULyUkzPQhuHz8G6OE0vsDqqZ zHH0wHHITCblBxr2Skke6JKdbrKUh0ZBbJVMrclAULDJP9sQYvAr47eCPnk81f/y91Jt bffNGva1gpBkq8EHMupSfJ2iXJsB27DPDgF0PUAMsb+SpyWlEa1c2KEQvTSTU756s4/D UBng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7LK3Jigw9tCg+kIhfYW2MBcvzMjZuZLqtpbGHeQKJwM=; b=hOQIRkNCqvPUGKV9j/xomdrtYhFU8vJp84J/rdMcLP5Y3NqlIlw5Da2MdmiC7j/3hD bj2grjb3/bVBOYMuh1h2YQOPee6z8NTA15P7i2Pzf2O56NdbIJCsL2B4qIElpBv2/S2P zkfWbDjJ1moVR47xw/S2denwAWkve/KjYvLYguqa1aZHb8N58fZpt+dw5Ppe7zCFAlGM nL1AyPJG9oZW5HaThdAzns9GcB9eGmAeeumQfjV0KS+MU2r/DtElC9HAjbkfv4cr6Q6W WDnBWHqB97+zdgz2M073sWVLN+2FBuXxtr+XMIGfgX+UfJGzipBnYSd87T8aLiaj9h3d OFWA== X-Gm-Message-State: AOAM530UWZs69w3R24s9YD6EDVjn5MslarSdylKgQqpdi9JjRxZS1EZ+ GaZu/UaHT7kuqV9vregTdX5fSFN4KIGO97UKueQ= X-Google-Smtp-Source: ABdhPJx9NbcZGhNrAWj9858GsDTkmzVDAASNVY1uqkhvhbEqR6lgXQPYE+sVc6RzCJQQ35hyAlAssloZV5KI6/7fa4M= X-Received: by 2002:a02:1c83:: with SMTP id c125mr6679589jac.112.1590600855631; Wed, 27 May 2020 10:34:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jerin Jacob Date: Wed, 27 May 2020 23:03:59 +0530 Message-ID: To: Anatoly Burakov Cc: dpdk-dev , David Hunt , Liang Ma Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [RFC 0/6] Power-optimized RX for Ethernet devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, May 27, 2020 at 10:32 PM Anatoly Burakov wrote: > > This patchset proposes a simple API for Ethernet drivers > to cause the CPU to enter a power-optimized state while > waiting for packets to arrive, along with a set of > (hopefully generic) intrinsics that facilitate that. This > is achieved through cooperation with the NIC driver that > will allow us to know address of the next NIC RX ring > packet descriptor, and wait for writes on it. > > On IA, this is achieved through using UMONITOR/UMWAIT > instructions. They are used in their raw opcode form > because there is no widespread compiler support for > them yet. Still, the API is made generic enough to > hopefully support other architectures, if they happen > to implement similar instructions. > > To achieve power savings, there is a very simple mechanism > used: we're counting empty polls, and if a certain threshold > is reached, we get the address of next RX ring descriptor > from the NIC driver, arm the monitoring hardware, and > enter a power-optimized state. We will then wake up when > either a timeout happens, or a write happens (or generally > whenever CPU feels like waking up - this is platform- > specific), and proceed as normal. The empty poll counter is > reset whenever we actually get packets, so we only go to > sleep when we know nothing is going on. > > Why are we putting it into ethdev as opposed to leaving > this up to the application? Our customers specifically > requested a way to do it wit minimal changes to the > application code. The current approach allows to just > flip a switch and automagically have power savings. > > There are certain limitations in this patchset right now: > - Currently, only 1:1 core to queue mapping is supported, > meaning that each lcore must at most handle RX on a > single queue > - Currently, power management is enabled per-port, not > per-queue > - There is potential to greatly increase TX latency if we > are buffering things, and go to sleep before sending > packets > - The API is not perfect and could use some improvement > and discussion > - The API doesn't extend to other device types > - The intrinsics are platform-specific, so ethdev has > some platform-specific code in it > - Support was only implemented for devices using > net/ixgbe, net/i40e and net/ice drivers > > Hopefully this would generate enough feedback to clear > a path forward! Just for my understanding: How/Is this solution is superior than Rx queue interrupt based scheme that applied in l3fwd-power? What I meant by superior here, as an example, a)Is there any power savings in mill watt vs interrupt scheme? b) Is there improvement on time reduction between switching from/to a different state (i.e how fast it can move from low power state to full power state) vs interrupt scheme. etc or This just for just pushing all the logic to ethdev so that applications can be transparent? > > Anatoly Burakov (6): > eal: add power management intrinsics > ethdev: add simple power management API > net/ixgbe: implement power management API > net/i40e: implement power management API > net/ice: implement power management API > app/testpmd: add command for power management on a port > > app/test-pmd/cmdline.c | 48 +++++++ > drivers/net/i40e/i40e_ethdev.c | 1 + > drivers/net/i40e/i40e_rxtx.c | 23 +++ > drivers/net/i40e/i40e_rxtx.h | 2 + > drivers/net/ice/ice_ethdev.c | 1 + > drivers/net/ice/ice_rxtx.c | 23 +++ > drivers/net/ice/ice_rxtx.h | 2 + > drivers/net/ixgbe/ixgbe_ethdev.c | 1 + > drivers/net/ixgbe/ixgbe_rxtx.c | 22 +++ > drivers/net/ixgbe/ixgbe_rxtx.h | 2 + > .../include/generic/rte_power_intrinsics.h | 64 +++++++++ > lib/librte_eal/include/meson.build | 1 + > lib/librte_eal/x86/include/meson.build | 1 + > lib/librte_eal/x86/include/rte_cpuflags.h | 1 + > .../x86/include/rte_power_intrinsics.h | 134 ++++++++++++++++++ > lib/librte_eal/x86/rte_cpuflags.c | 2 + > lib/librte_ethdev/rte_ethdev.c | 39 +++++ > lib/librte_ethdev/rte_ethdev.h | 70 +++++++++ > lib/librte_ethdev/rte_ethdev_core.h | 41 +++++- > lib/librte_ethdev/rte_ethdev_version.map | 4 + > 20 files changed, 480 insertions(+), 2 deletions(-) > create mode 100644 lib/librte_eal/include/generic/rte_power_intrinsics.h > create mode 100644 lib/librte_eal/x86/include/rte_power_intrinsics.h > > -- > 2.17.1