Kintis EMAC is consuming 16 rinbuffers for input, and 8 buffers for output.
This is over-use because input packets are immediately allocated from
heap when passed to LwIP. Therefore the number can be creatly reduced.
Ethernet controller. To ensure proper operation, some methods
needed to be updated in the SMSC9220's native driver as well.
It passes all related Greentea tests, however when supervised by
the Python environment it tends to fail because of Timeout.
The current timeout is set to 1200s that seems to be a little bit short
to finish all test cases, the timeout happens towards the end of the
last test case.
Change-Id: I914608c34828b493a80e133cd132537a297bfc84
Signed-off-by: Bence Kaposzta <bence.kaposzta@arm.com>
Static Thread methods and signal methods have been deprecated. Remove
all references in the main code, and most of the tests. Some tests of
the deprecated APIs themselves remain.
Typo in the config file made the LwIP stack way too small on EFM32GG11 STK3701 target. Additionally, the EMAC thread stack was slightly too small when debug printing is on.
Currently, if all TX descriptors are in use and IP stack calls K64F/K66F
ethernet driver link out, link out drops the packet. Added 10ms delay
to link out to wait for a descriptor to become available before dropping
the packet.
Changed K64F/K66F power up to return without waiting for link up i.e. for
the ethernet cable to be connected. This is needed for non-blocking use
of driver e.g. for using the driver from event queue.
When all TX descriptors were reserved in a row so that TX buffer
reclaim interrupt did not happen during reservation sequence, after
the interrupt occurred, TX buffer reclaim did no longer free buffers.
This happened because when all descriptors were in use, last free
index pointed to consumed index.
TX pointer array was using RX ring length in its declaration.
Wasted memory if RX ring > TX ring, as is the default, but would
be broken if RX ring < TX ring.
16 RX buffers and 8 TX buffers is probably excessive. Nanostack
version of driver successfully used 4+4, and data pump should be
broadly equivalent.
This means that switching K64F devices from Nanostack to EMAC increases
base heap usage by 18K - observed in Nanostack border router builds.
Add a config option to make it possible to lower the number of buffers.
Defer consideration of lowering the default to later.
Subtract 4 from the received packet length - the buffer contains the
CRC, which we shouldn't pass up.
Ensure we allocate receive buffers of a size corresponding to the
rounded-up size we tell the hardware - the hardware was overrunning the
allocation by a couple of bytes.