From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: [PATCH] net/thunderx: manage PCI device mapping for SQS VFs Date: Thu, 1 Jun 2017 18:35:30 +0530 Message-ID: <20170601130530.11443-1-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: ferruh.yigit@intel.com, Jerin Jacob , Angela Czubak To: dev@dpdk.org Return-path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0079.outbound.protection.outlook.com [104.47.37.79]) by dpdk.org (Postfix) with ESMTP id 1FF437CB8 for ; Thu, 1 Jun 2017 15:05:58 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since the commit e84ad157b7bc ("pci: unmap resources if probe fails"), EAL unmaps the PCI device if ethdev probe returns positive or negative value. nicvf thunderx PMD needs special treatment for Secondary queue set(SQS) PCIe VF devices, where, it expects to not unmap or free the memory without registering the ethdev subsystem. To keep the same behavior, moved the PCI map function inside the driver without using the EAL services. Signed-off-by: Jerin Jacob Signed-off-by: Angela Czubak --- drivers/net/thunderx/nicvf_ethdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 796701b0f..6ec2f9266 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -2025,6 +2025,13 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) } pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + + ret = rte_pci_map_device(pci_dev); + if (ret) { + PMD_INIT_LOG(ERR, "Failed to map pci device"); + goto fail; + } + rte_eth_copy_pci_info(eth_dev, pci_dev); nic->device_id = pci_dev->id.device_id; @@ -2171,7 +2178,7 @@ static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev) static struct rte_pci_driver rte_nicvf_pmd = { .id_table = pci_id_nicvf_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .drv_flags = RTE_PCI_DRV_INTR_LSC, .probe = nicvf_eth_pci_probe, .remove = nicvf_eth_pci_remove, }; -- 2.13.0