From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 4BA553F9 for ; Wed, 8 Jun 2016 10:53:22 +0200 (CEST) Received: by mail-wm0-f41.google.com with SMTP id v199so53274317wmv.0 for ; Wed, 08 Jun 2016 01:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=BUJW85ZXTd6CGhm6xQcKkzcFe79Pt6PmOQt5UZnhpaA=; b=frC+fjbdVc5x0wXFCwnWJQMZZGygSOPkQSCZCb0RrAc+pvGAWKKVvhbNYwSBTGH9Jq p/+1k59VQItsOUy94nODMI18TYkYDERfVkBksSKC7247g48CQDunWAyoUWa0EccyTqFf jl78TJ8q4O0ckxdeplLzLi6/M3TjrDPxNbdlnpxaJYMwPLKB7eOf5Jdu5cLLjjUAOHg4 lYWJ/jHo4k3+pmhXR8ahV0Ix6//vKgDjNN2OBUaJT0smMs7K+bFadDuVkIMdXamELByJ xjQ4OpIGoaF/ASa48c76DQIemxjd0m0Uul9JdyQZFCHoOkaPyY62pCOP4+F4niPShLuB 4OmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=BUJW85ZXTd6CGhm6xQcKkzcFe79Pt6PmOQt5UZnhpaA=; b=S6ioWP1eHn8Mz6w9kZ3COM28lNxT4gr6j/vDGucAWLn+XIY+kJ9HedtzwGZN0RxFke twHW+kkXADJRgwot+zOKRsr/84cPM35IxYn0sovz/Zn+vuwz59PXS49PL0dOVOW6rkku pDLj5JYRDdxhmpegYJVK/KMGDHlOYA+T5A1W9mU7HkYbdx2OSFIP5vZwlMYSOS4mRVez bPyvrKDguoIn+ivVKV/HNsRmlI/iIT4uV2VXnvZ8OhqQA0tR4jCp+25xmjZD1T+aIug2 RwZ0mtk9wHI+mMulMp6j2Jnvbc4EgMlmHuX5U60zvdVhZ6Sq9CQYuQnGsFiPsEFUUC81 blLA== X-Gm-Message-State: ALyK8tIIN9cCqqqLo9XEtZW8Mw5E5d5nXEIVllfRajInJtyPyyUEHcF8MYmq/k1DGUCXKim+ X-Received: by 10.194.122.103 with SMTP id lr7mr3335960wjb.6.1465376002005; Wed, 08 Jun 2016 01:53:22 -0700 (PDT) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id q189sm849956wmd.19.2016.06.08.01.53.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Jun 2016 01:53:21 -0700 (PDT) From: Thomas Monjalon To: zr@semihalf.com Cc: remy.horton@intel.com, dev@dpdk.org Date: Wed, 08 Jun 2016 10:53:20 +0200 Message-ID: <12994980.C5dFrG15Qg@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1464767771-19159-1-git-send-email-zr@semihalf.com> References: <1464767771-19159-1-git-send-email-zr@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 1/2] ethdev: add callback to get register size in bytes 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: Wed, 08 Jun 2016 08:53:22 -0000 Hi Zyta, 2016-06-01 09:56, zr@semihalf.com: > rte_eth_dev_get_reg_length and rte_eth_dev_get_reg callbacks > do 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. Yes, register size is needed. And I think it makes sense to register it in the struct rte_dev_reg_info. We already have a length field, so we could just add a width field. > @@ -1455,6 +1458,8 @@ struct eth_dev_ops { > > eth_get_reg_length_t get_reg_length; > /**< Get # of registers */ > + eth_get_reg_width_t get_reg_width; > + /**< Get # of bytes in register */ > eth_get_reg_t get_reg; > /**< Get registers */ I am not sure it is a good practice to add a new function for each parameter of a request. I would prefer having only one function rte_eth_dev_get_regs() which returns length and width if data is NULL. The first call is a parameter request before buffer allocation, and the second call fills the buffer. We can deprecate the old API and introduce this new one. Opinions?