File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
src/vmm/src/devices/virtio/net Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1035,6 +1035,7 @@ impl VirtioDevice for Net {
1035
1035
self . device_state = DeviceState :: Inactive ;
1036
1036
self . rx_frame_buf = [ 0u8 ; MAX_BUFFER_SIZE ] ;
1037
1037
self . acked_features = 0 ;
1038
+ self . metrics . device_resets . inc ( ) ;
1038
1039
Ok ( ( ) )
1039
1040
}
1040
1041
}
Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ pub struct NetDeviceMetrics {
150
150
/// Number of times when interacting with the space config of a network device failed.
151
151
pub cfg_fails : SharedIncMetric ,
152
152
/// Number of times the mac address was updated through the config space.
153
+ /// Number of device resets.
154
+ pub device_resets : SharedIncMetric ,
153
155
pub mac_address_updates : SharedIncMetric ,
154
156
/// No available buffer for the net device rx queue.
155
157
pub no_rx_avail_buffer : SharedIncMetric ,
@@ -222,6 +224,7 @@ impl NetDeviceMetrics {
222
224
pub fn aggregate ( & mut self , other : & Self ) {
223
225
self . activate_fails . add ( other. activate_fails . fetch_diff ( ) ) ;
224
226
self . cfg_fails . add ( other. cfg_fails . fetch_diff ( ) ) ;
227
+ self . device_resets . add ( other. device_resets . fetch_diff ( ) ) ;
225
228
self . mac_address_updates
226
229
. add ( other. mac_address_updates . fetch_diff ( ) ) ;
227
230
self . no_rx_avail_buffer
You can’t perform that action at this time.
0 commit comments