We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 31785

10.1 EDK - Why is lwip_v3_00_a socket mode so slow?


When investigating the low performance of lwIP that Xilinx ships, I found a spin loop in the Xilinx Ethernet adapter for lwip_3_00_a.

Why is there a spin loop in the code?


The function xemacif_input_thread in file $XILINX_EDK\sw\ThirdParty\sw_services\lwip_v3_00_a\src\contrib/ports\xilinx\netif\xadapter.c contains a spinloop.

This reduces the performance of lwIP in socket mode drastically, and is the reason why socket mode performance is limited to 1 Mbps.

The correct implementation should use a counting semaphore to awaken this thread only when there are packets to process.

However, the counting semaphore mechanism has not been implemented in lwip_v3_00_a since this resulted in an unstable stack. We attribute this to issues in lwIP 1.2.0's socket API. This layer has been significantly improved in lwIP 1.3.0; as a result, this spinlock is no longer necessary in lwIP 1.3.0.

The Xilinx lwIP 1.3.0 adapter will be fixed to use a counting semaphore in EDK 11.1

AR# 31785
Date 12/15/2012
Status Active
Type General Article
Page Bookmarked