From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4CF5556A1 for ; Thu, 15 Sep 2016 15:03:22 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 15 Sep 2016 06:03:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,339,1470726000"; d="scan'208";a="1040364998" Received: from dhunt5-mobl.ger.corp.intel.com (HELO [10.237.220.115]) ([10.237.220.115]) by fmsmga001.fm.intel.com with ESMTP; 15 Sep 2016 06:03:20 -0700 To: Shreyansh Jain , dev@dpdk.org References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> <1473410639-10367-14-git-send-email-shreyansh.jain@nxp.com> Cc: viktorin@rehivetech.com, hemant.agrawal@nxp.com From: "Hunt, David" Message-ID: Date: Thu, 15 Sep 2016 14:03:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1473410639-10367-14-git-send-email-shreyansh.jain@nxp.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 13/15] ether: extract function eth_dev_get_driver_name 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: Thu, 15 Sep 2016 13:03:22 -0000 On 9/9/2016 9:43 AM, Shreyansh Jain wrote: > Signed-off-by: Jan Viktorin > Signed-off-by: Shreyansh Jain > Signed-off-by: Hemant Agrawal > --- > lib/librte_ether/rte_ethdev.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 104ea4a..4fa65ca 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2568,6 +2568,17 @@ rte_eth_dev_rx_intr_ctl(uint8_t port_id, int epfd, int op, void *data) > return 0; > } > > +static inline > +const char *eth_dev_get_driver_name(const struct rte_eth_dev *dev) > +{ > + if (dev->pci_dev) { > + return dev->driver->pci_drv.driver.name; > + } > + > + RTE_VERIFY(0); Same comment as last patch, maybe add an rte_panic with more descriptive error message. > + return NULL; > +} > + > const struct rte_memzone * > rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, > uint16_t queue_id, size_t size, unsigned align, > @@ -2575,9 +2586,11 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, > { > char z_name[RTE_MEMZONE_NAMESIZE]; > const struct rte_memzone *mz; > + const char *drv_name; > > + drv_name = eth_dev_get_driver_name(dev); > snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", > - dev->driver->pci_drv.driver.name, ring_name, > + drv_name, ring_name, > dev->data->port_id, queue_id); > > mz = rte_memzone_lookup(z_name);