Message ID | 20200625190119.265739-1-vivien.didelot@gmail.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9210A0350; Tue, 30 Jun 2020 09:32:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33F101BEB2; Tue, 30 Jun 2020 09:32:31 +0200 (CEST) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by dpdk.org (Postfix) with ESMTP id 120513B5 for <dev@dpdk.org>; Thu, 25 Jun 2020 21:01:28 +0200 (CEST) Received: by mail-qk1-f195.google.com with SMTP id c139so6428868qkg.12 for <dev@dpdk.org>; Thu, 25 Jun 2020 12:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ti1rwWwICjGj4r71ycSylD8AZFL2GylvPoieWlhZdpo=; b=sYwt7jjmuMUZvQMLDfrFqgo0et26T2BM0mze8Ry8MaW3Cl0wGZRF+4V+IouOKVaEyx Ar3M+xDVQFkrBh3AfGI4nDyc2VxvruMTjJDYNoSLigyQXfE+WKHzLWtdkDWghofx9Xpi wLYTx4UULwFy0EgYDrMk77R68D9Yg9Grj4zAMT+UOtv1qjbsdybkz2Ar5qCKSdY2GsTZ fPlfMO38FflSI7Xm9E//doycGVidNc+NW2xxPwFeq/X/fmCOyJKtJ58wzw7tDdRECcjJ yR0Te+l3M2l2p0U33XFFSb1j7Ad06l0jHbhg4d7C8Xcw2DwWllODKNtCA0umfu+5vGH+ ASnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ti1rwWwICjGj4r71ycSylD8AZFL2GylvPoieWlhZdpo=; b=imz7UhunIsM4cW7XuaaOEf7xOLAgdjLIZiDaeRRFyCzZjDkbjllWdHSJGeqsr0/bMr mNHVmNAEIk3HNlqjXFP6RvLxA+AfmsIkJBC7xYCa9ZE6uYjWhIIBMlmaxarCD7Eu35QU UBYy4CSR58Fb+2o/meU7vwPzOGW72svJ2m0iAmFB1ogaFYrParLEW1UDaYxbW6QnAb6J 9dulGlAQ85FxoSFe6WAUkYHia6b85bid1HhBaHbGP+jVVMppKjGuTHW6iizzXytlBzKL R6uZRJ49DTpvY8hhx/gSuqC401wE+QyUTENrIT/5/nCQNjaihJHLIZCIMx++BBcHAYI9 Ijxw== X-Gm-Message-State: AOAM530JALLFNLnfoUo7e6fXsXz9w9gNNidD2m+3HVJ7zYtNfTU4sYnW MNIa0gtzE14Zepl1XTeEF1WjCkjn X-Google-Smtp-Source: ABdhPJzeDHUtOkHAWf6BJBFQu1J3dagUuKR+KEP+jPzPjv3nmQhTiuckA/dVEyfP6+g5B3uoM6BQKA== X-Received: by 2002:a05:620a:a46:: with SMTP id j6mr5774908qka.30.1593111686893; Thu, 25 Jun 2020 12:01:26 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id d2sm6638419qti.62.2020.06.25.12.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 12:01:26 -0700 (PDT) From: Vivien Didelot <vivien.didelot@gmail.com> To: dev@dpdk.org Cc: Vivien Didelot <vivien.didelot@gmail.com>, Olivier Matz <olivier.matz@6wind.com>, Ferruh Yigit <ferruh.yigit@intel.com>, Patrick Keroulas <patrick.keroulas@radio-canada.ca> Date: Thu, 25 Jun 2020 15:01:16 -0400 Message-Id: <20200625190119.265739-1-vivien.didelot@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 30 Jun 2020 09:32:26 +0200 Subject: [dpdk-dev] [RFC PATCH 0/3] mlx5 to PCAP capture with hardware timestamps X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
mlx5 to PCAP capture with hardware timestamps
|
|
Message
Vivien Didelot
June 25, 2020, 7:01 p.m. UTC
This series allows to capture packets from a Mellanox ConnectX-5 interface into a PCAP file with support for hardware timestamps. Since libibverbs already provides timestamp conversion to nanoseconds for mlx5, the necessary glue is added before writing the driver's timestamps into the PCAP headers. Patrick Keroulas (2): net/mlx5: add timestamp-to-ns converter from libibverbs ethdev: add API to convert raw timestamps to nsec Vivien Didelot (1): net/pcap: support hardware Tx timestamps doc/guides/rel_notes/release_20_08.rst | 1 + drivers/common/mlx5/linux/mlx5_glue.c | 16 +++++++++++++ drivers/common/mlx5/linux/mlx5_glue.h | 4 ++++ drivers/net/mlx5/linux/mlx5_ethdev_os.c | 30 ++++++++++++++++++++++++ drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/pcap/rte_eth_pcap.c | 30 ++++++++++++++---------- lib/librte_ethdev/rte_ethdev.c | 12 ++++++++++ lib/librte_ethdev/rte_ethdev.h | 17 ++++++++++++++ lib/librte_ethdev/rte_ethdev_core.h | 5 ++++ lib/librte_ethdev/rte_ethdev_version.map | 2 ++ lib/librte_mbuf/rte_mbuf_core.h | 3 ++- lib/librte_pdump/rte_pdump.c | 14 ++++++++++- 13 files changed, 121 insertions(+), 15 deletions(-)
Comments
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Vivien Didelot > Sent: Thursday, June 25, 2020 9:01 PM > > This series allows to capture packets from a Mellanox ConnectX-5 > interface > into a PCAP file with support for hardware timestamps. Since libibverbs > already provides timestamp conversion to nanoseconds for mlx5, the > necessary > glue is added before writing the driver's timestamps into the PCAP > headers. Which clock source is the nanosecond timestamps output from this function using? CLOCK_REALTIME, the NIC clock, the CPU clock, or something else? If it is the NIC clock, I guess a simple scaling factor could be used instead, for performance reasons. The driver could expose the scaling factor (or for even better resolution: its clock frequency), e.g. through the capabilities API, so the application can cache it and convert to nanoseconds by multiplying a scaling factor and adding an offset. The application would have to handle clock drift between the NIC clock and CLOCK_REALTIME (or some other preferred reference clock source) anyway.