From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [PATCH] examples/ethtool: include case for 64-bit registers Date: Fri, 20 May 2016 09:25:43 +0100 Message-ID: <573ECA07.1060303@intel.com> References: <1462963714-21022-1-git-send-email-zr@semihalf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Cc: zr@semihalf.com, zyta.szpak@semihalf.com To: dev@dpdk.org 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) In-Reply-To: <1462963714-21022-1-git-send-email-zr@semihalf.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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=20 ought to be done via querying the driver rather than overstating=20 register bank size. My suggestion would be to add something like=20 get_reg_wordsize to struct eth_dev_ops and then to use sizeof(uint32) as=20 fallback for drivers that don't implement the callback. Regards, ..R=E9my