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 0C65445A84; Tue, 1 Oct 2024 23:56:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C2B0340268; Tue, 1 Oct 2024 23:56:43 +0200 (CEST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 0FC9F40267 for ; Tue, 1 Oct 2024 23:56:42 +0200 (CEST) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2e09f67bc39so4959401a91.1 for ; Tue, 01 Oct 2024 14:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727819801; x=1728424601; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GwWZGnJdJrb+JA+ruUOiikOOdNSZNFVrXw2kNn5P+0w=; b=ZYv8jChaAJpP1Ram5MvK09+WCRtG3CGQggWhiIIFLZoyetQ5CeZf270McJU271zu+0 6EdhRyIRV0UISeOYFJVQQpTSHBLZue5TXlWzioUM/gc45f9BmRUdc9yAsL58a/MuJ+YE 47O4B341kN4g3L5Tz4/C7VB0EYJXlmcTSGSxA8QbJG3OSNv1auD9C1N/GnsCHMfheWbz p6yd71MzyI7EN8Q5f7KstkTrU/otdgJJXt5yJK3LPm4jbglQywoqAnvvrF+TF0DLyI+0 b0l5IQwydWn+3vWweylq0gnskZe5/ieHdohBDKxYLj+SnjyV/4LvLh6xoNHSQIbKeXjT E7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727819801; x=1728424601; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GwWZGnJdJrb+JA+ruUOiikOOdNSZNFVrXw2kNn5P+0w=; b=m0MlZMf9ogTVYW0Dqbj+RuSPlI4M4E1cOd1SC2fUqSo06dH9VrtRqY+0VRM0FuuTIH CGR/VwTDBpGCJcDODbvIzQ2k8p4meS/NCMaBmQmT26z5rJOPrNCgjnqWBzhqvlo0k+Nz jXIJtkv2saCKlJE6zDd3/G8WdocAv4zPVIH6SP/kCtQPgZ0jCZAPQ21an4cYZG1l6Cir wP43s/lbxSxnOmz4bPbTQgqxD/wH7hh/OwhYsx0OEhH8bwh3/n+fpzwmyOa8rxBoOmFS e2YxK3bc/OYIoXQ0IPihljEmI/K5OrslOfYNc9nGPzQ5/yMEAdQC/N8bLD0CJElBB4ja PgDg== X-Gm-Message-State: AOJu0YwFdRYvLqtZovr3rtNdZAB+9MVVH3Pqc1lwVVnyDGfugJRK02N1 IhgLUTM6RrwZFCVpW81KwcPCJX9LzuPBv4PejEpbpMD/2T+7AyBqGYFk+I7kE3MZlwtfDMpI1Cm MEgpdF6zLQbjZ5Rn/hMOV+xz2s0E= X-Google-Smtp-Source: AGHT+IEmwZ+I/oe196K/+XkuLhghytBbshV64w41VXr6dtORaB32DlAVZjeqDFe+6iRgyAO8mp0m6P+USC1nC5Q3XB8= X-Received: by 2002:a17:90b:1084:b0:2d3:ccaa:453 with SMTP id 98e67ed59e1d1-2e1849e8681mr1344459a91.35.1727819801094; Tue, 01 Oct 2024 14:56:41 -0700 (PDT) MIME-Version: 1.0 References: <20240921140022.107239-1-iboukris@gmail.com> <20241001002527.277838-1-iboukris@gmail.com> <20241001002527.277838-3-iboukris@gmail.com> <20241001081939.7cf14c2d@hermes.local> In-Reply-To: <20241001081939.7cf14c2d@hermes.local> From: Isaac Boukris Date: Wed, 2 Oct 2024 00:56:29 +0300 Message-ID: Subject: Re: [PATCH v3 2/2] timer/linux/x86: override TSC freq if no tsc_known_freq To: Stephen Hemminger Cc: dev@dpdk.org, bruce.richardson@intel.com, roretzla@linux.microsoft.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Oct 1, 2024 at 6:22=E2=80=AFPM Stephen Hemminger wrote: > > On Tue, 1 Oct 2024 03:22:51 +0300 > Isaac Boukris wrote: > > > diff --git a/lib/eal/windows/eal_timer.c b/lib/eal/windows/eal_timer.c > > index b070cb7751..cfd6c267ac 100644 > > --- a/lib/eal/windows/eal_timer.c > > +++ b/lib/eal/windows/eal_timer.c > > @@ -49,13 +49,16 @@ rte_delay_us_sleep(unsigned int us) > > } > > > > uint64_t > > -get_tsc_freq(void) > > +get_tsc_freq(uint64_t arch_hz) > > { > > LARGE_INTEGER t_start, t_end, elapsed_us; > > LARGE_INTEGER frequency; > > uint64_t tsc_hz; > > uint64_t end, start; > > > > + if (arch_hz) > > + return arch_hz; > > + > > QueryPerformanceFrequency(&frequency); > > > > QueryPerformanceCounter(&t_start); > > -- > > On Windows, I would not use arch_hz at all, since it is opaque how > the Windows kernel determines the frequency, and best not to get > skew. Not sure I follow, currently the patch doesn't change the behavior for Windows, and the Windows code is quite similar to the Linux one, should we always prefer the measured value in Windows? On the other hand, I think I should update the rounding commit to also change the Windows code, there is no sense in 10MHz rounding there either.