pub struct ZeroCopySend { /* private fields */ }Expand description
Zero-copy send operation using scatter-gather DMA.
Collects data segments (from user pages or kernel buffers) into a scatter-gather list and transmits them through the network device.
Implementations§
Source§impl ZeroCopySend
impl ZeroCopySend
Sourcepub fn add_kernel_buffer(&mut self, phys_addr: u64, length: usize)
pub fn add_kernel_buffer(&mut self, phys_addr: u64, length: usize)
Add data from a kernel physical address range.
Sourcepub fn add_user_buffer(
&mut self,
user_addr: u64,
length: usize,
) -> Result<(), KernelError>
pub fn add_user_buffer( &mut self, user_addr: u64, length: usize, ) -> Result<(), KernelError>
Add data from user buffer (zero-copy via page pinning).
Translates user virtual addresses to physical addresses by walking the current process’s page tables. Each page the buffer spans becomes a separate scatter-gather segment so that physically discontiguous user pages can be transmitted without copying.
Sourcepub fn on_complete(&mut self, callback: fn())
pub fn on_complete(&mut self, callback: fn())
Set completion callback
Sourcepub fn sg_list(&self) -> &ScatterGatherList
pub fn sg_list(&self) -> &ScatterGatherList
Get a reference to the scatter-gather list
Sourcepub fn execute(&self) -> Result<(), KernelError>
pub fn execute(&self) -> Result<(), KernelError>
Execute send through the network device.
Assembles the scatter-gather list into a contiguous packet and transmits it via the default network device. If no hardware scatter-gather support is available, falls back to a copy-based path.