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 59BD769C3 for ; Mon, 6 Mar 2017 11:01:19 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id u108so17053234wrb.2 for ; Mon, 06 Mar 2017 02:01:19 -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=B5z4vVxw0aaRFBXjrw4jdUUmEQUKwMwh0+/AXEr36sM=; b=W++Z3ldfLBE93fAGTje+kGfZkDboTf7pieaYY9Z2J1xSEs9XGX2iHVjrlx4tIYT6au zEHaab6VjCm2UD4aO1CVs/xN74GDQ1V5WLTdJOmaepyOzvP/GRiSpXwhsj5pqOgNmjnK dTvJRlI3HzyvBNmQB0QUtUKDfiP9xDQzf+PgP9EXcVqImpnSqngUS84/3GeTiU6fT3Da Rot04g0gCYOa0BDLNIwS/Ur0mOr0RVWO8cAugcbIUEo7nPWsMeK2P1mEVg+peZfFaN3s HS0YeebpC6uhYADFJsSYIvns8DmGqhPB1MPa+id8h2RlWoT85imPwPYiGIXeePMXP+9G 8/Zg== 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=B5z4vVxw0aaRFBXjrw4jdUUmEQUKwMwh0+/AXEr36sM=; b=EZ7URtFwH+xXVJ/7CGUwJTevaC1llXVcbLF57gj/7mLpKD9GzF0YiHaYRnqHQM4cwU T5vFZr0/mNhZynas4YIvNQXyenf0qKWhIEj8UQ2nYcFkCMS2t9PfkSSnspOtdj+pARpI VxNDsJ9Eg/epEq1vMK9RpnXzfqeidzwqtNTRlroBtjQVhZZ8XBog3ti73RGaj1wLTllZ K3XRz5wEGw359F3KCWC81kNkVWs3DuB7/KEsq67HmLO/8haDl2ghNP/MvlRkLJl1yCSG O+ClTItUsqnZDy4rUaACfoev6ydExhIs7Zqp0lmBzEHxSP2lgNMPGjqBxE8dUAoMWC6A eokA== X-Gm-Message-State: AMke39mdgzNn8sdczgUQ3yS6EVmH8WhCz3v4LIp2uX8jA0LzeBM+hnCkVQentHooHTv5WQ== X-Received: by 10.223.139.68 with SMTP id v4mr14694775wra.70.1488794478987; Mon, 06 Mar 2017 02:01:18 -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.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:17 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:21 +0100 Message-Id: <1488794430-25179-30-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 29/38] net/nfp: 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:19 -0000 Signed-off-by: Jan Blunck --- drivers/net/nfp/nfp_net.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index b9dfe80..4cc003e 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -2579,18 +2580,26 @@ static const struct rte_pci_id pci_id_nfp_net_map[] = { }, }; -static struct eth_driver rte_nfp_net_pmd = { - .pci_drv = { - .id_table = pci_id_nfp_net_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 = nfp_net_init, - .dev_private_size = sizeof(struct nfp_net_adapter), +static int eth_nfp_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 nfp_net_adapter), nfp_net_init); +} + +static int eth_nfp_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, NULL); +} + +static struct rte_pci_driver rte_nfp_net_pmd = { + .id_table = pci_id_nfp_net_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_nfp_pci_probe, + .remove = eth_nfp_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_nfp, rte_nfp_net_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_nfp, rte_nfp_net_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_nfp, pci_id_nfp_net_map); RTE_PMD_REGISTER_KMOD_DEP(net_nfp, "* igb_uio | uio_pci_generic | vfio"); -- 2.7.4