From b95db4fa4eb7f5671d367318fdc0f1b8c3022cd4 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 30 Jan 2017 07:42:27 +0000 Subject: [PATCH] Use four ethmac buffers instead of two. This should address an issue where the host sends a packet burst, the second packet in a burst gets dropped, the rest also gets dropped since smoltcp doesn't do reassembly, and the entire dance is repeated on every retransmit. --- artiq/firmware/runtime/ethmac.rs | 14 ++++++++++---- artiq/gateware/targets/kc705_dds.py | 2 ++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/artiq/firmware/runtime/ethmac.rs b/artiq/firmware/runtime/ethmac.rs index 5f232d536..b42d756fa 100644 --- a/artiq/firmware/runtime/ethmac.rs +++ b/artiq/firmware/runtime/ethmac.rs @@ -5,11 +5,17 @@ use smoltcp::phy::Device; const RX0_BASE: usize = mem::ETHMAC_BASE + 0x0000; const RX1_BASE: usize = mem::ETHMAC_BASE + 0x0800; -const TX0_BASE: usize = mem::ETHMAC_BASE + 0x1000; -const TX1_BASE: usize = mem::ETHMAC_BASE + 0x1800; +const RX2_BASE: usize = mem::ETHMAC_BASE + 0x1000; +const RX3_BASE: usize = mem::ETHMAC_BASE + 0x1800; +const TX0_BASE: usize = mem::ETHMAC_BASE + 0x2000; +const TX1_BASE: usize = mem::ETHMAC_BASE + 0x2800; +const TX2_BASE: usize = mem::ETHMAC_BASE + 0x3000; +const TX3_BASE: usize = mem::ETHMAC_BASE + 0x3800; -const RX_BUFFERS: [*mut u8; 2] = [RX0_BASE as *mut u8, RX1_BASE as *mut u8]; -const TX_BUFFERS: [*mut u8; 2] = [TX0_BASE as *mut u8, TX1_BASE as *mut u8]; +const RX_BUFFERS: [*mut u8; 4] = [RX0_BASE as *mut u8, RX1_BASE as *mut u8, + RX2_BASE as *mut u8, RX3_BASE as *mut u8]; +const TX_BUFFERS: [*mut u8; 4] = [TX0_BASE as *mut u8, TX1_BASE as *mut u8, + TX2_BASE as *mut u8, TX3_BASE as *mut u8]; pub struct EthernetDevice; diff --git a/artiq/gateware/targets/kc705_dds.py b/artiq/gateware/targets/kc705_dds.py index 73940e2fc..455ebdb8a 100755 --- a/artiq/gateware/targets/kc705_dds.py +++ b/artiq/gateware/targets/kc705_dds.py @@ -112,6 +112,8 @@ class _NIST_Ions(MiniSoC, AMPSoC): sdram_controller_type="minicon", l2_size=128*1024, ident=artiq_version, + ethmac_nrxslots=4, + ethmac_ntxslots=4, **kwargs) AMPSoC.__init__(self) if isinstance(self.platform.toolchain, XilinxVivadoToolchain):