Skip to content

Commit 4cbc184

Browse files
netvsp, mana_driver: add instrumentation around parts of mana servicing (#1584) (#1674)
Currently, it's difficult to ascertain where time is spent on mana during servicing as we don't have instrumentation around some vital parts of servicing. This PR adds some instrumentation to inform us where time is being spent so that we can prioritize keepalive in the right places. Cherry-pick of #1584 Co-authored-by: justus-camp-microsoft <campjustus@microsoft.com>
1 parent f32b124 commit 4cbc184

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

vm/devices/net/mana_driver/src/mana.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use pal_async::driver::SpawnDriver;
3030
use pal_async::task::Spawn;
3131
use pal_async::task::Task;
3232
use std::sync::Arc;
33+
use tracing::Instrument;
3334
use user_driver::DeviceBacking;
3435
use user_driver::DmaClient;
3536
use user_driver::interrupt::DeviceInterrupt;
@@ -77,7 +78,9 @@ impl<T: DeviceBacking> ManaDevice<T> {
7778
num_vps: u32,
7879
max_queues_per_vport: u16,
7980
) -> anyhow::Result<Self> {
80-
let mut gdma = GdmaDriver::new(driver, device, num_vps).await?;
81+
let mut gdma = GdmaDriver::new(driver, device, num_vps)
82+
.instrument(tracing::info_span!("new_gdma_driver"))
83+
.await?;
8184
gdma.test_eq().await?;
8285

8386
gdma.verify_vf_driver_version().await?;

vm/devices/net/netvsp/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ use task_control::InspectTaskMut;
7777
use task_control::StopTask;
7878
use task_control::TaskControl;
7979
use thiserror::Error;
80+
use tracing::Instrument;
8081
use vmbus_async::queue;
8182
use vmbus_async::queue::ExternalDataError;
8283
use vmbus_async::queue::IncomingPacket;
@@ -3708,7 +3709,11 @@ impl Coordinator {
37083709
stop.until_stopped(self.stop_workers()).await?;
37093710
// The queue restart operation is not restartable, so do not
37103711
// poll on `stop` here.
3711-
if let Err(err) = self.restart_queues(state).await {
3712+
if let Err(err) = self
3713+
.restart_queues(state)
3714+
.instrument(tracing::info_span!("netvsp_restart_queues"))
3715+
.await
3716+
{
37123717
tracing::error!(
37133718
error = &err as &dyn std::error::Error,
37143719
"failed to restart queues"
@@ -4270,6 +4275,7 @@ impl Coordinator {
42704275
c_state
42714276
.endpoint
42724277
.get_queues(queue_config, rss.as_ref(), &mut queues)
4278+
.instrument(tracing::info_span!("netvsp_get_queues"))
42734279
.await
42744280
.map_err(WorkerError::Endpoint)?;
42754281

0 commit comments

Comments
 (0)