From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by dpdk.org (Postfix) with ESMTP id B9D942BAD for ; Tue, 28 Jun 2016 18:05:20 +0200 (CEST) Received: by mail-lf0-f43.google.com with SMTP id l188so14756018lfe.2 for ; Tue, 28 Jun 2016 09:05:20 -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=AGLB9zNR8xqc2s0D1Mn7Z5Y1rcP50w/pokAuZgIRoQo=; b=WEh99FstrKL3YX6r7G7qqiC7fiBkHHkfbstIt/qPCkTQwS8+W6i6a3zsaxAjsVw7IY cfXKowvQvqcXvbR6Ro9wfJDms08pEhhCTEfKGgb8+GIrwNCTFhRJxwzV/l9gI0D5Rpzr 9QVDdZQEiQbtKEGseDtFsc+PmQh4vYANW+bZI/3FbZM5abQGjO+47afhKahLtEIvKX3L 6uwBb8pMkF9ms7RszTKs6sOsfTRvI5mAn8YOtYev4uiVE34g2SkRWNDTz+Ett4nPTnYB 7702+rcsk0YBPYWT/TR6W37pNCKH6eb70XMQEavRL9RySQz04OpkdTzYmvXyy7F3BVNR 8PGA== 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=AGLB9zNR8xqc2s0D1Mn7Z5Y1rcP50w/pokAuZgIRoQo=; b=JJpXYGO6dNku50MMrGkn/8I/6X6z/CACd46yww6T7iwSZt5z+Ovma0FEzBUoegnPXC 7XjHt+c4W9bCey0cu/8Xm4F2RXtB88/0pWaZVyrZZOjYuOZDxtp5jcylS6swOFqNM+xr 3byOHQMZSxo3HGP6BFXAT86M41RFkX/fBAqR1rDYuWMH6iUDpjfQAOzEAxRQZn9adCkH MCl9i8uXVUXhpbHOoqiD1+j+99zdBUqee/OxMeNjv7fA+Hm0AyAu+ejhQj+GR03b9yBp v3mIY+wdXsWXwR1LYTJxkttWJ1qKYNoAMBBB2MIrmnvEC3RAhb/eaZqF6h9DznxNt8SC 3xHA== X-Gm-Message-State: ALyK8tJabyHWXfJCHeTVUE6ezxsAx/f2EbKcoTQaKGyy6cBmDMhvLispidrOK8i9RvAQeA== X-Received: by 10.25.207.209 with SMTP id f200mr1516911lfg.195.1467129920391; Tue, 28 Jun 2016 09:05:20 -0700 (PDT) Received: from [10.0.2.212] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.googlemail.com with ESMTPSA id u19sm4060730lja.12.2016.06.28.09.05.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2016 09:05:19 -0700 (PDT) To: Remy Horton , thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, helin.zhang@intel.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com References: <1466688410-13826-1-git-send-email-zr@semihalf.com> Cc: dev@dpdk.org From: Zyta Szpak Message-ID: <5772A03E.70802@semihalf.com> Date: Tue, 28 Jun 2016 18:05:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/2] ethdev: remove get_reg_length callback 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: Tue, 28 Jun 2016 16:05:21 -0000 OK On 27.06.2016 12:46, Remy Horton wrote: > Morning, > > > On 23/06/2016 14:26, zr@semihalf.com wrote: >> From: Zyta Szpak >> >> Version 4 of fixing the assumption of that device registers >> are always 32 bits long. rte_eth_dev_get_reg_length and >> rte_eth_dev_get_reg_info callbacks did not provide register size >> to the app in any way. It is needed to allocate proper number >> of bytes before retrieving registers content with >> rte_eth_dev_get_reg. This commit remove rte_eth_dev_get_reg_length >> callback and adds width parameter to reg_info struct which makes >> it possible to call rte_eth_dev_get_reg_info to get attributes >> first. The drivers using this callback fill width and length >> when call to function made with data=NULL. > > I think this would read better as a commit message: > > Removes hard-coded assumption that device registers are always 32 bits > wide. The rte_eth_dev_get_reg_length and rte_eth_dev_get_reg_info > callbacks did not provide register size to the app in any way, which > is needed to allocate correct number of bytes before retrieving > registers using rte_eth_dev_get_reg. > > This commit changes rte_eth_dev_get_reg_info so that it can be used to > retrieve both the number of registers and their width, and removes the > now-redundant rte_eth_dev_get_reg_length. > > >> -/** >> - * Retrieve device registers and register attributes >> + * Retrieve device registers and register attributes (nb of regs and >> reg size) >> * >> * @param port_id >> * The port identifier of the Ethernet device. > > Need detail regarding how *info->data affects function behaviour. > Something along the lines of: > > /** > * Retrieve device registers and register attributes (number of > * registers and register size) > * > * @param port_id > * The port identifier of the Ethernet device. > * @param info > * Pointer to rte_dev_reg_info structure to fill in. If info->data is > * NULL the function fills in the width and length fields. If non-NULL > * the registers are put into the buffer pointed at by the data field. > > Program code itself looks good to me. > > ..Remy