From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avGOe-00050J-O0 for qemu-devel@nongnu.org; Tue, 26 Apr 2016 23:44:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avGOZ-0002QY-Ls for qemu-devel@nongnu.org; Tue, 26 Apr 2016 23:44:16 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avGOZ-0002QQ-Dj for qemu-devel@nongnu.org; Tue, 26 Apr 2016 23:44:11 -0400 Received: by mail-lf0-x22c.google.com with SMTP id c126so41525446lfb.2 for ; Tue, 26 Apr 2016 20:44:11 -0700 (PDT) Date: Wed, 27 Apr 2016 06:44:03 +0300 From: Max Filippov Message-ID: <20160427034403.GA19255@octofox.metropolis> References: <1461722868-11624-1-git-send-email-zhoujie2011@cn.fujitsu.com> <1461727665.1966.10.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461727665.1966.10.camel@localhost> Subject: Re: [Qemu-devel] [PATCH v2] hw/net/opencores_eth: Allocating Large sized arrays to heap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Wei, Jiangang" Cc: "Zhou, Jie" , "qemu-devel@nongnu.org" Hi Wei, On Wed, Apr 27, 2016 at 03:27:47AM +0000, Wei, Jiangang wrote: > On Wed, 2016-04-27 at 10:07 +0800, Zhou Jie wrote: > > static void open_eth_start_xmit(OpenEthState *s, desc *tx) > > { > > - uint8_t buf[65536]; > > + uint8_t *buf = NULL; > > + uint8_t buffer[0x600]; > Hi, > > I'm curious about 0x600. > How do you determine this size? > IMO, Max's suggestion looks more reasonable. > (1536 bytes, maximal frame length when HUGEN bit is not set in MODER) This is the same value. Opencores 10/100 ethernet spec uses both decimal and hexadecimal notation. -- Thanks. -- Max