File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed
src/vmm/src/devices/virtio Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 799
799
"syscall" : " sigaltstack" ,
800
800
"comment" : " sigaltstack is used by Rust stdlib to remove alternative signal stack during thread teardown."
801
801
},
802
+ {
803
+ "syscall" : " fcntl"
804
+ },
805
+ {
806
+ "syscall" : " ftruncate"
807
+ },
802
808
{
803
809
"syscall" : " futex" ,
804
810
"comment" : " Used for synchronization (during thread teardown when joining multiple vcpu threads at once)" ,
890
896
}
891
897
]
892
898
},
899
+ {
900
+ "syscall" : " memfd_create"
901
+ },
902
+ {
903
+ "syscall" : " mmap" ,
904
+ "comment" : " Used to recreate TX/RX queues in VirtIO net device" ,
905
+ "args" : [
906
+ {
907
+ "index" : 3 ,
908
+ "type" : " dword" ,
909
+ "op" : " eq" ,
910
+ "val" : 34 ,
911
+ "comment" : " libc::MAP_ANONYMOUS|libc::MAP_PRIVATE"
912
+ },
913
+ {
914
+ "index" : 2 ,
915
+ "type" : " dword" ,
916
+ "op" : " eq" ,
917
+ "val" : 0 ,
918
+ "comment" : " libc::PROT_NONE"
919
+ }
920
+ ]
921
+ },
922
+ {
923
+ "syscall" : " mmap" ,
924
+ "comment" : " Used to recreate TX/RX queues in VirtIO net device" ,
925
+ "args" : [
926
+ {
927
+ "index" : 4 ,
928
+ "type" : " dword" ,
929
+ "op" : " eq" ,
930
+ "val" : 5 ,
931
+ "comment" : " file descriptor"
932
+ },
933
+ {
934
+ "index" : 3 ,
935
+ "type" : " dword" ,
936
+ "op" : " eq" ,
937
+ "val" : 17 ,
938
+ "comment" : " libc::MAP_SHARED|libc::MAP_FIXED"
939
+ },
940
+ {
941
+ "index" : 2 ,
942
+ "type" : " dword" ,
943
+ "op" : " eq" ,
944
+ "val" : 3 ,
945
+ "comment" : " libc::PROT_READ|libc::PROT_WRITE"
946
+ }
947
+ ]
948
+ },
893
949
{
894
950
"syscall" : " mmap" ,
895
951
"comment" : " Used for reading the timezone in LocalTime::now()" ,
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ pub enum ActivateError {
79
79
// Errors triggered when resetting a VirtioDevice.
80
80
#[ derive( Debug , thiserror:: Error , displaydoc:: Display ) ]
81
81
pub enum ResetError {
82
+ /// Error when creating RX buffers
83
+ RxBuffer ,
82
84
/// Reset is not implemented for the device.
83
85
NotImplemented ,
84
86
}
Original file line number Diff line number Diff line change @@ -1036,6 +1036,18 @@ impl VirtioDevice for Net {
1036
1036
self . rx_frame_buf = [ 0u8 ; MAX_BUFFER_SIZE ] ;
1037
1037
self . acked_features = 0 ;
1038
1038
self . metrics . device_resets . inc ( ) ;
1039
+ let mut queues = Vec :: new ( ) ;
1040
+ for size in NET_QUEUE_SIZES {
1041
+ queues. push ( Queue :: new ( size) ) ;
1042
+ }
1043
+ self . tx_buffer = Default :: default ( ) ;
1044
+ self . rx_buffer = match RxBuffers :: new ( ) {
1045
+ Ok ( rx_buffer) => rx_buffer,
1046
+ Err ( err) => {
1047
+ error ! ( "Failed to reset RX buffers: {:?}" , err) ;
1048
+ return Err ( ResetError :: RxBuffer ) ;
1049
+ }
1050
+ } ;
1039
1051
Ok ( ( ) )
1040
1052
}
1041
1053
}
You can’t perform that action at this time.
0 commit comments