From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=JVzGeE0+9h5PBZCRnkJdYcr22lC7Ot3JOV2SuqiKcgc=; b=WHbJUIcnUkttDlbOv4tt92hq5KvXstB17jXOFbZlGGi4BCXaSgBQL8OWFPJ58gytXL ZAOyh30gGS/z/lzNzgT1ggfNyLyWrAFJF3lk87ohR6nRgAyqnU4E9m3WGSNh2lNjMO93 4/ZErYjj7P2tY1B6FhFiBT73g0/A3Mgh86+kHt1W0kR84ohWcoFK5GlyXzA/4dR9JZl0 RSOS7kcnHXTp7a2aJiaHWt4Ow0BoRf75u4Dy1QEPUOj5FIdSU44QoKCFBxHZ4kpTWxvH vzhF+MbNhzthegp90+2SxOpM77ntjyN/P5ffANlpKWy7XV222xvcsHHxJNrCrhikfD7v Hxfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=JVzGeE0+9h5PBZCRnkJdYcr22lC7Ot3JOV2SuqiKcgc=; b=fJxGvNwGSYCmE1TXrD50xPsxtf9xTX4Ieo/Gh+vOnEqkzetmLDF9tYMAzxwsl00Fnk HX1K8dbDTIxZ5tjqBxQ3DP3LND/fGrlyN5x/CNvdoloLPrVc7LffeYZRzsjH8I5w4wox Lo/WuFtK1Q3jsLY9VCMuCERRmeFI30Ud5VX/CNdGaRP95WY44pbKu0ukTSoYCWcNkfuj bMAVImc/6C5dR4BAfEEyIcGVV6HbqTzUDmu5O2oHPJLLI2XisXgh4Vskz/wljRIZ7TBZ Zo+RqQSQYg3FF9jOGcTZvVJkLMqHUBhzrfOj2aouZ04XulrjKDrKHB93zswenlshtNrt 1ysw== X-Gm-Message-State: AOPr4FXB3oeoOBQ6CT3m4PEDdgMAm8EkcEn8GFEhjgXAKYeTBFFOkKkARMXda892rwevbA== X-Received: by 10.112.198.105 with SMTP id jb9mr3934435lbc.74.1463980253973; Sun, 22 May 2016 22:10:53 -0700 (PDT) Received: from [10.0.2.212] ([80.82.22.190]) by smtp.googlemail.com with ESMTPSA id q137sm5572694lfq.24.2016.05.22.22.10.52 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 May 2016 22:10:53 -0700 (PDT) To: Remy Horton , dev@dpdk.org References: <1462963714-21022-1-git-send-email-zr@semihalf.com> <573ECA07.1060303@intel.com> Cc: zyta.szpak@semihalf.com From: Zyta Szpak Message-ID: <574290E6.9010002@semihalf.com> Date: Mon, 23 May 2016 07:11:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <573ECA07.1060303@intel.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: Mon, 23 May 2016 05:10:54 -0000 Hi, sorry on my late reply I was on sick leave. Sure I can do that. This fix was the fastest possible without interfering with DPDK API. I will add 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 > 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