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 9E2CAA0093; Tue, 19 May 2020 20:20:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA7F51D17E; Tue, 19 May 2020 20:20:27 +0200 (CEST) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by dpdk.org (Postfix) with ESMTP id 9E9581C0D4 for ; Tue, 19 May 2020 20:20:26 +0200 (CEST) Received: by mail-oi1-f182.google.com with SMTP id 19so578084oiy.8 for ; Tue, 19 May 2020 11:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=radio-canada-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=9B0n6dh6ZJn7svX/bzT7RALs5C4lGpGzG+Xi6YUlhHk=; b=wydztfLiDkpQfqESM9qXjGPqKEAslvkOfNDn9gZdlX7wEUMLjgySG1UaKRydxGOt8Q wlKkLaYmiXFewdnI8kEzRNrGAM+F112xca8NyMwm0GAXqBoDDEIRyqXPT6NLCYvGkEF2 YLbHwqPbUmRJxbP6usMURzumk3aaU+ld991ndbDa6HwUMXm+WftKYwLTd2TiaI6OIcmA HhF6l6T4KauXmuiLFAjAZwSZzzgLs7Uq5QanlXpkZG4yxxTzCbPJ+DoI+stKhbkaq/Uk bHd9nZZIAFp3Kawx7KWnMbLWMKTEEf8stKrMnDDVk5+akBq9ajfUSBJjx6MCnd8HLiaO Q7Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9B0n6dh6ZJn7svX/bzT7RALs5C4lGpGzG+Xi6YUlhHk=; b=B35P8NfHQxAoQLufADh8wGseEqHR18bM3wbdIc0FGdACijSQM4hbkBDpqBqFhFTowQ pO+t9Hfz9Bwzef5eNH6uR/EzsdR7fNBMu0eeaeV7WJ5V6fmWby+4RBDaJDw30e289Lvo tZwKAFkBy5brmxpfdWEqUQE72GBonno0vcys5IYe7g64sa+Xs6ZtxRJZKur/k4T7DwEl RmdlIyzX2nYU7OQ2rHoDDEfyL8LSAAxGmqtRIsXCk2f9mO/ToOr/nYlY0zBBkp+CKKuZ f81rfaeyhfUQIwn5pqgIQ0cmi+g2CzEsMo3XjDaLZbis5BGwV/Ewjix64M1dW/TPzOaT vTrw== X-Gm-Message-State: AOAM530o3cj7Zwo2R7JqJXXGsQ66xjCVKQ/zet2AIzmwQhDjxJG/dEXd GOBnujWBmGmJ+UvrK3QtIuOTRRG4FhgYmpgokgs8boQr X-Google-Smtp-Source: ABdhPJxKCqCUqqRWbZjDbqA24PIcUbqtZDgcMF4BJ2ysbky0jKSx606draiuAQauwW/8ZoCblcZyp6/dpeIuX4c2ybM= X-Received: by 2002:a54:468e:: with SMTP id k14mr550999oic.132.1589912424663; Tue, 19 May 2020 11:20:24 -0700 (PDT) MIME-Version: 1.0 From: PATRICK KEROULAS Date: Tue, 19 May 2020 14:20:13 -0400 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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" Hello, I'm trying to build an accurate capture device based on Mellanox Connect-X5 with following requirements: - capture every incoming packets with hardware timestamps - output: pcap with timestamps in nanoseconds My problem is that the packets forwarded to `dpdk-pdump` carry raw timestamps from NIC clock. mlx5 part of libibverbs includes a ts-to-ns converter which takes the instantaneous clock info. It's unused in dpdk so far. I've tested it in the device/port init routine and the result looks reliable. Since this approach looks very simple, compared to the time sync mechanism, I'm trying to integrate. The conversion should occur in the primary process (testpmd) I suppose. 1) The needed clock info derives from ethernet device. Is it possible to access that struct from a rx callback? 2) how to attach the nanosecond to mbuf so that `pdump` catches it? (workaround: copy `mbuf->udata64` in forwarded packets.) 3) any other idea? Regards, Patrick