File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/vmm/src/devices/virtio/net Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use libc::{iovec, EAGAIN};
1414use log:: error;
1515use vmm_sys_util:: eventfd:: EventFd ;
1616
17+ use super :: NET_QUEUE_MAX_SIZE ;
1718use crate :: devices:: virtio:: device:: { DeviceState , IrqTrigger , IrqType , VirtioDevice } ;
1819use crate :: devices:: virtio:: gen:: virtio_blk:: VIRTIO_F_VERSION_1 ;
1920use crate :: devices:: virtio:: gen:: virtio_net:: {
@@ -104,7 +105,7 @@ pub struct RxBuffers {
104105 pub min_buffer_size : u32 ,
105106 // An [`IoVecBufferMut`] covering all the memory we have available for receiving network
106107 // frames.
107- pub iovec : IoVecBufferMut ,
108+ pub iovec : IoVecBufferMut < NET_QUEUE_MAX_SIZE > ,
108109 // A map of which part of the memory belongs to which `DescriptorChain` object
109110 pub parsed_descriptors : VecDeque < ParsedDescriptorChain > ,
110111 // Buffers that we have used and they are ready to be given back to the guest.
Original file line number Diff line number Diff line change 55
66use std:: io;
77
8- use crate :: devices :: virtio :: queue:: FIRECRACKER_MAX_QUEUE_SIZE ;
9-
8+ /// Maximum size of the queue for network device.
9+ pub const NET_QUEUE_MAX_SIZE : u16 = 512 ;
1010/// Maximum size of the frame buffers handled by this device.
1111pub const MAX_BUFFER_SIZE : usize = 65562 ;
1212/// The number of queues of the network device.
1313pub const NET_NUM_QUEUES : usize = 2 ;
14- pub const NET_QUEUE_SIZES : [ u16 ; NET_NUM_QUEUES ] = [ FIRECRACKER_MAX_QUEUE_SIZE ; NET_NUM_QUEUES ] ;
14+ pub const NET_QUEUE_SIZES : [ u16 ; NET_NUM_QUEUES ] = [ NET_QUEUE_MAX_SIZE ; NET_NUM_QUEUES ] ;
1515/// The index of the rx queue from Net device queues/queues_evts vector.
1616pub const RX_INDEX : usize = 0 ;
1717/// The index of the tx queue from Net device queues/queues_evts vector.
You can’t perform that action at this time.
0 commit comments