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 863885A68 for ; Mon, 6 Mar 2017 11:01:20 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id l37so20984148wrc.3 for ; Mon, 06 Mar 2017 02:01:20 -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=exF7TKBsfCXX/5+nP21OPToRj3KWB6Y9/5n/hzOlSdE=; b=ZYJ4rAlDxxPxsMj3eFLe3W8xgYOmj7/62jr1OyR7F7ggt6AtFNcMhX8/bd8bY73+XO yHZ2fseXTwkbQfIlcGTmMsTZm1nHQu3Sy7Qt16HDNZSzvqWc22EWurKqApUOsv04qjGi PwFC/FiRxgesEvVYUvt4BTliZfNh6jrFEj95gkv1AddpibGPFCtLEo5iWiMgPwmWynJ2 GrPrT9yBeGTgXR3cHCgFGHQLauGWxzPoKsufdJQP6nhUVlRBEDaotVBAPeIIXQ/WQ8Is u2JR/LIr8Gm7+gFZ/p73JFOyPFuXsA0/1mYfV1yT4sERgEIwIx7agHbTCIXoONdcK/Rp xt1Q== 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=exF7TKBsfCXX/5+nP21OPToRj3KWB6Y9/5n/hzOlSdE=; b=UU/y7VrMGwAEIpSn3VXafc6dVeyjiLG72qo9Ylh7x7bdOffWQ46bqzwUXtY1LEIWOl L7PzbS7itoUYM8pdm+YAIytCzpH15SaFN6bZlDWAs2xgQ5C4i+A+MxSy6xpu5Vbo+jlU haL2ieyiNhDFhm5ETguj4xD0RqdLY6bsMr4jMNBYgM/L7HDuDgUlK4h4mLaHwiwq9nPm evSmLmJ29PDQ1RXJMHAcAauAy8GAaHiUe6sJvhBExOqiN7p5khdkZrFTBchuDj+OjRW2 FN+HxMmofXkJefBLtQvzzexkNm7rKODQKCarfoW7sIKvcyTO4GNPD9lRFJKl12j7tRjL A3vA== X-Gm-Message-State: AMke39lHmVHjcfZmwq+3qptBNzBoT2ex4wjqOsi6cVmOtmvxoJdf91CS6mrobQVdyXZ1vw== X-Received: by 10.223.128.99 with SMTP id 90mr13491245wrk.157.1488794480153; Mon, 06 Mar 2017 02:01:20 -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.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:19 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:22 +0100 Message-Id: <1488794430-25179-31-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 30/38] net/qede: 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:20 -0000 Signed-off-by: Jan Blunck --- drivers/net/qede/qede_ethdev.c | 60 +++++++++++++++++++++++++----------------- drivers/net/qede/qede_ethdev.h | 1 + 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 0494dbd..8dfddf0 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -2337,35 +2337,47 @@ static const struct rte_pci_id pci_id_qede_map[] = { {.vendor_id = 0,} }; -static struct eth_driver rte_qedevf_pmd = { - .pci_drv = { - .id_table = pci_id_qedevf_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 = qedevf_eth_dev_init, - .eth_dev_uninit = qedevf_eth_dev_uninit, - .dev_private_size = sizeof(struct qede_dev), +static int qedevf_eth_dev_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 qede_dev), qedevf_eth_dev_init); +} + +static int qedevf_eth_dev_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, qedevf_eth_dev_uninit); +} + +static struct rte_pci_driver rte_qedevf_pmd = { + .id_table = pci_id_qedevf_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = qedevf_eth_dev_pci_probe, + .remove = qedevf_eth_dev_pci_remove, }; -static struct eth_driver rte_qede_pmd = { - .pci_drv = { - .id_table = pci_id_qede_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 = qede_eth_dev_init, - .eth_dev_uninit = qede_eth_dev_uninit, - .dev_private_size = sizeof(struct qede_dev), +static int qede_eth_dev_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 qede_dev), qede_eth_dev_init); +} + +static int qede_eth_dev_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, qede_eth_dev_uninit); +} + +static struct rte_pci_driver rte_qede_pmd = { + .id_table = pci_id_qede_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = qede_eth_dev_pci_probe, + .remove = qede_eth_dev_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_qede, rte_qede_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_qede, rte_qede_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_qede, pci_id_qede_map); RTE_PMD_REGISTER_KMOD_DEP(net_qede, "* igb_uio | uio_pci_generic | vfio"); -RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_qede_vf, rte_qedevf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_qede_vf, pci_id_qedevf_map); RTE_PMD_REGISTER_KMOD_DEP(net_qede_vf, "* igb_uio | vfio"); diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index be54f31..0fde8ec 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -14,6 +14,7 @@ #include #include +#include #include #include -- 2.7.4