From patchwork Thu Nov 10 18:46:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 16999 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id B5CAFD4D4; Thu, 10 Nov 2016 19:46:25 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 1FCDCD4CE for ; Thu, 10 Nov 2016 19:46:22 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Nov 2016 10:46:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,619,1473145200"; d="scan'208"; a="1057974220" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga001.jf.intel.com with ESMTP; 10 Nov 2016 10:46:17 -0800 To: David Marchand , thomas.monjalon@6wind.com References: <1478785884-29273-1-git-send-email-david.marchand@6wind.com> <1478785884-29273-2-git-send-email-david.marchand@6wind.com> Cc: dev@dpdk.org, linville@tuxdriver.com, declan.doherty@intel.com, zlu@ezchip.com, lsun@ezchip.com, alejandro.lucero@netronome.com, mtetsuyah@gmail.com, nicolas.pernas.maradei@emutex.com, harish.patil@qlogic.com, rasesh.mody@qlogic.com, sony.chacko@qlogic.com, bruce.richardson@intel.com, huawei.xie@intel.com, yuanhan.liu@linux.intel.com, jianfeng.tan@intel.com From: Ferruh Yigit Message-ID: <9fcfff29-fc8f-b61b-dc72-0763fe559556@intel.com> Date: Thu, 10 Nov 2016 18:46:17 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478785884-29273-2-git-send-email-david.marchand@6wind.com> Subject: Re: [dpdk-dev] [PATCH 2/2] net: align ethdev and eal driver names 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 11/10/2016 1:51 PM, David Marchand wrote: > Some virtual pmds report a different name than the vdev driver name > registered in eal. > While it does not hurt, let's try to be consistent. > > Signed-off-by: David Marchand > --- Since you did all the work, instead of second patch what do you think doing something like [1] (basically adding eth_dev->rte_driver link) and when done for all vdevs, remove eth_dev->data->drv_name completely? [1] struct rte_eth_dev_sriov { diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index e4fd68f..d657133 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -553,9 +553,9 @@ eth_dev_null_create(const char *name, TAILQ_INIT(ð_dev->link_intr_cbs); eth_dev->driver = NULL; + eth_dev->rte_driver = &pmd_null_drv.driver; data->dev_flags = RTE_ETH_DEV_DETACHABLE; data->kdrv = RTE_KDRV_NONE; - data->drv_name = pmd_null_drv.driver.name; data->numa_node = numa_node; /* finally assign rx and tx ops */ diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index fde8112..0527c4a 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -259,6 +259,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, } eth_dev->pci_dev = pci_dev; eth_dev->driver = eth_drv; + eth_dev->rte_driver = pci_drv->driver.name; eth_dev->data->rx_mbuf_alloc_failed = 0; /* init user callbacks */ @@ -1557,7 +1558,7 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->pci_dev = dev->pci_dev; - dev_info->driver_name = dev->data->drv_name; + dev_info->driver_name = dev->rte_driver->name; dev_info->nb_rx_queues = dev->data->nb_rx_queues; dev_info->nb_tx_queues = dev->data->nb_tx_queues; } @@ -3214,7 +3215,6 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->device.numa_node; - eth_dev->data->drv_name = pci_dev->driver->driver.name; } int diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 9678179..63e7931 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1642,6 +1642,7 @@ struct rte_eth_dev { */ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT]; uint8_t attached; /**< Flag indicating the port is attached */ + struct rte_driver *rte_driver; } __rte_cache_aligned;