From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zyta Szpak Subject: Re: [PATCH] examples/ethtool: include case for 64-bit registers Date: Mon, 23 May 2016 07:11:02 +0200 Message-ID: <574290E6.9010002@semihalf.com> References: <1462963714-21022-1-git-send-email-zr@semihalf.com> <573ECA07.1060303@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Cc: zyta.szpak@semihalf.com To: Remy Horton , dev@dpdk.org Return-path: Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by dpdk.org (Postfix) with ESMTP id 655DE5AA5 for ; Mon, 23 May 2016 07:10:54 +0200 (CEST) Received: by mail-lb0-f172.google.com with SMTP id h1so51635286lbj.3 for ; Sun, 22 May 2016 22:10:54 -0700 (PDT) In-Reply-To: <573ECA07.1060303@intel.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" Hi, sorry on my late reply I was on sick leave. Sure I can do that. This fix=20 was the fastest possible without interfering with DPDK API. I will add=20 the callback then. Regards, Zyta Szpak On 20.05.2016 10:25, Remy Horton wrote: > 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)=20 > as fallback for drivers that don't implement the callback. > > Regards, > > ..R=E9my