From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auuMH-0003iK-Ei for qemu-devel@nongnu.org; Tue, 26 Apr 2016 00:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auuMG-0007ES-OK for qemu-devel@nongnu.org; Tue, 26 Apr 2016 00:12:21 -0400 MIME-Version: 1.0 In-Reply-To: <1461641713-32720-1-git-send-email-zhoujie2011@cn.fujitsu.com> References: <1461641713-32720-1-git-send-email-zhoujie2011@cn.fujitsu.com> Date: Tue, 26 Apr 2016 07:12:18 +0300 Message-ID: From: Max Filippov Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] hw/net/opencores_eth: Allocating Large sized arrays to heap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhou Jie Cc: qemu-devel , QEMU Trivial Hi Zhou, On Tue, Apr 26, 2016 at 6:35 AM, Zhou Jie wrote: > open_eth_start_xmit has a huge stack usage of 65536 bytes approx. > Moving large arrays to heap to reduce stack usage. It's an exception, not the rule when full 65536 byte long buffer might be needed. Can we do a little better change and not allocate and free this buffer every time unconditionally, but instead make buf smaller (1536 bytes, maximal frame length when HUGEN bit is not set in MODER) and only do allocation when that's not enough? -- Thanks. -- Max