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 CD881A0093; Thu, 10 Mar 2022 13:39:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B448D4116E; Thu, 10 Mar 2022 13:39:05 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id B9FBF41163 for ; Thu, 10 Mar 2022 13:39:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646915943; x=1678451943; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y713IiW0BW4AgS3hIHYSa3swdhG/8rPdNnJt5GpYnaY=; b=Hvtl3ddfxs5IBvuiC4QYDWkspGV6PoHm43iJT29N/+oFJvVowNDBf0PP wWcPN7cJHDYySg6HcONGrYyoUZLwTFQQYSS24ZzB5zsWxLiE/NrBYJyfk 5Po8UfJI1WqW2FRj4unAFIT2dZ9FzayMjAtPdg/BQSFqiPm+J/s7iPjm/ g0SrjSJEAUQpbV6hQx9Rm2IJNsCM/ZAObxLb3Ud4yllnRPuSqVtKdmgCO H6oy2cB8pz1ew95JBfqiwSvo+wdcWekrE++wN/90eJP8NfMtsB8xOKMR1 wWEFgFsduVgRF3gpdnsbIF1f6OQ098npVsfy9TEpeGr7e97X6Ja9sKH6y Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10281"; a="315957625" X-IronPort-AV: E=Sophos;i="5.90,170,1643702400"; d="scan'208";a="315957625" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2022 04:39:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,170,1643702400"; d="scan'208";a="513970240" Received: from silpixa00399126.ir.intel.com ([10.237.223.34]) by orsmga006.jf.intel.com with ESMTP; 10 Mar 2022 04:39:01 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: john.mcnamara@intel.com, Bruce Richardson Subject: [PATCH v2 6/8] doc/linux_gsg: shorten details on HPET use Date: Thu, 10 Mar 2022 12:38:41 +0000 Message-Id: <20220310123843.612207-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220310123843.612207-1-bruce.richardson@intel.com> References: <20220308145001.529734-1-bruce.richardson@intel.com> <20220310123843.612207-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 best we can tell, the HPET timers are not commonly used, so there is little need to give extensive detail and commentry on them in the Linux GSG. As such, we can reduce the GSG section to just a single subsection and also move it down the page below items which are likely of greater importance. Signed-off-by: Bruce Richardson --- doc/guides/linux_gsg/enable_func.rst | 80 ++++++++++------------------ 1 file changed, 27 insertions(+), 53 deletions(-) diff --git a/doc/guides/linux_gsg/enable_func.rst b/doc/guides/linux_gsg/enable_func.rst index b5c4c652d7..0036c542f5 100644 --- a/doc/guides/linux_gsg/enable_func.rst +++ b/doc/guides/linux_gsg/enable_func.rst @@ -8,59 +8,6 @@ Enabling Additional Functionality ================================= -.. _High_Precision_Event_Timer: - -High Precision Event Timer (HPET) Functionality ------------------------------------------------ - -BIOS Support -~~~~~~~~~~~~ - -The High Precision Timer (HPET) must be enabled in the platform BIOS if the HPET is to be used. -Otherwise, the Time Stamp Counter (TSC) is used by default. -The BIOS is typically accessed by pressing F2 while the platform is starting up. -The user can then navigate to the HPET option. On the Crystal Forest platform BIOS, the path is: -**Advanced -> PCH-IO Configuration -> High Precision Timer ->** (Change from Disabled to Enabled if necessary). - -On a system that has already booted, the following command can be issued to check if HPET is enabled:: - - grep hpet /proc/timer_list - -If no entries are returned, HPET must be enabled in the BIOS (as per the instructions above) and the system rebooted. - -Linux Kernel Support -~~~~~~~~~~~~~~~~~~~~ - -The DPDK makes use of the platform HPET timer by mapping the timer counter into the process address space, and as such, -requires that the ``HPET_MMAP`` kernel configuration option be enabled. - -.. warning:: - - On Fedora, and other common distributions such as Ubuntu, the ``HPET_MMAP`` kernel option is not enabled by default. - To recompile the Linux kernel with this option enabled, please consult the distributions documentation for the relevant instructions. - -Enabling HPET in the DPDK -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default, HPET support is disabled in the DPDK build configuration files. -To use HPET, use the following meson build option which will enable the HPET settings at compile time:: - - meson configure -Duse_hpet=true - -For an application to use the ``rte_get_hpet_cycles()`` and ``rte_get_hpet_hz()`` API calls, -and optionally to make the HPET the default time source for the rte_timer library, -the new ``rte_eal_hpet_init()`` API call should be called at application initialization. -This API call will ensure that the HPET is accessible, returning an error to the application if it is not, -for example, if ``HPET_MMAP`` is not enabled in the kernel. -The application can then determine what action to take, if any, if the HPET is not available at run-time. - -.. note:: - - For applications that require timing APIs, but not the HPET timer specifically, - it is recommended that the ``rte_get_timer_cycles()`` and ``rte_get_timer_hz()`` API calls be used instead of the HPET-specific APIs. - These generic APIs can work with either TSC or HPET time sources, depending on what is requested by an application call to ``rte_eal_hpet_init()``, - if any, and on what is available on the system at runtime. - .. _Running_Without_Root_Privileges: Running DPDK Applications Without Root Privileges @@ -154,6 +101,33 @@ the following should be added to the kernel parameter list: isolcpus=2,4,6 +.. _High_Precision_Event_Timer: + +High Precision Event Timer (HPET) Functionality +----------------------------------------------- + +DPDK can support the system HPET as a timer source rather than the system default timers, +such as the core Time-Stamp Counter (TSC) on x86 systems. +To enable HPET support in DPDK: + +1. Ensure that HPET is enabled in BIOS settings. +2. Enable ``HPET_MMAP`` support in kernel configuration. + Note that this my involve doing a kernel rebuild, + as many common linux distributions do *not* have this setting enabled by default in their kernel builds. +3. Enable DPDK support for HPET by using the build-time meson option ``use_hpet``, + for example, ``meson configure -Duse_hpet=true`` + +For an application to use the ``rte_get_hpet_cycles()`` and ``rte_get_hpet_hz()`` API calls, +and optionally to make the HPET the default time source for the rte_timer library, +the ``rte_eal_hpet_init()`` API call should be called at application initialization. +This API call will ensure that the HPET is accessible, returning an error to the application if it is not. + +For applications that require timing APIs, but not the HPET timer specifically, +it is recommended that the ``rte_get_timer_cycles()`` and ``rte_get_timer_hz()`` API calls be used instead of the HPET-specific APIs. +These generic APIs can work with either TSC or HPET time sources, +depending on what is requested by an application call to ``rte_eal_hpet_init()``, +if any, and on what is available on the system at runtime. + Loading the DPDK KNI Kernel Module ---------------------------------- -- 2.32.0