From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 8E76DBD28 for ; Mon, 6 Mar 2017 11:01:21 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id u48so21047515wrc.1 for ; Mon, 06 Mar 2017 02:01:21 -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=CHuOVuCiZRTbmbwlL26Rf1VMFqn+xaFPdaODkGiNpAk=; b=OlEYBtHMpk4754cBnxCYbXkOlfTYndSrXkE4WhAHeM7SVgzArhHgTg5nDmklrxsmai S/zJnT5DRPoyO3feShwZSPQxfo8FH3bzdurT+5oFjTeICyxeQtyObVb0HMjPcRIvaSc6 w/o14a2/SaXzELu0Ax1GZhiBUnz1x6s35Wv3Ht9GzIMIPSXDsa2UCxVZmfxQoc4PEMYj Vhvvu6WE5/dKdNd3BiZpGB/inDohPquVECA/ruIvhfEmBzsGZ9y7KduyJvw2ZXCkiAUT XN7NeP/IQnBmEgKhtP792DWg4BAgk4YJ9vGCzYf8hVZncbLu2Goep3xMhKedjywNigeT L2/g== 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=CHuOVuCiZRTbmbwlL26Rf1VMFqn+xaFPdaODkGiNpAk=; b=QSiAEf8siJU/ctav7luFSGzi1aiD7RcuCPMR4nZJ5vOWKelhKF18jOOtM00gqsfyOP ngxsmNgaGP9FT6IwBQh9SPt2Fd9NDgnLrVsetNPA/m/F9vkS2qmJKPu+6Dd7WnV92+S0 1SzjFC6MwvEwQ3PK+xVMxNdnGZ6aNHpG5ikXNtqtvmzoNo/PfSuinn1paTZLW31aBUt5 abLqwg5Df89Ad3tFTNH8P4RQwvv3UQnn93pCKVbn+Q+1djl+5BmqSvz0IiGXbz1GM5ET uL+Cu8wdSAA1VbvFDk5aePhoWgI+f33lWqPPhorCUcfQ4n7BJV41HSnIrA7yKny46P33 05tg== X-Gm-Message-State: AMke39m/lPEyf4U4JNCJunLf3HVM2govlBtOVQajZ6s5pLfspp7ZJtqPk5ZBXQJ4+SfvvA== X-Received: by 10.223.172.137 with SMTP id o9mr14523923wrc.66.1488794481237; Mon, 06 Mar 2017 02:01:21 -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.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:20 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:23 +0100 Message-Id: <1488794430-25179-32-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 31/38] net/sfc: 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:21 -0000 Signed-off-by: Jan Blunck --- drivers/net/sfc/sfc_ethdev.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 71587fb..ef8970d 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -29,6 +29,7 @@ #include #include +#include #include #include "efx.h" @@ -1340,21 +1341,28 @@ static const struct rte_pci_id pci_id_sfc_efx_map[] = { { .vendor_id = 0 /* sentinel */ } }; -static struct eth_driver sfc_efx_pmd = { - .pci_drv = { - .id_table = pci_id_sfc_efx_map, - .drv_flags = - RTE_PCI_DRV_INTR_LSC | - RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = sfc_eth_dev_init, - .eth_dev_uninit = sfc_eth_dev_uninit, - .dev_private_size = sizeof(struct sfc_adapter), +static int sfc_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 sfc_adapter), sfc_eth_dev_init); +} + +static int sfc_eth_dev_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, sfc_eth_dev_uninit); +} + +static struct rte_pci_driver sfc_efx_pmd = { + .id_table = pci_id_sfc_efx_map, + .drv_flags = + RTE_PCI_DRV_INTR_LSC | + RTE_PCI_DRV_NEED_MAPPING, + .probe = sfc_eth_dev_pci_probe, + .remove = sfc_eth_dev_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_sfc_efx, sfc_efx_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_sfc_efx, sfc_efx_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_sfc_efx, pci_id_sfc_efx_map); RTE_PMD_REGISTER_KMOD_DEP(net_sfc_efx, "* igb_uio | uio_pci_generic | vfio"); RTE_PMD_REGISTER_PARAM_STRING(net_sfc_efx, -- 2.7.4