From patchwork Mon Mar 6 10:00:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Blunck X-Patchwork-Id: 21452 X-Patchwork-Delegate: thomas@monjalon.net 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 74725FA4D; Mon, 6 Mar 2017 11:02:16 +0100 (CET) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id CCE206CB4 for ; Mon, 6 Mar 2017 11:01:15 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id l37so20983938wrc.3 for ; Mon, 06 Mar 2017 02:01:15 -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=SelYqPbvcPAeOpA1RO4LfwGcC9RBL5UnXUtkyADgBt0=; b=uC0oTOCHW1yFYdLQwigmJ/3ZXTi1Ag8HYGFIpvLuPF74hUUJIpz36ORsfQ6sELT/hR AaexJgqoZacI5o/OrtTnwo/jo85Qui8ahqre0Idnv3DClXHVw/o03AXBDRU78ZAaE1QC MHvD6FKt9k1yS84yUoEbgIj1CQ9VVrUbXqVHqWsUKKqn7NYZhyagWgFD+PDotyQ9FZmT yQCIHo2PuRFPtABXxSJa8X7HeeuKq4Wy2NIWlXSI1FwbJ+CVB+YBaHmkKqdu9YI8lAVq t2TIFxEVVgQhnilRN1kTKtQYVGa+wQ3gmjLGKqE7w26rJ5PKi4FmDg+kz4cOYQ6JWDL+ WvQA== 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=SelYqPbvcPAeOpA1RO4LfwGcC9RBL5UnXUtkyADgBt0=; b=FSdp43WG0Zndi9rE8H+gVM61EglwCvjwtEsRv6oIUgqZwlKFjKhwy9WN1jlOK3mZ/W wXRpdy+07+J1mtP6D24IGsn4Pf5MaYu+YPp0cLjjmHZTDD0UwO4jY7CX/FdmzhPWGZfO o5Sqjgrio6/8xeuYbTXl6k9cwyYq1SsFkz9Eq0uAAlVOvySbj9BR9Dz1n31s2/5NeqYU MuykLwbxpDqHuW8FyzHAxLJRUd/NHSF5D/iQJw0lv4ITlA4R7tyKWYe6lY1dWU9JoMrw i8TKuzMvYBF9yicGdsHC9lcCDXdYV1+zQ1SrefuIEJa07GNnH2AdLxXItnLMplqtnig3 EODQ== X-Gm-Message-State: AMke39mFhPA7uJ6W/7fpJStLVYmAX2EGAFYAewp7zdyDjwhGJq5bJM5KkYWRLgJLn+dY/g== X-Received: by 10.223.135.47 with SMTP id a44mr12177897wra.197.1488794475177; Mon, 06 Mar 2017 02:01:15 -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.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:13 -0800 (PST) From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:18 +0100 Message-Id: <1488794430-25179-27-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 26/38] net/i40evf: 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Jan Blunck --- drivers/net/i40e/i40e_ethdev_vf.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 55fd344..2a10ad5 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -1542,22 +1543,30 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev) return 0; } + +static int eth_i40evf_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), i40evf_dev_init); +} + +static int eth_i40evf_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, i40evf_dev_uninit); +} + /* * virtual function driver struct */ -static struct eth_driver rte_i40evf_pmd = { - .pci_drv = { - .id_table = pci_id_i40evf_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = i40evf_dev_init, - .eth_dev_uninit = i40evf_dev_uninit, - .dev_private_size = sizeof(struct i40e_adapter), +static struct rte_pci_driver rte_i40evf_pmd = { + .id_table = pci_id_i40evf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = eth_i40evf_pci_probe, + .remove = eth_i40evf_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_i40e_vf, rte_i40evf_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_i40e_vf, rte_i40evf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_i40e_vf, pci_id_i40evf_map); RTE_PMD_REGISTER_KMOD_DEP(net_i40e_vf, "* igb_uio | vfio");