From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D1C96A00C5; Fri, 29 May 2020 22:56:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22A881DA35; Fri, 29 May 2020 22:56:15 +0200 (CEST) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by dpdk.org (Postfix) with ESMTP id 1F3ED1DA30 for ; Fri, 29 May 2020 22:56:13 +0200 (CEST) Received: by mail-ot1-f53.google.com with SMTP id u23so2995263otq.10 for ; Fri, 29 May 2020 13:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=radio-canada-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CiAGKIc1gy7KET6NugOj0JaV032w/oJQhIin35lHOMo=; b=EK2sKiTMG6/gKxvn5T3y8BplFAOInaPJXPTpPGje6nDPL+xHhx+UoD1oKL9iw6WcfC JrVmezEsw98ADZwiAvKbiqaWS/YgRqWdIszDskPWCa9fM4gKrLwLbbAH33vEoCLB8AS3 Byo0aaUQ7Au+mNM/w8ekq1D68I3m+wYPG1q2t5yx55gIQ3ubXyV2MBC/0g6e0bnmR+bt 36i+McGDxCsvb9Jrr+cS1nVPvyuyVNO6aLIRRtRi69/4N2zP9+jO0Uz6r1lcbzvwkr4b L7ys1rzIWZfoxV/nKQH4ctUkIrcN54Kr13aEc7Q8k/r8DFLiQnxT8VKLIWG8vL0QZgug LkyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CiAGKIc1gy7KET6NugOj0JaV032w/oJQhIin35lHOMo=; b=HE0qWh0/k7mgPUVpELRn0S8LQzew36IxtHeX1lV9r74PnNCuzeRasbPkgCJrebClBk M9MDGv7BLVw0We5tuuMWSf/LS6N9zFqd+vGay+3jZL5LIMVjJ+Ng/lZlmzzj/tttViFq 5jXciinZUkZ7hIg5vT+o4e5tAop7fBCBBfJZsuak/W4+Yy7Dfnd+cjjmhkEfmFDEbJjA wmGb3/sTAlETBPpXAHyeev6lirR5vgIchpFXtyy/S+8xK1SvYGoCvsvHVyxznFxwh/9I GCO/DYAV2sIPHUt3+SHJqitaCTTcdAE91ecyz60Sz8E6G4DadMF0sPjFt08mgLgNlAs3 7mIA== X-Gm-Message-State: AOAM531KYByluOWp/J1moom68w0N/jnWLlDpRem2NwahDRBjSEmbX8UL 4OpOcp4ByKdqTv7HYxz4/uDtqYrdYPg9zR2uTkI3Rg== X-Google-Smtp-Source: ABdhPJzMMEYhfeARpFxN0p7w4ZgkzvWYVH1Zg5N2FBpfxK0fHj2aW2a1x7MUo2J9anmFwoJ1Rv+GujC9uYEHRfWEIcY= X-Received: by 2002:a9d:65d7:: with SMTP id z23mr2270864oth.319.1590785771748; Fri, 29 May 2020 13:56:11 -0700 (PDT) MIME-Version: 1.0 References: <3986292.sUUuQTochr@thomas> <2766519.SlWGiteSXv@thomas> In-Reply-To: From: PATRICK KEROULAS Date: Fri, 29 May 2020 16:56:00 -0400 Message-ID: To: Slava Ovsiienko Cc: "dev@dpdk.org" , Vivien Didelot , Shahaf Shuler , Raslan Darawsheh , Matan Azrad Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, May 26, 2020 at 12:00 PM Slava Ovsiienko wrote: >> Hi, Patrick > > ConnectX HW timestamp is the captured value of internal 64-bit counter running at the frequency, > reported in the device_frequency_khz field of struct mlx5_ifc_cmd_hca_cap_bits{}. > This structure is queried in mlx5_devx_cmd_query_hca_attr() routine. > So, with known frequency it is possible to recalculate timestamp ticks to desired units. Hello Slava, Assuming that the NIC clock is already synced thanks to a PTP client, does the bit counter give an absolute time value (0 => 1 January 1970 00:00:00)? Or do I need to calculate a time duration from the process start time? I just want to validate the path from mlx5 eth dev(Rx) to eth pcap (Tx) : - query the oscillator frequency at the mlx5_eth_dev init step (mlx5_devx_cmd_query_hca_attr()) - store the freq with other hca_attr, carried by dev config which should be shared with the secondary process - in eth_pcap_tx_dumper(), retrieve the freq from the dev given by mbuf->port - convert all the incoming mbuf->timestamp using this freq whose variation should be negligible over the capture duration Last question: what is your opinion about this other method? https://github.com/linux-rdma/rdma-core/blob/7af01c79e00555207dee6132d72e7bfc1bb5485e/providers/mlx5/mlx5dv.h#L1201 Thanks a lot!