[dpdk-dev] [[PATCH v3 4/4] net/pcap: support hardware Tx timestamps

2020-07-24 Thread Patrick Keroulas
the application may edit the packet headers itself afterwards). Signed-off-by: Vivien Didelot Signed-off-by: Patrick Keroulas --- doc/guides/rel_notes/release_20_08.rst | 1 + drivers/net/pcap/rte_eth_pcap.c| 32 +--- lib/librte_pdump/rte_pdump.c |

[dpdk-dev] [[PATCH v3 3/4] pdump: convert timestamp to nanoseconds on Rx path

2020-07-24 Thread Patrick Keroulas
Use start time and device frequency to translate raw Rx hardware timestamps into nanoseconds. Signed-off-by: Patrick Keroulas --- lib/librte_pdump/rte_pdump.c | 25 + 1 file changed, 25 insertions(+) diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump

[dpdk-dev] [[PATCH v3 0/4] pdump HW Rx timestamps for mlx5

2020-07-24 Thread Patrick Keroulas
integrates the nanosecond converter that derives from device frequency and start time. v2 -> v3: - replace ib_verbs nanosecond converter with more generic method based on device frequency and start time. Patrick Keroulas (3): net/mlx5: query device frequency ethdev: add API to qu

[dpdk-dev] [[PATCH v3 2/4] ethdev: add API to query device frequency

2020-07-24 Thread Patrick Keroulas
Signed-off-by: Patrick Keroulas --- 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 ++ 4 files changed, 36 insertions

[dpdk-dev] [[PATCH v3 1/4] net/mlx5: query device frequency

2020-07-24 Thread Patrick Keroulas
Get clock frequency (constant) from HCA attributes and add an accessor. Signed-off-by: Patrick Keroulas --- drivers/common/mlx5/mlx5_devx_cmds.c| 2 ++ drivers/common/mlx5/mlx5_devx_cmds.h| 1 + drivers/net/mlx5/linux/mlx5_ethdev_os.c | 22 ++ drivers/net/mlx5

Re: [dpdk-dev] [RFC PATCH 3/3] net/pcap: support hardware Tx timestamps

2020-07-10 Thread PATRICK KEROULAS
Hello Olivier and Slava, On Tue, Jul 7, 2020 at 10:47 AM Olivier Matz wrote: > For the pmd pcap part, the dynamic Tx timestamp flag that is being > introduced by Slava [1] may fit your needs: ie. when the flag is set, it > uses the provided timestamp which should be in nanosecs. > > [1] https://p

Re: [dpdk-dev] [RFC PATCH 1/3] net/mlx5: add timestamp-to-ns converter from libibverbs

2020-07-07 Thread PATRICK KEROULAS
On Fri, Jun 26, 2020 at 2:41 AM Olivier Matz wrote: > Should mlx5dv_get_clock_info() be called for each convesion? In the man > page [1], we can read this: > >If the clock_info becomes too old then time conversion will return >wrong conversion results. The user must ensure that >

Re: [dpdk-dev] [RFC PATCH 3/3] net/pcap: support hardware Tx timestamps

2020-07-06 Thread PATRICK KEROULAS
On Fri, Jun 26, 2020 at 2:48 AM Olivier Matz wrote: > I don't get why you expect that timestamp to be in nanoseconds. > The conversion is done in librte_pdump (in the previous patch), > but it won't work if the library is not used, right? > You're right Olivier. I took advantage of the definition

[dpdk-dev] [RFC][PATCH v2 0/3] pdump HW timestamps for mlx5

2020-06-11 Thread Patrick Keroulas
vey the nanoseconds to pdump, since doc says: "unit and time reference are not normalized but are always the same for a given port" Patrick Keroulas (3): net/mlx5: add counter-to-ns converter from libibverbs ethdev: add API to convert raw timestamps to nsec net/pcap: dump hardwa

[dpdk-dev] [RFC][PATCH v2 2/3] ethdev: add API to convert raw timestamps to nsec

2020-06-11 Thread Patrick Keroulas
ff-by: Patrick Keroulas --- 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

[dpdk-dev] [RFC][PATCH v2 3/3] net/pcap: dump hardware timestamps

2020-06-11 Thread Patrick Keroulas
When hardware timestamping is activated, system time should no longer be used to timestamp dumped the packets. Instead, use value held by forwarded and assume they were converted to nanoseconds. Signed-off-by: Patrick Keroulas Signed-off-by: Vivien Didelot --- drivers/net/pcap/rte_eth_pcap.c

[dpdk-dev] [RFC][PATCH v2 1/3] net/mlx5: add counter-to-ns converter from libibverbs

2020-06-11 Thread Patrick Keroulas
While some devices update their own clock info to provide current time, mlx5dv part of libibverbs already handles this and also converts any raw counter cycle to nanoseconds. Signed-off-by: Patrick Keroulas --- drivers/common/mlx5/linux/mlx5_glue.c | 16 ++ drivers/common/mlx5/linux

[dpdk-dev] [RFC] [PATCH v1 3/3] net/pcap: dump hardware timestamps

2020-06-09 Thread Patrick Keroulas
When hardware timestamping is activated, system time should no longer be used to timestamp dumped the packets. Instead, use value held by forwarded and assume they were converted to nanoseconds. Signed-off-by: Patrick Keroulas Signed-off-by: Vivien Didelot --- drivers/net/pcap/rte_eth_pcap.c

[dpdk-dev] [RFC] [PATCH v1 1/3] net/mlx5: add timestamp-to-ns converter from libibverbs

2020-06-09 Thread Patrick Keroulas
While some devices update their own clock info to provide current time, mlx5dv part of libibverbs already handles this and also converts any raw counter cycle to nanoseconds. Signed-off-by: Patrick Keroulas --- drivers/common/mlx5/mlx5_glue.c | 16 drivers/common/mlx5

[dpdk-dev] [RFC] [PATCH v1 2/3] ethdev: add API to convert raw timestamps to nsec

2020-06-09 Thread Patrick Keroulas
ff-by: Patrick Keroulas --- 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

[dpdk-dev] [RFC] [PATCH v1 0/3] pdump HW timestamps for mlx5

2020-06-09 Thread Patrick Keroulas
integrates the nanosecond converter that is already implemented by ibverbs. The conversion is performed is pdump rx callback. Patrick Keroulas (3): net/mlx5: add timestamp-to-ns converter from libibverbs ethdev: add API to convert raw timestamps to nsec net/pcap: dump hardware timestamps

Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-06-04 Thread PATRICK KEROULAS
On Wed, Jun 3, 2020 at 3:48 AM Slava Ovsiienko wrote: > > > From: PATRICK KEROULAS > > * rdma-code, libibverbs-dev: 28.0 > > * NIC Part Number: MCX516A-CDA_Ax > > * ConnectX-5 Ex EN > > * FW: 16.25.1020 > > It looks like outdated firmware, ple

Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-06-02 Thread PATRICK KEROULAS
On Tue, May 26, 2020 at 12:00 PM Slava Ovsiienko wrote: > 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_hc

Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-29 Thread PATRICK KEROULAS
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_c

Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-22 Thread PATRICK KEROULAS
> > > > 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

Re: [dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-21 Thread PATRICK KEROULAS
> > 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 > >

[dpdk-dev] mlx5 & pdump: convert HW timestamps to nanoseconds

2020-05-19 Thread PATRICK KEROULAS
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