Support calling from inside via vsock

This commit is contained in:
Anmin Liu
2024-05-06 15:00:48 +00:00
committed by Tate, Hongliang Tian
parent 48f69c25a9
commit 60dd17fdd3
24 changed files with 582 additions and 558 deletions

View File

@ -3,6 +3,8 @@
use aster_frame::mm::{DmaCoherent, DmaStream, DmaStreamSlice, HasDaddr};
use aster_network::{DmaSegment, RxBuffer, TxBuffer};
use crate::device;
/// A DMA-capable buffer.
///
/// Any type implements this trait should also implements `HasDaddr` trait,
@ -48,3 +50,15 @@ impl DmaBuf for RxBuffer {
self.buf_len()
}
}
impl DmaBuf for device::socket::buffer::TxBuffer {
fn len(&self) -> usize {
self.nbytes()
}
}
impl DmaBuf for device::socket::buffer::RxBuffer {
fn len(&self) -> usize {
self.buf_len()
}
}