common/mlx5: add timestamp format support to DevX
authorViacheslav Ovsiienko <viacheslavo@nvidia.com>
Sun, 14 Mar 2021 12:12:58 +0000 (12:12 +0000)
committerRaslan Darawsheh <rasland@nvidia.com>
Tue, 16 Mar 2021 09:05:32 +0000 (10:05 +0100)
commit569ffbc9815bce27b4dbc68f05f02714fb8e1688
tree24e8396ab452f325b03694fb1b816342e50328cb
parenta8a15654ab6b598b081b13ecbf8c7d06dd485a72
common/mlx5: add timestamp format support to DevX

This patch handles the NIC-supported timestamp formats via DevX.
Two different timestamp formats can be provided potentially.
The free-running format provides opaque values captured from
the internal clock counter fed by some independent oscillator.
The free-running frequency is not pre-defined and should be
queried from the NIC. The real-time timestamps are expressed
in nanoseconds, captured from the dedicated UTC counter, that
can be adjusted on the fly and synchronized with some external
reference clock.

Depending on the version and configuration the hardware might
support either FR (free-running) or RT (real-time) timestamps,
per queue basis.

The commit provides the querying information about the supported
timestamp formats and provides the means to configure ones
at queue creation time.

Fixes: e2b4925ef7c1 ("net/mlx5: support Direct Rules E-Switch")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
drivers/common/mlx5/mlx5_devx_cmds.c
drivers/common/mlx5/mlx5_devx_cmds.h
drivers/common/mlx5/mlx5_prm.h