diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-22 15:08:39 -0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-06-22 15:08:39 -0300 |
commit | 2833c977c3049f521784e8954d4c90e4941187db (patch) | |
tree | 3525a0d9c208577b852a460052290c3afa3406ef /drivers/infiniband/hw/mlx5/mlx5_ib.h | |
parent | Merge tag 'v5.13-rc7' into rdma.git for-next (diff) | |
parent | RDMA/mlx5: Support real-time timestamp directly from the device (diff) | |
download | linux-dev-2833c977c3049f521784e8954d4c90e4941187db.tar.xz linux-dev-2833c977c3049f521784e8954d4c90e4941187db.zip |
Merge branch 'mlx5_realtime_ts' into rdma.git for-next
Aharon Landau says:
====================
In case device supports only real-time timestamp, the kernel will fail to
create QP despite rdma-core requested such timestamp type.
It is because device returns free-running timestamp, and the conversion
from free-running to real-time is performed in the user space.
This series fixes it, by returning real-time timestamp.
====================
* mlx5_realtime_ts:
RDMA/mlx5: Support real-time timestamp directly from the device
RDMA/mlx5: Refactor get_ts_format functions to simplify code
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx5/mlx5_ib.h')
-rw-r--r-- | drivers/infiniband/hw/mlx5/mlx5_ib.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index 7bb35a3d8004..585fb00bdce8 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -549,6 +549,7 @@ static inline const struct mlx5_umr_wr *umr_wr(const struct ib_send_wr *wr) enum mlx5_ib_cq_pr_flags { MLX5_IB_CQ_PR_FLAGS_CQE_128_PAD = 1 << 0, + MLX5_IB_CQ_PR_FLAGS_REAL_TIME_TS = 1 << 1, }; struct mlx5_ib_cq { @@ -1611,4 +1612,10 @@ static inline bool mlx5_ib_lag_should_assign_affinity(struct mlx5_ib_dev *dev) (MLX5_CAP_GEN(dev->mdev, num_lag_ports) > 1 && MLX5_CAP_GEN(dev->mdev, lag_tx_port_affinity)); } + +static inline bool rt_supported(int ts_cap) +{ + return ts_cap == MLX5_TIMESTAMP_FORMAT_CAP_REAL_TIME || + ts_cap == MLX5_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME; +} #endif /* MLX5_IB_H */ |