From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id DC782D2D3 for ; Tue, 11 Apr 2017 17:45:29 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id o81so66912620wmb.1 for ; Tue, 11 Apr 2017 08:45:29 -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=/Mf3S2pVssalhmIH3FjDJdb1y7cF3l3v5RzHRBO1Vcg=; b=infrPwaX0wWMvoW3nzKjbFsMr2aDFjzxjqzxtSWonwiuyqbqBLSB0AbuhpX3KMP+JE 2UTFgJ63r2cyPkJEqgweA0xGx075wIFnvcMKNlKZKew+Xe0zuYUVQboKVxihA6AqLXkT QRk5P5LT9PPsTEsZTaNvIebukSMZ3oPowLk93PlZCO4FLKq7jzsDc2RXAlvFmlL297pk BFPRXmhyx4/BYfDs2BW2Mo30L2mZG1Qt8rHIQlmKW0IrdbvopsmHld7AoD14BBcOkOy9 lt0EyoNBQfKEcFOQeOnqqcK9ZYbKL/yH80QogyLMmOgY3r+ccBHC6qMgA80F1n5qpxS3 kh9w== 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=/Mf3S2pVssalhmIH3FjDJdb1y7cF3l3v5RzHRBO1Vcg=; b=uoGF8/hAD77GhRs53EkaBrB8rvVHK9j2LL6pNajtV/ct2Gh8QZBhE/CNeeCwdoI16N m9yUXNFk/+qH6E9gTRjmqwbVqp1KEhK31dZglNCWjQRMXa03dDVbiDh9qwsXtGdFSqVt yXTCs59qdwobY9h/0BCqiOiiyT+87mcOvoh87lbW606uVe5U6lmutPaKr1pL2JAyWb9h zU30kMJyRGudwPkOVSuAIRbYLM7nv49MPa9slP/cnQN9E8TmahFgT5VSe7ncOEOZVqOL n846/usQvCIpFQ78gSKWKhxbfBmqD+TpW3mtzK+Vs2s/WAasHrtJxLVYdFf1MJngXuHE Jukw== X-Gm-Message-State: AN3rC/6hecMX/ha6FMOmp/UWsM+50Cb12xS4Sy/50+dsTNUA66L9wWAB+P9Tsv7x2XlJ6iDX X-Received: by 10.28.65.65 with SMTP id o62mr14205226wma.14.1491925529320; Tue, 11 Apr 2017 08:45:29 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:28 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:32 +0200 Message-Id: <5b89ae1e4437969653087d6ac27e469b9b1b3355.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 25/42] net/fm10k: 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:30 -0000 From: Jan Blunck Signed-off-by: Jan Blunck --- drivers/net/fm10k/fm10k_ethdev.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index de0352e..94b4d40 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -3112,6 +3113,18 @@ eth_fm10k_dev_uninit(struct rte_eth_dev *dev) return 0; } +static int eth_fm10k_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 fm10k_adapter), eth_fm10k_dev_init); +} + +static int eth_fm10k_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_fm10k_dev_uninit); +} + /* * The set of PCI devices this driver supports. This driver will enable both PF * and SRIOV-VF devices. @@ -3123,18 +3136,13 @@ static const struct rte_pci_id pci_id_fm10k_map[] = { { .vendor_id = 0, /* sentinel */ }, }; -static struct eth_driver rte_pmd_fm10k = { - .pci_drv = { - .id_table = pci_id_fm10k_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_fm10k_dev_init, - .eth_dev_uninit = eth_fm10k_dev_uninit, - .dev_private_size = sizeof(struct fm10k_adapter), +static struct rte_pci_driver rte_pmd_fm10k = { + .id_table = pci_id_fm10k_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_fm10k_pci_probe, + .remove = eth_fm10k_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k.pci_drv); +RTE_PMD_REGISTER_PCI(net_fm10k, rte_pmd_fm10k); RTE_PMD_REGISTER_PCI_TABLE(net_fm10k, pci_id_fm10k_map); RTE_PMD_REGISTER_KMOD_DEP(net_fm10k, "* igb_uio | uio_pci_generic | vfio"); -- 2.1.4