From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 34A249603 for ; Fri, 20 May 2016 10:25:46 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 20 May 2016 01:25:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,338,1459839600"; d="scan'208";a="971000126" Received: from rhorton-mobl.ger.corp.intel.com (HELO [163.33.228.55]) ([163.33.228.55]) by fmsmga001.fm.intel.com with ESMTP; 20 May 2016 01:25:45 -0700 Message-ID: <573ECA07.1060303@intel.com> Date: Fri, 20 May 2016 09:25:43 +0100 From: Remy Horton Organization: Intel Shannon Limited User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: dev@dpdk.org CC: zr@semihalf.com, zyta.szpak@semihalf.com References: <1462963714-21022-1-git-send-email-zr@semihalf.com> In-Reply-To: <1462963714-21022-1-git-send-email-zr@semihalf.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] examples/ethtool: include case for 64-bit registers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 08:25:46 -0000 Morning, On 11/05/2016 11:48, zr@semihalf.com wrote: > From: Zyta Szpak > > rte_eth_dev_get_reg_length and rte_eth_dev_get_reg callbacks > do not provide register size to the app in any way. Example assuming > they are 32-bit wide always allocates not enough memory if the > registers are 64-bit wide. It results in memory corruption. > This commit is a quick fix to make enough room for 64-bit > register values when this returned value is given to malloc. [..] This is a loose end that needs to be fixed but my feeling is that it ought to be done via querying the driver rather than overstating register bank size. My suggestion would be to add something like get_reg_wordsize to struct eth_dev_ops and then to use sizeof(uint32) as fallback for drivers that don't implement the callback. Regards, ..Rémy