From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by dpdk.org (Postfix) with ESMTP id E4DA2D2D3 for ; Tue, 11 Apr 2017 17:45:26 +0200 (CEST) Received: by mail-wr0-f178.google.com with SMTP id c55so660231wrc.3 for ; Tue, 11 Apr 2017 08:45:26 -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=xAg6sta06ViGSbDXqok7HHsN8iDkXzg6O77QCGbnV6c=; b=lgtRb0SCecfD+leUlRGTJBN1eECN57aQYiqL7yi6HbO/Z95AoiqlEEpdHvzVnmDgPE B+aGwxxUkzRSlsHwdH51ditmQNBLnG0eU66CXPpVwMa1cczoeWtmbFBBprr9iNgk/zG9 vuF7lCKiUJhtb1nHsZOgxoS5GFcJn+lvPAke1OxcZckw58ccECrfH4e+SLHvNTg2keOq A+q33Wfj4a40qINkFDu88OfA+f+5Gbo80nzGNUOThFl7TAvEEo+HTTdqEOHynYbdgnEn bn0K8iLGNYBzi7ktNPcQ3kuMPvsyRaxXCIzkmsuamIstIPQBlYRxi4z9O65tvTDTsDBF NfUw== 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=xAg6sta06ViGSbDXqok7HHsN8iDkXzg6O77QCGbnV6c=; b=B9Dn+FFqHQneIOPCrX+wCIaEG5VrlBNXhrm2sKbi56dVXO7sSxMJhqjOcbIbGvI2LV t88QbGf+I2g2XQd44RAv0wUDD2aHGW9mf+tEbkB8WOvj2vRo92Klzy8pq/vBOgKnTR5O wEKRIwJS2bG19aQJXK0hWYuty0qtebNSvW2s/QJ5Rbk8E2hP1O/xTR+Rps/+N2H91pYi JdmU9k6OZd6hb1BRwly8phoZPwsH6iYNNmdenkNb6Lw8Bq2CWMt29MHSvC7Ocv7WglfN EyeK75baPS6v+RxCotCkQtc9LKmt/cv463ggKpdRw1SKiwny5Xqr0m9lzDmHatQhoLr1 3E6w== X-Gm-Message-State: AN3rC/7HFByOSY1F2TF+mXol6h+w5Up5iJIdqX2ysTuhHf+0iFglVfJUSTTXtnmHqKUGIc4Y X-Received: by 10.223.133.133 with SMTP id 5mr15784278wrt.83.1491925526298; Tue, 11 Apr 2017 08:45:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:25 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:29 +0200 Message-Id: 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 22/42] net/igb: 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:27 -0000 From: Jan Blunck Signed-off-by: Jan Blunck --- drivers/net/e1000/igb_ethdev.c | 60 ++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index cc2c244..2bda4b3 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1088,31 +1089,46 @@ eth_igbvf_dev_uninit(struct rte_eth_dev *eth_dev) return 0; } -static struct eth_driver rte_igb_pmd = { - .pci_drv = { - .id_table = pci_id_igb_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_igb_dev_init, - .eth_dev_uninit = eth_igb_dev_uninit, - .dev_private_size = sizeof(struct e1000_adapter), +static int eth_igb_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 e1000_adapter), eth_igb_dev_init); +} + +static int eth_igb_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_igb_dev_uninit); +} + +static struct rte_pci_driver rte_igb_pmd = { + .id_table = pci_id_igb_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_igb_pci_probe, + .remove = eth_igb_pci_remove, }; + +static int eth_igbvf_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 e1000_adapter), eth_igbvf_dev_init); +} + +static int eth_igbvf_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_igbvf_dev_uninit); +} + /* * virtual function driver struct */ -static struct eth_driver rte_igbvf_pmd = { - .pci_drv = { - .id_table = pci_id_igbvf_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = eth_igbvf_dev_init, - .eth_dev_uninit = eth_igbvf_dev_uninit, - .dev_private_size = sizeof(struct e1000_adapter), +static struct rte_pci_driver rte_igbvf_pmd = { + .id_table = pci_id_igbvf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = eth_igbvf_pci_probe, + .remove = eth_igbvf_pci_remove, }; static void @@ -5309,9 +5325,9 @@ eth_igb_configure_msix_intr(struct rte_eth_dev *dev) E1000_WRITE_FLUSH(hw); } -RTE_PMD_REGISTER_PCI(net_e1000_igb, rte_igb_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_e1000_igb, rte_igb_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb, pci_id_igb_map); RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb, "* igb_uio | uio_pci_generic | vfio"); -RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_e1000_igb_vf, rte_igbvf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_e1000_igb_vf, pci_id_igbvf_map); RTE_PMD_REGISTER_KMOD_DEP(net_e1000_igb_vf, "* igb_uio | vfio"); -- 2.1.4