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 A157641DCD for ; Mon, 6 Mar 2023 17:56:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23B5B40EDB; Mon, 6 Mar 2023 17:56:18 +0100 (CET) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id 78CEE40A8A for ; Mon, 6 Mar 2023 17:56:16 +0100 (CET) Received: by mail-pg1-f175.google.com with SMTP id q189so5947664pga.9 for ; Mon, 06 Mar 2023 08:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678121775; 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=WnFa3wIlCIHhWN6ZAmuPv5VOJ2WWDosS9mviub6uf54=; b=t3ApVjWMX8bOq5h5LfCszYEo9TdqbvbcILvOh9l3OPsoMkuyIIAMvh6l+E1r+InxZG zP8hP3BwIj7SN1zRoQTYMqkwX9VP0GKbOyKw3Ay2hsnfL23X31TVx5nw/5GdZ0TgioKl cQb5D6/WJ1j7xQZNj2QF8GAT3Dp5To6VkoJuQrSkXcQb8H+lVKUPsUiOfnwlyungluzf DZIFcAA7YdOBk8/o+c945fnV8KlRQtsxzOGY77JBK29mzrcqRi/OmDoFMixymzFvl64e rrMfl6BwYy2FavnWeGRkTbCmFOqapVbk8oaTD1PK7FHi0xouM9lrxNsW4MokPWr+amcs GyTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678121775; 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=WnFa3wIlCIHhWN6ZAmuPv5VOJ2WWDosS9mviub6uf54=; b=jHi3lKLz4JSsYE4w6yPgc17bOJ+00M1X6a4cdx9MClkH2qt789n3tZfLGJNu291z6W tal0XxM7Zrf1XZrzpnyxaKkHMBby3SaHLZrS5pmzHD1U9RjF/fW1uREglmLM4q+iqJaO IuooFu+EVHcwqOgBcUl2E3+QfXV3UeqlxGYcNKcSpmSDfeaRl28MQa7UX7kWbtK4B0y7 E9MKChKCcKUI35Trisnr8BPffmQ4aKmiR1efR45S0N9VaZ8SofobWWLnW8JW+4lW9l94 pJVeeJlsUqHZXbf8xslZgj99Egvk3zPPrjIrUDMtrZR1d9dm6zVuLH8XdxD13xA482Q5 Wkvg== X-Gm-Message-State: AO0yUKXCo///FJHPAqpeKOqm10JuodZ5S6R0mWuaykbFyMFuvsw1GXxy nDkXlgIYvLQ9bb8If3TdfJiKo5aUL83vxCoIh0Pahw== X-Google-Smtp-Source: AK7set9nxMMUz/PtWp6/Pd0HH06PnIL/oXMlHjFpQDCm02ky+yHLu3FQmcrWzbxgnzWX52awZBV8RQ== X-Received: by 2002:aa7:942a:0:b0:5e0:1073:1f25 with SMTP id y10-20020aa7942a000000b005e010731f25mr9945589pfo.7.1678121775505; Mon, 06 Mar 2023 08:56:15 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id n25-20020aa79059000000b00593e4e6516csm6534366pfo.124.2023.03.06.08.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 08:56:15 -0800 (PST) Date: Mon, 6 Mar 2023 08:56:14 -0800 From: Stephen Hemminger To: fwefew 4t4tg <7532yahoo@gmail.com> Cc: users@dpdk.org Subject: Re: Using rdtsc to timestamp RTT of packets Message-ID: <20230306085614.72951a6f@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Sun, 5 Mar 2023 20:01:15 -0500 fwefew 4t4tg <7532yahoo@gmail.com> wrote: > I think rdtsc does all this. But then I read [1]: > > - The TSC is not always invariant > - And of course context switches (if a thread is not pinned to a core) > will invalidate any time difference > - The TSC is not incremented when the processor enters a deep sleep. I > don't care about this because I'll turn off the power saving modes anyway Stack Overflow is only one step better than ChatGPT in giving partially correct answers. TSC is almost always works well on modern processors. The Linux kernel aligns all the TSC values for each core at boot up. It is invariant (derived from a single clock source) unless you have some poorly designed NUMA system. In the past, there were some CPU's that did bad things during suspend, but that is fixed in current generations. Bottom line: that advice is no longer true.