Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1393/?format=api
https://patches.dpdk.org/api/patches/1393/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416492419-11957-3-git-send-email-sergio.gonzalez.monroy@intel.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1416492419-11957-3-git-send-email-sergio.gonzalez.monroy@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1416492419-11957-3-git-send-email-sergio.gonzalez.monroy@intel.com", "date": "2014-11-20T14:06:59", "name": "[dpdk-dev,2/2] eal: Remove unused HPET support from FreeBSD", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "41fbfc28940487529bd7e496201a10683e4aab8a", "submitter": { "id": 73, "url": "https://patches.dpdk.org/api/people/73/?format=api", "name": "Sergio Gonzalez Monroy", "email": "sergio.gonzalez.monroy@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416492419-11957-3-git-send-email-sergio.gonzalez.monroy@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/1393/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/1393/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 0F2E47F6D;\n\tThu, 20 Nov 2014 14:56:35 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 941B47F40\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 14:56:32 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP; 20 Nov 2014 06:07:01 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga001.fm.intel.com with ESMTP; 20 Nov 2014 06:07:00 -0800", "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tsAKE70AF008153 for <dev@dpdk.org>; Thu, 20 Nov 2014 14:07:00 GMT", "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id sAKE70cx012011\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 14:07:00 GMT", "(from smonroy@localhost)\n\tby sivswdev02.ir.intel.com with id sAKE70d6012006\n\tfor dev@dpdk.org; Thu, 20 Nov 2014 14:07:00 GMT" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.07,424,1413270000\"; d=\"scan'208\";a=\"625525320\"", "From": "Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 20 Nov 2014 14:06:59 +0000", "Message-Id": "<1416492419-11957-3-git-send-email-sergio.gonzalez.monroy@intel.com>", "X-Mailer": "git-send-email 1.8.5.4", "In-Reply-To": "<1416492419-11957-1-git-send-email-sergio.gonzalez.monroy@intel.com>", "References": "<1416492419-11957-1-git-send-email-sergio.gonzalez.monroy@intel.com>", "Subject": "[dpdk-dev] [PATCH 2/2] eal: Remove unused HPET support from FreeBSD", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The HPET support in the BSD EAL was copied directly from the Linux version,\nbut did not actually work on FreeBSD. We replace this old code with a simple\ncompiler message that informs the user that we don't support HPET on BSD if\nthey enable such support in the build-time configuration file.\n\nSigned-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal_timer.c | 187 ++--------------------------------\n 1 file changed, 7 insertions(+), 180 deletions(-)", "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_timer.c b/lib/librte_eal/bsdapp/eal/eal_timer.c\nindex 67da167..3163496 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_timer.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_timer.c\n@@ -30,17 +30,10 @@\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n-\n #include <string.h>\n-#include <stdlib.h>\n #include <stdio.h>\n-#include <stdint.h>\n #include <unistd.h>\n-#include <fcntl.h>\n #include <inttypes.h>\n-#include <sys/mman.h>\n-#include <sys/queue.h>\n-#include <pthread.h>\n #include <sys/types.h>\n #include <sys/sysctl.h>\n #include <errno.h>\n@@ -57,111 +50,14 @@\n #include \"eal_private.h\"\n #include \"eal_internal_cfg.h\"\n \n-enum timer_source eal_timer_source = EAL_TIMER_HPET;\n-\n-/* The frequency of the RDTSC timer resolution */\n-static uint64_t eal_tsc_resolution_hz = 0;\n-\n #ifdef RTE_LIBEAL_USE_HPET\n-\n-#define DEV_HPET \"/dev/hpet\"\n-\n-/* Maximum number of counters. */\n-#define HPET_TIMER_NUM 3\n-\n-/* General capabilities register */\n-#define CLK_PERIOD_SHIFT 32 /* Clock period shift. */\n-#define CLK_PERIOD_MASK 0xffffffff00000000ULL /* Clock period mask. */\n-\n-/**\n- * HPET timer registers. From the Intel IA-PC HPET (High Precision Event\n- * Timers) Specification.\n- */\n-struct eal_hpet_regs {\n-\t/* Memory-mapped, software visible registers */\n-\tuint64_t capabilities; /**< RO General Capabilities Register. */\n-\tuint64_t reserved0; /**< Reserved for future use. */\n-\tuint64_t config; /**< RW General Configuration Register. */\n-\tuint64_t reserved1; /**< Reserved for future use. */\n-\tuint64_t isr; /**< RW Clear General Interrupt Status. */\n-\tuint64_t reserved2[25]; /**< Reserved for future use. */\n-\tunion {\n-\t\tuint64_t counter; /**< RW Main Counter Value Register. */\n-\t\tstruct {\n-\t\t\tuint32_t counter_l; /**< RW Main Counter Low. */\n-\t\t\tuint32_t counter_h; /**< RW Main Counter High. */\n-\t\t};\n-\t};\n-\tuint64_t reserved3; /**< Reserved for future use. */\n-\tstruct {\n-\t\tuint64_t config; /**< RW Timer Config and Capability Reg. */\n-\t\tuint64_t comp; /**< RW Timer Comparator Value Register. */\n-\t\tuint64_t fsb; /**< RW FSB Interrupt Route Register. */\n-\t\tuint64_t reserved4; /**< Reserved for future use. */\n-\t} timers[HPET_TIMER_NUM]; /**< Set of HPET timers. */\n-};\n-\n-/* Mmap'd hpet registers */\n-static volatile struct eal_hpet_regs *eal_hpet = NULL;\n-\n-/* Period at which the HPET counter increments in\n- * femtoseconds (10^-15 seconds). */\n-static uint32_t eal_hpet_resolution_fs = 0;\n-\n-/* Frequency of the HPET counter in Hz */\n-static uint64_t eal_hpet_resolution_hz = 0;\n-\n-/* Incremented 4 times during one 32bits hpet full count */\n-static uint32_t eal_hpet_msb;\n-\n-static pthread_t msb_inc_thread_id;\n-\n-/*\n- * This function runs on a specific thread to update a global variable\n- * containing used to process MSB of the HPET (unfortunatelly, we need\n- * this because hpet is 32 bits by default under linux).\n- */\n-static void\n-hpet_msb_inc(__attribute__((unused)) void *arg)\n-{\n-\tuint32_t t;\n-\n-\twhile (1) {\n-\t\tt = (eal_hpet->counter_l >> 30);\n-\t\tif (t != (eal_hpet_msb & 3))\n-\t\t\teal_hpet_msb ++;\n-\t\tsleep(10);\n-\t}\n-}\n-\n-uint64_t\n-rte_get_hpet_hz(void)\n-{\n-\tif(internal_config.no_hpet)\n-\t\trte_panic(\"Error, HPET called, but no HPET present\\n\");\n-\n-\treturn eal_hpet_resolution_hz;\n-}\n-\n-uint64_t\n-rte_get_hpet_cycles(void)\n-{\n-\tuint32_t t, msb;\n-\tuint64_t ret;\n-\n-\tif(internal_config.no_hpet)\n-\t\trte_panic(\"Error, HPET called, but no HPET present\\n\");\n-\n-\tt = eal_hpet->counter_l;\n-\tmsb = eal_hpet_msb;\n-\tret = (msb + 2 - (t >> 30)) / 4;\n-\tret <<= 32;\n-\tret += t;\n-\treturn ret;\n-}\n-\n+#warning HPET is not supported in FreeBSD\n #endif\n \n+enum timer_source eal_timer_source = EAL_TIMER_TSC;\n+\n+/* The frequency of the RDTSC timer resolution */\n+static uint64_t eal_tsc_resolution_hz = 0;\n \n void\n rte_delay_us(unsigned us)\n@@ -178,70 +74,6 @@ rte_get_tsc_hz(void)\n \treturn eal_tsc_resolution_hz;\n }\n \n-\n-#ifdef RTE_LIBEAL_USE_HPET\n-/*\n- * Open and mmap /dev/hpet (high precision event timer) that will\n- * provide our time reference.\n- */\n-int\n-rte_eal_hpet_init(int make_default)\n-{\n-\tint fd, ret;\n-\n-\tif (internal_config.no_hpet) {\n-\t\tRTE_LOG(INFO, EAL, \"HPET is disabled\\n\");\n-\t\treturn -1;\n-\t}\n-\n-\tfd = open(DEV_HPET, O_RDONLY);\n-\tif (fd < 0) {\n-\t\tRTE_LOG(ERR, EAL, \"ERROR: Cannot open \"DEV_HPET\": %s!\\n\",\n-\t\t\tstrerror(errno));\n-\t\tinternal_config.no_hpet = 1;\n-\t\treturn -1;\n-\t}\n-\teal_hpet = mmap(NULL, 1024, PROT_READ, MAP_SHARED, fd, 0);\n-\tif (eal_hpet == MAP_FAILED) {\n-\t\tRTE_LOG(ERR, EAL, \"ERROR: Cannot mmap \"DEV_HPET\"!\\n\"\n-\t\t\t\t\"Please enable CONFIG_HPET_MMAP in your kernel configuration \"\n-\t\t\t\t\"to allow HPET support.\\n\"\n-\t\t\t\t\"To run without using HPET, set CONFIG_RTE_LIBEAL_USE_HPET=n \"\n-\t\t\t\t\"in your build configuration or use '--no-hpet' EAL flag.\\n\");\n-\t\tclose(fd);\n-\t\tinternal_config.no_hpet = 1;\n-\t\treturn -1;\n-\t}\n-\tclose(fd);\n-\n-\teal_hpet_resolution_fs = (uint32_t)((eal_hpet->capabilities &\n-\t\t\t\t\tCLK_PERIOD_MASK) >>\n-\t\t\t\t\tCLK_PERIOD_SHIFT);\n-\n-\teal_hpet_resolution_hz = (1000ULL*1000ULL*1000ULL*1000ULL*1000ULL) /\n-\t\t(uint64_t)eal_hpet_resolution_fs;\n-\n-\tRTE_LOG(INFO, EAL, \"HPET frequency is ~%\"PRIu64\" kHz\\n\",\n-\t\t\teal_hpet_resolution_hz/1000);\n-\n-\teal_hpet_msb = (eal_hpet->counter_l >> 30);\n-\n-\t/* create a thread that will increment a global variable for\n-\t * msb (hpet is 32 bits by default under linux) */\n-\tret = pthread_create(&msb_inc_thread_id, NULL,\n-\t\t\t(void *(*)(void *))hpet_msb_inc, NULL);\n-\tif (ret < 0) {\n-\t\tRTE_LOG(ERR, EAL, \"ERROR: Cannot create HPET timer thread!\\n\");\n-\t\tinternal_config.no_hpet = 1;\n-\t\treturn -1;\n-\t}\n-\n-\tif (make_default)\n-\t\teal_timer_source = EAL_TIMER_HPET;\n-\treturn 0;\n-}\n-#endif\n-\n static int\n set_tsc_freq_from_sysctl(void)\n {\n@@ -264,7 +96,6 @@ set_tsc_freq_from_sysctl(void)\n \t\tRTE_LOG(WARNING, EAL, \"TSC is not invariant\\n\");\n \n \tsz = sizeof(eal_tsc_resolution_hz);\n-\n \tif (sysctlbyname(\"machdep.tsc_freq\", &eal_tsc_resolution_hz, &sz, NULL, 0)) {\n \t\tRTE_LOG(WARNING, EAL, \"%s\\n\", strerror(errno));\n \t\treturn -1;\n@@ -289,9 +120,8 @@ set_tsc_freq_fallback(void)\n * This function measures the TSC frequency. It uses a variety of approaches.\n *\n * 1. Read the TSC frequency value provided by the kernel\n- * 2. If kernel does not provide that, and we have HPET support, tune using HPET\n- * 3. Lastly, if neither of the above can be used, just sleep for 1 second and\n- * tune off that, printing a warning about inaccuracy of timing\n+ * 2. If above does not work, just sleep for 1 second and tune off that,\n+ * printing a warning about inaccuracy of timing\n */\n static void\n set_tsc_freq(void)\n@@ -306,9 +136,6 @@ set_tsc_freq(void)\n int\n rte_eal_timer_init(void)\n {\n-\n-\teal_timer_source = EAL_TIMER_TSC;\n-\n \tset_tsc_freq();\n \treturn 0;\n }\n", "prefixes": [ "dpdk-dev", "2/2" ] }{ "id": 1393, "url": "