forked from M-Labs/zynq-rs
eth: implement DeviceCapabilities.max_burst_size
this is a hint that /could/ boost TCP performance.
This commit is contained in:
parent
074438c3c7
commit
484e385160
|
@ -370,6 +370,7 @@ impl<'r, 'a> smoltcp::phy::Device<'a> for &mut Eth<'r, rx::DescList, tx::DescLis
|
|||
|
||||
let mut caps = DeviceCapabilities::default();
|
||||
caps.max_transmission_unit = MTU;
|
||||
caps.max_burst_size = Some(self.rx.len().min(self.tx.len()));
|
||||
caps.checksum = checksum_caps;
|
||||
|
||||
caps
|
||||
|
|
|
@ -93,6 +93,10 @@ impl DescList {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.list.len().min(self.buffers.len())
|
||||
}
|
||||
|
||||
pub fn list_addr(&self) -> u32 {
|
||||
&self.list[0] as *const _ as u32
|
||||
}
|
||||
|
|
|
@ -85,6 +85,10 @@ impl DescList {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.list.len().min(self.buffers.len())
|
||||
}
|
||||
|
||||
pub fn list_addr(&self) -> u32 {
|
||||
&self.list[0] as *const _ as u32
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue