pub struct TcpZeroCopySend { /* private fields */ }Expand description
TCP zero-copy send combining scatter-gather with TCP segmentation.
Collects data into a scatter-gather list and segments it into TCP MSS-sized chunks for transmission, avoiding intermediate copies where possible.
Implementations§
Source§impl TcpZeroCopySend
impl TcpZeroCopySend
Sourcepub fn new(socket_id: usize, remote: SocketAddr) -> Self
pub fn new(socket_id: usize, remote: SocketAddr) -> Self
Create a new TCP zero-copy send operation.
Sourcepub fn add_buffer(&mut self, phys_addr: u64, length: usize)
pub fn add_buffer(&mut self, phys_addr: u64, length: usize)
Add data from a kernel buffer (physical address)
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 a user buffer (translates virtual to physical)
Sourcepub fn execute(&self) -> Result<usize, KernelError>
pub fn execute(&self) -> Result<usize, KernelError>
Execute the zero-copy TCP send.
Assembles the scatter-gather data and sends it through the TCP stack, which handles segmentation into MSS-sized chunks, sequence numbers, and retransmission.
Sourcepub fn total_length(&self) -> usize
pub fn total_length(&self) -> usize
Get total data size queued for sending
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Get the number of scatter-gather segments