@@ -9,10 +9,9 @@ use std::sync::{Arc, Mutex};
9
9
10
10
use serde:: { Deserialize , Serialize } ;
11
11
12
- use super :: device:: { Net , RxBuffers } ;
13
- use super :: { TapError , NET_NUM_QUEUES , RX_INDEX } ;
12
+ use super :: device:: Net ;
13
+ use super :: { TapError , NET_NUM_QUEUES } ;
14
14
use crate :: devices:: virtio:: device:: DeviceState ;
15
- use crate :: devices:: virtio:: iovec:: ParsedDescriptorChain ;
16
15
use crate :: devices:: virtio:: persist:: { PersistError as VirtioStateError , VirtioDeviceState } ;
17
16
use crate :: devices:: virtio:: queue:: FIRECRACKER_MAX_QUEUE_SIZE ;
18
17
use crate :: devices:: virtio:: TYPE_NET ;
@@ -32,23 +31,6 @@ pub struct NetConfigSpaceState {
32
31
guest_mac : Option < MacAddr > ,
33
32
}
34
33
35
- /// Information about the parsed RX buffers
36
- #[ derive( Debug , Default , Clone , Serialize , Deserialize ) ]
37
- pub struct RxBufferState {
38
- // Number of iovecs we have parsed from the guest
39
- parsed_descriptor_chains_nr : u16 ,
40
- deferred_descriptor : Option < ParsedDescriptorChain > ,
41
- }
42
-
43
- impl RxBufferState {
44
- fn from_rx_buffers ( rx_buffer : & RxBuffers ) -> Self {
45
- RxBufferState {
46
- parsed_descriptor_chains_nr : rx_buffer. parsed_descriptors . len ( ) . try_into ( ) . unwrap ( ) ,
47
- deferred_descriptor : rx_buffer. deferred_descriptor . clone ( ) ,
48
- }
49
- }
50
- }
51
-
52
34
/// Information about the network device that are saved
53
35
/// at snapshot.
54
36
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -61,7 +43,6 @@ pub struct NetState {
61
43
pub mmds_ns : Option < MmdsNetworkStackState > ,
62
44
config_space : NetConfigSpaceState ,
63
45
virtio_state : VirtioDeviceState ,
64
- rx_buffers_state : RxBufferState ,
65
46
}
66
47
67
48
/// Auxiliary structure for creating a device when resuming from a snapshot.
@@ -104,7 +85,6 @@ impl Persist<'_> for Net {
104
85
guest_mac : self . guest_mac ,
105
86
} ,
106
87
virtio_state : VirtioDeviceState :: from_device ( self ) ,
107
- rx_buffers_state : RxBufferState :: from_rx_buffers ( & self . rx_buffer ) ,
108
88
}
109
89
}
110
90
@@ -157,14 +137,6 @@ impl Persist<'_> for Net {
157
137
. map_err ( NetPersistError :: TapSetOffload ) ?;
158
138
159
139
net. device_state = DeviceState :: Activated ( constructor_args. mem ) ;
160
-
161
- // Recreate `Net::rx_buffer`. We do it by re-parsing the RX queue. We're temporarily
162
- // rolling back `next_avail` in the RX queue and call `parse_rx_descriptors`.
163
- net. queues [ RX_INDEX ] . next_avail -= state. rx_buffers_state . parsed_descriptor_chains_nr ;
164
- net. parse_rx_descriptors ( ) ;
165
- net. rx_buffer
166
- . deferred_descriptor
167
- . clone_from ( & state. rx_buffers_state . deferred_descriptor ) ;
168
140
}
169
141
170
142
Ok ( net)
0 commit comments