From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 385E65927 for ; Mon, 6 Mar 2017 11:01:03 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id v190so12806484wme.3 for ; Mon, 06 Mar 2017 02:01:03 -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=pcIiKr0+qQ/XYGs6QETY8HvpM5RnOw3mOxIrtMx6sNo=; b=AOTFKuuFOLwQelVf/ZU5FSuw6KJQDUhZCnpVEZ17Pndz2EdGqAY8z/YZDO00+HKqFU +rbFUqpu20c91YZpj4NL8WwQvSKOy+lDFe+d4LTI5uJi/XOvrCKh8yO8/idVAsJ+LOCR yBxYMSprJxThoJ1JgLbj4rAwGGy2Z1pu0jIy1HxV/r6OBwThTsRqf5Ymdzqt9LA74tH1 UZ6f76+fxUgj62S2vtTHMtxMITrJncNCf6b/aXi1kuq9NLKEVYEYN/JpFPqlJfq/Om3t etUyueDzf7I8cnO/+GiBe1joaf3qrGPd82jgyR26YH0nxcvaCxzrrkiagR4IGtAn/IqL lvjQ== 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=pcIiKr0+qQ/XYGs6QETY8HvpM5RnOw3mOxIrtMx6sNo=; b=KqRItVbczdwzovjzowq//zL0MJxFWSjXVOGD9kw1D/PoMdaCzjWEOBHUkCchVB+8jl KmCJZiM8j4lYGXHdoiZnPPgxI+LEmzi4EQrOUGyYu9Lzc/HQGjMS/ZTLXZFTk8sGGahu shD4xy7uqeBRH6TyxH4nid9IhFWr7IQjS/x0qo+UkxX8XJNYZoEgFE+WeLeQfQss/YTi 3xbrGOhUWZSDuV1vEr8iwz8YJWY/jt4Alb3lFwI2LTtr2aZC5HLKedlhGtE+6SzcoeEc e3nZdGmzhPDQPP5URgI4FO2pKHEux69lVBKsTXgAjfkjRNS1DeT2OHN1ITmSiKhZiHqY fBYg== X-Gm-Message-State: AMke39lRFX7VMzKxx2ccPF6SVT7HCz6xyhDq0ktT67E+Z+KhP/vRNREoFKT4LeNoMJDSyw== X-Received: by 10.28.196.68 with SMTP id u65mr13239348wmf.8.1488794462863; Mon, 06 Mar 2017 02:01:02 -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.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:01 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:08 +0100 Message-Id: <1488794430-25179-17-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 16/38] net/virtio: 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:03 -0000 Signed-off-by: Jan Blunck --- drivers/net/virtio/virtio_ethdev.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 4dc03b9..a600ca5 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -1572,19 +1573,26 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) return 0; } -static struct eth_driver rte_virtio_pmd = { - .pci_drv = { - .driver = { - .name = "net_virtio", - }, - .id_table = pci_id_virtio_map, - .drv_flags = 0, - .probe = rte_eth_dev_pci_probe, - .remove = rte_eth_dev_pci_remove, +static int eth_virtio_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 virtio_hw), + eth_virtio_dev_init); +} + +static int eth_virtio_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, eth_virtio_dev_uninit); +} + +static struct rte_pci_driver rte_virtio_pmd = { + .driver = { + .name = "net_virtio", }, - .eth_dev_init = eth_virtio_dev_init, - .eth_dev_uninit = eth_virtio_dev_uninit, - .dev_private_size = sizeof(struct virtio_hw), + .id_table = pci_id_virtio_map, + .drv_flags = 0, + .probe = eth_virtio_pci_probe, + .remove = eth_virtio_pci_remove, }; RTE_INIT(rte_virtio_pmd_init); @@ -1596,7 +1604,7 @@ rte_virtio_pmd_init(void) return; } - rte_eal_pci_register(&rte_virtio_pmd.pci_drv); + rte_eal_pci_register(&rte_virtio_pmd); } /* -- 2.7.4