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 28C66A0A0A; Fri, 22 Jan 2021 18:12:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFB69141053; Fri, 22 Jan 2021 18:12:22 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 8919214103B for ; Fri, 22 Jan 2021 18:12:19 +0100 (CET) IronPort-SDR: TzbnpfN7ga1gPOkKLmoEQjWejXhR150q4J73TvVFQKKByM8x0I2gS+GTC/D9aIJ0sFamPeF1FI Uymybn0A8/eQ== X-IronPort-AV: E=McAfee;i="6000,8403,9872"; a="176901750" X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="176901750" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:12:18 -0800 IronPort-SDR: 9eUe1qWUByar+YQIn95srFC6rzPU8qZqTNSv1fVzQuPTDHfc6Tly8KehaxBHr4AgkzssvDyyOG SngaIDI3+8ag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="571191474" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.222.179]) by orsmga005.jf.intel.com with ESMTP; 22 Jan 2021 09:12:17 -0800 From: Anatoly Burakov To: dev@dpdk.org Cc: thomas@monjalon.net Date: Fri, 22 Jan 2021 17:12:13 +0000 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v20 0/4] Add PMD power management 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 Sender: "dev" 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. There are multiple proposed mechanisms to achieve said power savings: simple frequency scaling, idle loop, and monitoring the Rx queue for incoming packages. The latter is achieved through cooperation with the NIC driver that will allow us to know address of wake up event, and wait for writes on that address. To achieve power savings, there is a very simple mechanism used: we're counting empty polls, and if a certain threshold is reached, we employ one of the suggested power management schemes automatically, from within a Rx callback inside the PMD. Once there's traffic again, the empty poll counter is reset. 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 with minimal changes to the application code. The current approach allows to just flip a switch and automatically have power savings. Things of note: - Only 1:1 core to queue mapping is supported, meaning that each lcore must at most handle RX on a single queue - Support 3 type policies. Monitor/Pause/Frequency Scaling - Power management is enabled per-queue - The API doesn't extend to other device types v20: - Moved callback removal before port close v19: - Renamed "data_sz" to "size" and clarified struct comments - Clarified documentation around rte_power_monitor/pause API v18: - Rebase on top of latest main - Address review comments by Thomas v17: - Added exception for ethdev driver-only ABI - Added memory barriers for monitor/wakeup (Konstantin) - Fixed compiled issues on non-x86 platforms (hopefully!) v16: - Implemented Konstantin's suggestions and comments - Added return values to the API v15: - Fixed incorrect check in UMWAIT callback - Fixed accidental whitespace changes v14: - Fixed ARM/PPC builds - Addressed various review comments v13: - Reworked the librte_power code to require less locking and handle invalid parameters better - Fix numerous rebase errors present in v12 v12: - Rebase on top of 21.02 - Rework of power intrinsics code Anatoly Burakov (2): eal: rename power monitor condition member eal: improve comments around power monitoring API Liang Ma (2): power: add PMD power management API and callback examples/l3fwd-power: enable PMD power mgmt doc/guides/prog_guide/power_man.rst | 41 ++ doc/guides/rel_notes/release_21_02.rst | 10 + .../sample_app_ug/l3_forward_power_man.rst | 35 ++ drivers/event/dlb/dlb.c | 2 +- drivers/event/dlb2/dlb2.c | 2 +- drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/ice/ice_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- examples/l3fwd-power/main.c | 90 ++++- .../include/generic/rte_power_intrinsics.h | 39 +- lib/librte_eal/x86/rte_power_intrinsics.c | 4 +- lib/librte_power/meson.build | 5 +- lib/librte_power/rte_power_pmd_mgmt.c | 365 ++++++++++++++++++ lib/librte_power/rte_power_pmd_mgmt.h | 91 +++++ lib/librte_power/version.map | 5 + 15 files changed, 669 insertions(+), 26 deletions(-) create mode 100644 lib/librte_power/rte_power_pmd_mgmt.c create mode 100644 lib/librte_power/rte_power_pmd_mgmt.h -- 2.25.1