From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id EB06AD2B7 for ; Tue, 11 Apr 2017 17:45:21 +0200 (CEST) Received: by mail-wr0-f169.google.com with SMTP id l28so752061wre.0 for ; Tue, 11 Apr 2017 08:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=NnPVJ16UhQX82kqlN+u2J4rSk2aLN5lygIHjgdOA1B0=; b=EYU/J+mBW3WAGg9YDIg2Y7yCJv/6XADiEaqjbRzk12q3fZTMVqxoQS0/27bhdtTJLf 5436SzN8sTrlzeNGG7peRvZm9jNVmWCVDvcfdShF6h2AygkqWRO4yxzy2t1vuEta34GX DXwF8jEsMDwQOeL92cFjeRu/KRisse442Ed7IW+UXtAm+jhusMqKQHbuEvv8NqZc2BOT 9mgDZhvBesIiyRsnqaPyzR9+2jAlTGb+RVSN1Q5RimhBl2u0JZHcbI6YapQjDLoFyMtT sTiouRV6QnkjPzig16cs0gAX9dOWi82Dw0/VJI92+sdHF+6KgViwlef+wH1/lYeBnThd NDaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=NnPVJ16UhQX82kqlN+u2J4rSk2aLN5lygIHjgdOA1B0=; b=tJOnGHF/S5hLi09oDzwR/2+tG3004ZhB4aPjxrN5T6RXj2YM7sKiVmp73R1NJ9aQ/I NRJFlk0BWo79yWUobWgsGuh+tiakkBSk9L22oDO0scXQiHsP1SFjv4mayPDcp7nB/CTo lwV9esjBi+dNaoxmMAWMpIQ1Dk4aSuPInwghr8lDDq6AkJ4affIJb4C8KFnNUCC8V1ku UOBrsRRU0zQ7gndDKyl4ptIkjCQH8qlvk0qAMmVuCKDNtaXOIV/sHwXFVSELllEP2tqr doTsiTVV7G9NkEbGnRktCaokaIcqKfwMBXqf96fI3jjEbzfsvwJ8OASPxyXNUw3GLJQw ph8w== X-Gm-Message-State: AN3rC/5vpRtCrOKQbdEmCrwHc93FQ/aebR4NXgJq3WwMpTpfPwi8NHTjncn+mQMwnaigWVed X-Received: by 10.223.175.218 with SMTP id y26mr10391625wrd.63.1491925521179; Tue, 11 Apr 2017 08:45:21 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u63sm2933738wmu.22.2017.04.11.08.45.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:20 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:24 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: <1488794430-25179-1-git-send-email-jblunck@infradead.org> In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 17/42] 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: Tue, 11 Apr 2017 15:45:22 -0000 From: Jan Blunck 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 78cb3e8..f0a0219 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 @@ -1612,19 +1613,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); @@ -1636,7 +1644,7 @@ rte_virtio_pmd_init(void) return; } - rte_eal_pci_register(&rte_virtio_pmd.pci_drv); + rte_eal_pci_register(&rte_virtio_pmd); } /* -- 2.1.4