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 4C6892B9C for ; Mon, 4 Jul 2016 12:38:44 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 04 Jul 2016 03:38:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,574,1459839600"; d="scan'208";a="1010564021" Received: from rhorton-mobl.ger.corp.intel.com (HELO [163.33.228.129]) ([163.33.228.129]) by orsmga002.jf.intel.com with ESMTP; 04 Jul 2016 03:38:40 -0700 To: Zyta Szpak , thomas.monjalon@6wind.com, wenzhuo.lu@intel.com, helin.zhang@intel.com, konstantin.ananyev@intel.com, jingjing.wu@intel.com, jerin.jacob@caviumnetworks.com, rahul.lakkireddy@chelsio.com References: <1466688410-13826-1-git-send-email-zr@semihalf.com> <1467615087-20510-1-git-send-email-zr@semihalf.com> Cc: dev@dpdk.org From: Remy Horton Organization: Intel Shannon Limited Message-ID: Date: Mon, 4 Jul 2016 11:38:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1467615087-20510-1-git-send-email-zr@semihalf.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 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: Mon, 04 Jul 2016 10:38:44 -0000 > +++ b/drivers/net/cxgbe/cxgbe_ethdev.c > @@ -934,7 +934,15 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev, > struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); > struct adapter *adapter = pi->adapter; > > - regs->length = cxgbe_get_regs_len(eth_dev); > + if (regs->data == NULL) { > + regs->length = cxgbe_get_regs_len(eth_dev); > + regs->width = sizeof(uint32_t); > + regs->version = CHELSIO_CHIP_VERSION(adapter->params.chip) | > + (CHELSIO_CHIP_RELEASE(adapter->params.chip) << 10) | > + (1 << 16); > + return 0; > + } > + > regs->version = CHELSIO_CHIP_VERSION(adapter->params.chip) | > (CHELSIO_CHIP_RELEASE(adapter->params.chip) << 10) | > (1 << 16); Code duplication.. Rest looks ok and passed a quick compile test. Might need to keep an eye out for other driver changes.