From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id DF9D6BD28 for ; Mon, 6 Mar 2017 11:01:16 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id n11so12816154wma.0 for ; Mon, 06 Mar 2017 02:01:16 -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=Aamu+dGduNmH6f6GgbKlWyRrfiFMZWXzH2AaN1F7syU=; b=jRDWpXxfq4hSCFWqosigiDvhnHrj/fy2AQtI+xe0rs/ej7Cp1keJqu88+QVbN4Qw0/ /NlJX9PyTcCtKy5A/9SiT1m3esqgR1P2KuYsa6mlvmk+IUd3H1Z6bQHe2Dy/uFjWmUJb 5YXHSIZVgEVIfv9M1E4Fy/tjV7N5kR05XyeQUg4WobtJc6w7AdmRn5eXvrHJkeSUIyRT 1RnWtYeN25fvml14Y6LNGCjCoMoYlqkmrgdpepIdt8v7pV5S6kEbxa10qiJe2Dv3PN0U 2Np+Ob/FbKom7quc9ka4E1EG9diFKYABzbAvz0184u0/ESanqz7N8ifRfSEV7mqPCUV5 ywww== 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=Aamu+dGduNmH6f6GgbKlWyRrfiFMZWXzH2AaN1F7syU=; b=QBVJsFjceP6AY/TU0zUqdjZWHGYI1Kj9SToq1lGtjHebYCE780lSgQS6Rf3Bo6/i8i Ig7X0TxP9sLhngeNm3aB7lzWMgm4slohwhfW89Oz8bzujjEnFMaCPGVwa9QEztvK+G/V QS4SmEo8rRLu+e08X5DzrKQTniAIYEVUZJ04JcJ7KyMIrtSiUNbP70BiM+xnSqwyG82x bOdmsHOigBU9mtG0GHHIAjJN01MQVHsldlFbu/J1d0uUIednEyInLZmez+pw8fAYUagv TyRfkH/GXrza13qZm59kUAr0GrFV3V3bnlzmAWOUx0N8yxlfY0S39UHGVzslWeaDf9oN wX6g== X-Gm-Message-State: AMke39knyTdiFgE+ojxhHISJSOxG750Gwgn/93FHx0TAap8DIggxutq+O0dgPQktnqfzXQ== X-Received: by 10.28.9.213 with SMTP id 204mr13319090wmj.89.1488794476354; Mon, 06 Mar 2017 02:01:16 -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.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:15 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:19 +0100 Message-Id: <1488794430-25179-28-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 27/38] net/ixgbe: 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:17 -0000 Signed-off-by: Jan Blunck --- drivers/net/ixgbe/ixgbe_ethdev.c | 66 ++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7169007..de5e3c2 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -254,7 +255,7 @@ static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr); static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config); static bool is_device_supported(struct rte_eth_dev *dev, - struct eth_driver *drv); + struct rte_pci_driver *drv); /* For Virtual Function support */ static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev); @@ -1767,31 +1768,45 @@ eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev) return 0; } -static struct eth_driver rte_ixgbe_pmd = { - .pci_drv = { - .id_table = pci_id_ixgbe_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_ixgbe_dev_init, - .eth_dev_uninit = eth_ixgbe_dev_uninit, - .dev_private_size = sizeof(struct ixgbe_adapter), +static int eth_ixgbe_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 ixgbe_adapter), eth_ixgbe_dev_init); +} + +static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_ixgbe_dev_uninit); +} + +static struct rte_pci_driver rte_ixgbe_pmd = { + .id_table = pci_id_ixgbe_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_ixgbe_pci_probe, + .remove = eth_ixgbe_pci_remove, }; +static int eth_ixgbevf_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 ixgbe_adapter), eth_ixgbevf_dev_init); +} + +static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_ixgbevf_dev_uninit); +} + /* * virtual function driver struct */ -static struct eth_driver rte_ixgbevf_pmd = { - .pci_drv = { - .id_table = pci_id_ixgbevf_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = eth_ixgbevf_dev_init, - .eth_dev_uninit = eth_ixgbevf_dev_uninit, - .dev_private_size = sizeof(struct ixgbe_adapter), +static struct rte_pci_driver rte_ixgbevf_pmd = { + .id_table = pci_id_ixgbevf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = eth_ixgbevf_pci_probe, + .remove = eth_ixgbevf_pci_remove, }; static int @@ -4382,10 +4397,9 @@ ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) } 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; @@ -8682,9 +8696,9 @@ ixgbe_clear_all_l2_tn_filter(struct rte_eth_dev *dev) return 0; } -RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio"); -RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe_vf, pci_id_ixgbevf_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio"); -- 2.7.4