From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 26C0F6CB4 for ; Mon, 6 Mar 2017 11:01:14 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id g10so21001499wrg.0 for ; Mon, 06 Mar 2017 02:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=YqSPNqylkJzBlYeDaTjQqcW+4UmJkTtbyNPhNMxaEBI=; b=YyjBysIN8v1z8E/cqs5FH20ZlpSYXkXubAaHI1zIFavyU/N15cJxn38kDVOTzNO2Ot Z2brxPMFKddeLBahusMZNTVDh0vz8RUFtawKBR4XHCbUgS6i/aLlqVORWMk/ddnNWtjf V/p9VWlo+yU5CmQVJP7reaPQgxZt5+u7s9AiIlM2XUaEJTEQDyliRNp3o0WbpylCicbw 975F5H7ujQ8jj3JE9IR/blktQlOf4U0wiNcpX2c2WMdoYVVc+gvbUqkbe/EQgfcw7JgE C5Zz4txUC91tCuMfclczmv8Tuh3jcQki29C+ChC2uVgl+FATNNMvozNw/PckBCHU/tQ2 YRlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=YqSPNqylkJzBlYeDaTjQqcW+4UmJkTtbyNPhNMxaEBI=; b=UgMLwtXFqVY3k7NEQlXH8TrLyQhB6hmv20tLsxM5N/bHIAWQoTL6H0wzXd5g7VuEAP a+pzRXP7E84Fs5cohayJt6ZLG/0Dgu/kNppSKMl4ox53k2CPaZMXrKtDlPlt7xv0g9Qg H+r6pCO7TaTn1SfKuYvxbnRw8LETV93+kluUrR5Egm/BDpYDEcFs8qTiLRh0dP/nFY+x msyzg4o5myzVA6/Ag80ITtCadSQ1LrT3rtA791vH4RTldvss9kYYwrJdtffBbVd4qXcq qc4k4/BUhLw8/xbWxFzRe8Tnud8oSC4EvIwR+5r1s943AIlN7QQN7/9nPrOtAKjm8ea/ LAbw== X-Gm-Message-State: AMke39k+pOGvP5VD1+5etTCOG8ZRoDreO13Wm06q2GfcWB7PR12pdep1L04dQUCLnfS4Vg== X-Received: by 10.223.128.99 with SMTP id 90mr13490636wrk.157.1488794473697; Mon, 06 Mar 2017 02:01:13 -0800 (PST) Received: from weierstrass.local.net ([91.200.109.169]) by smtp.gmail.com with ESMTPSA id u145sm3829237wmu.1.2017.03.06.02.01.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:12 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:17 +0100 Message-Id: <1488794430-25179-26-git-send-email-jblunck@infradead.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488794430-25179-1-git-send-email-jblunck@infradead.org> References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> Subject: [dpdk-dev] [PATCH 25/38] 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: Mon, 06 Mar 2017 10:01:14 -0000 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 303027b..8d4e509 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -627,16 +628,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 @@ -667,7 +675,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"); @@ -10282,10 +10290,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 0700253..35751d8 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.7.4