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 DA30D45A7B; Tue, 1 Oct 2024 17:22:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1AF3402CD; Tue, 1 Oct 2024 17:22:22 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 94B0E402E9 for ; Tue, 1 Oct 2024 17:22:20 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20b7463dd89so29687105ad.2 for ; Tue, 01 Oct 2024 08:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727796140; x=1728400940; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=d7u806xQgW7lJ6CYIOakXmqYTLxE8R8ZvKnb/x74FHI=; b=MMgIihQwReJJ5Gr8Y2WvRAQk/2R1pYK1ahVL6FxARAStdrSTnLw/C7g73M1ZMXd90g WBtt6C/OwWYGivDs5WxqtYAjMUT7NDwz4eY1KDlFGsF7Y9Ng7Fk+IwW4K7sSPvKSCItt DaQa2B1vMPqN1bozzNX02dP/fp1JfGkgu+/ISVwxV7iKde2FBuk72vc7okMm/rDCqDsQ 4+MFhqKb/2309510mtZcL9wtkxKyOJACLZ14Z6xDVSbQvJGa019tqzy4FtFkQoEGL79G z+J3SxhBJU+rverv4mAQZRz+8up1+Pd1wcTrPVcJHjprCa7wqUg4VCPqfd4yWB55eoFh zrfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727796140; x=1728400940; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d7u806xQgW7lJ6CYIOakXmqYTLxE8R8ZvKnb/x74FHI=; b=ZNSWi+7Lp9yTtT8kliZAdxa4xsvq4ZhZyV5/3b8241/Vl4OwI0i9PNHMdnokSK/XlA 9IGbiCczl4+ZJRcgjRYaN90no/JkpgeLIG5lDeuzpo6CnIBjChJX4Jntvo0OXAylqBQJ xrRIFWaWQzdlF/ZI5qTDa2GXT24+pJvoFHIONF3AmLMpElwPEgEi+M3ShxMXx67TRHjv lIvdM98u0ZksZNeZ1qLID4Da24dR9pULKkzHVJqhvBW5qBEV3oXpolnqZdc7hkpiE5iE PbzgpMjCwmHxZrrEyQfrP0sGaC2ZRGAL7oFc7TEY3jATvtlRNE0PD/UaxI3J8t+bFU6z 6TiQ== X-Gm-Message-State: AOJu0YxUTG7fzCYfRhyHrQ8ilky+iy11ts8zVgXY8qAGf2Bou6Teub6A C84HVSA2dEJuBEE9RZpQY7vQerzbT5kNl1inK60ynvGpW3mOZ4a9tju3ncueIJs= X-Google-Smtp-Source: AGHT+IGEGBEtggq8Bvsg8DmWD/xX9O+3ApYgcf/x0AiffZtJ2lxEaXHVcngcAndIO2gWjNRS4hoayw== X-Received: by 2002:a17:903:230a:b0:20b:5fa6:1fb3 with SMTP id d9443c01a7336-20bc59c3ffdmr402105ad.5.1727796139650; Tue, 01 Oct 2024 08:22:19 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b54c6d95fsm55944535ad.222.2024.10.01.08.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Oct 2024 08:22:19 -0700 (PDT) Date: Tue, 1 Oct 2024 08:19:39 -0700 From: Stephen Hemminger To: Isaac Boukris Cc: dev@dpdk.org, bruce.richardson@intel.com, roretzla@linux.microsoft.com, dmitry.kozliuk@gmail.com, david.marchand@redhat.com Subject: Re: [PATCH v3 2/2] timer/linux/x86: override TSC freq if no tsc_known_freq Message-ID: <20241001081939.7cf14c2d@hermes.local> In-Reply-To: <20241001002527.277838-3-iboukris@gmail.com> References: <20240921140022.107239-1-iboukris@gmail.com> <20241001002527.277838-1-iboukris@gmail.com> <20241001002527.277838-3-iboukris@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 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.