hw/net/opencores_eth: Allocating Large sized arrays to heap
commitea4d824168ce2a309ccf26fa20c6e4f9e3d47c82
authorZhou Jie <zhoujie2011@cn.fujitsu.com>
Wed, 27 Apr 2016 02:07:48 +0000 (27 10:07 +0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 23 May 2016 19:10:16 +0000 (23 22:10 +0300)
treebcd9a6d20787db195db178931db7758dc9b761fa
parentaa8e0ab975e8c83c114ed8071be94dce232f75eb
hw/net/opencores_eth: Allocating Large sized arrays to heap

open_eth_start_xmit has a huge stack usage of 65536 bytes approx.
Moving large arrays to heap to reduce stack usage.

Reduce size of a buffer allocated on stack to 0x600 bytes, which is the
maximal frame length when HUGEN bit is not set in MODER, only allocate
buffer on heap when that is too small. Thus heap is not used in typical
use case.

Signed-off-by: Zhou Jie <zhoujie2011@cn.fujitsu.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
hw/net/opencores_eth.c