From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CA0B5C11C for ; Wed, 8 Jun 2016 18:16:17 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 08 Jun 2016 09:16:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,439,1459839600"; d="scan'208";a="997925792" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.221.53]) ([10.237.221.53]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2016 09:16:13 -0700 To: Jerin Jacob , dev@dpdk.org References: <1464540424-12631-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465317632-11471-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465317632-11471-5-git-send-email-jerin.jacob@caviumnetworks.com> Cc: thomas.monjalon@6wind.com, bruce.richardson@intel.com, Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki From: Ferruh Yigit Message-ID: <575844CC.2090407@intel.com> Date: Wed, 8 Jun 2016 17:16:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1465317632-11471-5-git-send-email-jerin.jacob@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 04/20] thunderx/nicvf: add get_reg and get_reg_length support 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 16:16:18 -0000 On 6/7/2016 5:40 PM, Jerin Jacob wrote: > Signed-off-by: Jerin Jacob > Signed-off-by: Maciej Czekaj > Signed-off-by: Kamil Rytarowski > Signed-off-by: Zyta Szpak > Signed-off-by: Slawomir Rosek > Signed-off-by: Radoslaw Biernacki > --- > drivers/net/thunderx/nicvf_ethdev.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c > index 5d28eea..34b4735 100644 > --- a/drivers/net/thunderx/nicvf_ethdev.c > +++ b/drivers/net/thunderx/nicvf_ethdev.c > @@ -70,6 +70,9 @@ > #include "nicvf_logs.h" > > static int nicvf_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); > +static int nicvf_dev_get_reg_length(struct rte_eth_dev *dev); > +static int nicvf_dev_get_regs(struct rte_eth_dev *dev, > + struct rte_dev_reg_info *regs); Is these declarations required, function order seems correct? Since these are static functions, it is possible to remove these by re-ordering function locations. > > static inline int > nicvf_atomic_write_link_status(struct rte_eth_dev *dev, > @@ -145,9 +148,36 @@ nicvf_dev_link_update(struct rte_eth_dev *dev, > return nicvf_atomic_write_link_status(dev, &link); > } > > +static int > +nicvf_dev_get_reg_length(struct rte_eth_dev *dev __rte_unused) > +{ > + return nicvf_reg_get_count(); > +} > + > +static int > +nicvf_dev_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs) > +{ > + uint64_t *data = regs->data; > + struct nicvf *nic = nicvf_pmd_priv(dev); > + > + if (data == NULL) > + return -EINVAL; > + > + /* Support only full register dump */ > + if ((regs->length == 0) || > + (regs->length == (uint32_t)nicvf_reg_get_count())) { > + regs->version = nic->vendor_id << 16 | nic->device_id; > + nicvf_reg_dump(nic, data); > + return 0; > + } > + return -ENOTSUP; > +} > + > /* Initialize and register driver with DPDK Application */ > static const struct eth_dev_ops nicvf_eth_dev_ops = { > .link_update = nicvf_dev_link_update, > + .get_reg_length = nicvf_dev_get_reg_length, > + .get_reg = nicvf_dev_get_regs, > }; > > static int >