Forum Discussion
Altera_Forum
Honored Contributor
13 years agoBill,
I’ve attached a code. This is basically tcpecho_raw from lwip contrib, all the tests are inside echo_accept(). I run this under FreeRTOS port by DipSwitch with lwip 1.4.0 (don’t have runable non-os project on the moment), my lwipopts.h is also attached. It looks like if the first tcp_write is NOCOPY, then lwip doesn’t use oversized pbuf and forwards all the chunks straight to the driver. I fully support Dsl hypothesis about byte enables. According to Avalon-ST spec tse_mac must ignore empty[] in the middle of packet (see Chapter 5.3, empty signal description: “If endofpacket is not asserted, this signal is not interpreted”). Also, there is an anomaly in sgdma, which potentially may affect short transfers. Here is a quotation from Nios II EDS 11.1 errata: --- Quote Start --- Unaligned Transfers of Small Payloads Fail on SG-DMA Description The Scatter Gather DMA SOPC Builder peripheral does not correctly handle unaligned transfers with small payloads. A payload length smaller than the data width causes erroneous data transfers. Workaround Avoid using DMA devices to transfer small payloads. If absolutely necessary, for a 32-bit SG-DMA, a minimum length of 4 bytes guarantees that data is transferred correctly. --- Quote End --- As for the “On-Chip FIFO Memory Core” – this core in MM->ST configuration may perform similarly to sgdma for transmitting (we use sgdma synchronously, isn’t it?), but it does not suffer from the “short writes” anomaly. That is why I thought it can be used as a workaround. Unfortunately this doesn’t help with short writes in the middle of the packet. That is why I withdraw this “proposal”. Igor