MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_read_clock

Function mlx5_read_clock

dpdk/drivers/net/mlx5/linux/mlx5_ethdev_os.c:326–342  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

324 * The value of errno in case of error
325 */
326int
327mlx5_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.

Callers 1

mlx5_txpp_read_clockFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected