forked from M-Labs/artiq
1
0
Fork 0

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.
This commit is contained in:
whitequark 2017-01-30 07:42:27 +00:00
parent 3a19a9fb77
commit b95db4fa4e
2 changed files with 12 additions and 4 deletions

View File

@ -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;

View File

@ -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):