* Get device current raw clock counter * * @param dev * Pointer to Ethernet device structure. * @param[out] time * Current raw clock counter of the device. * * @return * 0 if the clock has correctly been read * The value of errno in case of error */
| 324 | * The value of errno in case of error |
| 325 | */ |
| 326 | int |
| 327 | mlx5_read_clock(struct rte_eth_dev *dev, uint64_t *clock) |
| 328 | { |
| 329 | struct mlx5_priv *priv = dev->data->dev_private; |
| 330 | struct ibv_context *ctx = priv->sh->cdev->ctx; |
| 331 | struct ibv_values_ex values; |
| 332 | int err = 0; |
| 333 | |
| 334 | values.comp_mask = IBV_VALUES_MASK_RAW_CLOCK; |
| 335 | err = mlx5_glue->query_rt_values_ex(ctx, &values); |
| 336 | if (err != 0) { |
| 337 | DRV_LOG(WARNING, "Could not query the clock !"); |
| 338 | return err; |
| 339 | } |
| 340 | *clock = values.raw_clock.tv_nsec; |
| 341 | return 0; |
| 342 | } |
| 343 | |
| 344 | /** |
| 345 | * Retrieve the master device for representor in the same switch domain. |
no outgoing calls
no test coverage detected