From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 02448D2D3 for ; Tue, 11 Apr 2017 17:45:30 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id u2so4137719wmu.0 for ; Tue, 11 Apr 2017 08:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wDRlrKYu7e+RfEVa5d48by7pxOrNwVY2wbsEG4d/snw=; b=vvafnJXnE9LO87wipH7XrmcKJFLv8SBIxJmB4maxglS0p3sjj938tw2cPlPCJgX7rz 4O4+jlQNTPNUJxllam5FgOQpVvXwovp3YT88+YIpeSteqSJYNtznPnKTE2zwQeCCUZwI 92cRPfqH3wUmRlTHheSiWj+fJ7lYjQm/r01SOhv8301pLNC/Dn7JQAjIaCaQYq8hXp9w rC6P0XX35bCO5nM39XeXRri1xdUR1YdlMUvy8Rw+0aWuJLYQ+ypxu3Uv620BezHRH6Hc XQoKGfr/UygzPUTiIBHba5CGmIO1jNPGCzXBn0yqG7JPnFNWt/hHgWbt6BwvlQbsjYoX Q5Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=wDRlrKYu7e+RfEVa5d48by7pxOrNwVY2wbsEG4d/snw=; b=FycN16GNraFFlIVyzWKrIcygB9le5J7o8HhYcqLjS4+SHNnb//O+Bn2U2cyjmcME42 igOJ7sje22QAzCMyjOy4d4UEz3OmfOKk1eSRRaxx83mzNWFC7kk6auEY0nJw7clq8KPn SMhZm9n6zcQ02JJC1kouMZG1ILzs8I2j2gg4/HsAYTp0JDB7we/ftK8XsSqs7GMM1nFD JhNje0/EK07BCeOu4HLcIFIY9IMQbqBaAV6cie6NnAo+gfI2goZDqOBMkp5gU3PtrXRE 7Y+GEE4cj9ROWcBfygBGysqqnTtpn90uivNItOYnKAdN1Umhuwy06gKrmvP9JvNEoCP+ DiOw== X-Gm-Message-State: AN3rC/7toBOSZWEgjtLMVAmvDwrw1ojhu4hvCDI0l9STZ6yLvmR19Uc8681RzgNtbw6XAmLW X-Received: by 10.28.198.10 with SMTP id w10mr3570304wmf.1.1491925530378; Tue, 11 Apr 2017 08:45:30 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u63sm2933738wmu.22.2017.04.11.08.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:29 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:33 +0200 Message-Id: <99222ca4deb8147a71b224fa4f638e1bef3643cd.1491924900.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 26/42] net/i40e: Don't use eth_driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 15:45:31 -0000 From: Jan Blunck Signed-off-by: Jan Blunck --- drivers/net/i40e/i40e_ethdev.c | 36 ++++++++++++++++++++++-------------- drivers/net/i40e/i40e_fdir.c | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 6927fde..ac5e181 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -642,16 +643,23 @@ static const struct rte_i40e_xstats_name_off rte_i40e_txq_prio_strings[] = { #define I40E_NB_TXQ_PRIO_XSTATS (sizeof(rte_i40e_txq_prio_strings) / \ sizeof(rte_i40e_txq_prio_strings[0])) -static struct eth_driver rte_i40e_pmd = { - .pci_drv = { - .id_table = pci_id_i40e_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = eth_i40e_dev_init, - .eth_dev_uninit = eth_i40e_dev_uninit, - .dev_private_size = sizeof(struct i40e_adapter), +static int eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_probe(pci_dev, + sizeof(struct i40e_adapter), eth_i40e_dev_init); +} + +static int eth_i40e_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_i40e_dev_uninit); +} + +static struct rte_pci_driver rte_i40e_pmd = { + .id_table = pci_id_i40e_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_i40e_pci_probe, + .remove = eth_i40e_pci_remove, }; static inline int @@ -682,7 +690,7 @@ rte_i40e_dev_atomic_write_link_status(struct rte_eth_dev *dev, return 0; } -RTE_PMD_REGISTER_PCI(net_i40e, rte_i40e_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_i40e, rte_i40e_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_i40e, pci_id_i40e_map); RTE_PMD_REGISTER_KMOD_DEP(net_i40e, "* igb_uio | uio_pci_generic | vfio"); @@ -10689,10 +10697,10 @@ i40e_filter_restore(struct i40e_pf *pf) } static bool -is_device_supported(struct rte_eth_dev *dev, struct eth_driver *drv) +is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv) { - if (strcmp(dev->driver->pci_drv.driver.name, - drv->pci_drv.driver.name)) + if (strcmp(dev->data->drv_name, + drv->driver.name)) return false; return true; diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 32d3b19..28cc554 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -257,7 +257,7 @@ i40e_fdir_setup(struct i40e_pf *pf) /* reserve memory for the fdir programming packet */ snprintf(z_name, sizeof(z_name), "%s_%s_%d", - eth_dev->driver->pci_drv.driver.name, + eth_dev->data->drv_name, I40E_FDIR_MZ_NAME, eth_dev->data->port_id); mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN, SOCKET_ID_ANY); -- 2.1.4