eth: implement DeviceCapabilities.max_burst_size

this is a hint that /could/ boost TCP performance.
tcp-recv-fnmut
Astro 3 years ago
parent 074438c3c7
commit 484e385160
  1. 1
      libboard_zynq/src/eth/mod.rs
  2. 4
      libboard_zynq/src/eth/rx.rs
  3. 4
      libboard_zynq/src/eth/tx.rs

@ -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…
Cancel
Save