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 5A0C75A68 for ; Mon, 6 Mar 2017 11:01:10 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id v190so12807141wme.3 for ; Mon, 06 Mar 2017 02:01:10 -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=04D+h45qwEmF4dvD/MB4U4VpCqWm0rmLeW5d9Uwa/U0=; b=HailI2vYW9B7F1jjABex44xOjXfcWU8WbMqB9pKxuZ7mQnHOA8qcZmSU8h7eN8uAV7 T8d7AymfhDksTvm6kJgEoZ9HvJQ5IhxwbKQIVMtJkMWi0g0yOQQtN7D/yJT5IArZVhWS /q0XzqP8LpJ1+OauwU8eQh5cxB0EWDSRVEM1leUx0JEWnb73Ky/S2Re6b1LBEQTcdPUf samM3okZSzmSZr2kDH7wYl/4VhMHH6Rr+0PpS/76buqw8Cl0Am5ntFSxpHXACkHDE/Pz RJHq5lJudZPposYER1KEU7xB5yjeYEbsKHZyCoKNLxYjCImi16hcE55chv1G1rKrR6O+ xqow== 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=04D+h45qwEmF4dvD/MB4U4VpCqWm0rmLeW5d9Uwa/U0=; b=F+gqWYxILLlzMuo6HREedOJxd8hbsNoUY3S77pxvjNlGr2S6n4FsDhdTlU/gVkvIKk vSEUvOz2hvb9xEQ/+PzZX44GX5nh/GhWj8yPW3qPNwWUsRYanjIojNZKGk+T42L8UW7v lZIhRljxfEpSYXiYAdm38YrJo4eUo2hl57xViJ6/uTXvmPpahKiFomsljW77xZsSNmc+ 8MFdBCtiz0ywb+3lQT31P/tOhx0QDyK0G9IAeWXMphUTF/L910g94t9M7ObaQZFh2u+l fcXCVW/wKP4E5Rs2HVc2bvbeJ1QxvKhjHx0Z7vwZvhycmnmwoW1FAmB3WgQEx8PoyU+j 00Cg== X-Gm-Message-State: AMke39kiC3MuADr9yrHp79uB0BJs4RGWQzEYNae9QtH0iiz0KckOCgRuemwnk3aD0AM4aA== X-Received: by 10.28.23.66 with SMTP id 63mr12777829wmx.46.1488794469930; Mon, 06 Mar 2017 02:01:09 -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.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:08 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:14 +0100 Message-Id: <1488794430-25179-23-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 22/38] net/ena: 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:10 -0000 Signed-off-by: Jan Blunck --- drivers/net/ena/ena_ethdev.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index b5e6db6..41573ae 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -1776,17 +1777,25 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, return sent_idx; } -static struct eth_driver rte_ena_pmd = { - .pci_drv = { - .id_table = pci_id_ena_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, - }, - .eth_dev_init = eth_ena_dev_init, - .dev_private_size = sizeof(struct ena_adapter), +static int eth_ena_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 ena_adapter), eth_ena_dev_init); +} + +static int eth_ena_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, NULL); +} + +static struct rte_pci_driver rte_ena_pmd = { + .id_table = pci_id_ena_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = eth_ena_pci_probe, + .remove = eth_ena_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_ena, rte_ena_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_ena, rte_ena_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ena, pci_id_ena_map); RTE_PMD_REGISTER_KMOD_DEP(net_ena, "* igb_uio | uio_pci_generic | vfio"); -- 2.7.4