mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-19 12:36:46 +00:00
Add tcp latency test over virtio-net
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e78303b01a
commit
090149eed7
@ -154,7 +154,7 @@ impl NetworkDevice {
|
||||
.rx_buffers
|
||||
.remove(token as usize)
|
||||
.ok_or(VirtioNetError::WrongToken)?;
|
||||
rx_buffer.set_packet_len(len as usize);
|
||||
rx_buffer.set_packet_len(len as usize - size_of::<VirtioNetHdr>());
|
||||
// FIXME: Ideally, we can reuse the returned buffer without creating new buffer.
|
||||
// But this requires locking device to be compatible with smoltcp interface.
|
||||
let rx_pool = RX_BUFFER_POOL.get().unwrap();
|
||||
@ -180,6 +180,8 @@ impl NetworkDevice {
|
||||
self.send_queue.notify();
|
||||
}
|
||||
|
||||
debug!("send packet, token = {}, len = {}", token, packet.len());
|
||||
|
||||
debug_assert!(self.tx_buffers[token as usize].is_none());
|
||||
self.tx_buffers[token as usize] = Some(tx_buffer);
|
||||
|
||||
|
Reference in New Issue
Block a user