Skip to content

Commit

Permalink
vdpa/virtio: Print the time taken for device configuration
Browse files Browse the repository at this point in the history
Print the time taken for device configuration
  • Loading branch information
yajwu authored and kailiangz1 committed May 11, 2023
1 parent cdfb3fb commit a3238a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/vdpa/virtio/virtio_vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,8 @@ virtio_vdpa_dev_config(int vid)
struct virtio_vdpa_priv *priv =
virtio_vdpa_find_priv_resource_by_vdev(vdev);
uint16_t last_avail_idx, last_used_idx, nr_virtqs;
uint64_t t_start = rte_rdtsc_precise();
uint64_t t_end;
int ret, i;

if (priv == NULL) {
Expand Down Expand Up @@ -1132,7 +1134,9 @@ virtio_vdpa_dev_config(int vid)
DRV_LOG(INFO, "%s vid %d move to driver ok", vdev->device->name, vid);

priv->configured = 1;
DRV_LOG(INFO, "%s vid %d was configured", vdev->device->name, vid);
t_end = rte_rdtsc_precise();
DRV_LOG(INFO, "%s vid %d was configured, took %lu us.", vdev->device->name,
vid, (t_end - t_start) * 1000000 / rte_get_tsc_hz());

return 0;
}
Expand Down

0 comments on commit a3238a0

Please sign in to comment.