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 238D05A68 for ; Mon, 6 Mar 2017 11:01:07 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id n11so12815476wma.0 for ; Mon, 06 Mar 2017 02:01:07 -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=McRFUIge4fQoILwMiGmWwQrc3CoM/b4cGuqJZzLx74A=; b=g6KDG7foDFgcVh6QNJ6qp1C1nnQa86kkQQ9PJHWN8eQ6odjq89jqdSx5VRZDNNm7Dd xQjfrSCK9VUOMRwf4Hr1wb5xYz2pRAAY6COLjb/2fXy2amk83D5KWLxKtkpq5iaKWToO hlyWjVh4cI1kwaTv+NrhGn1Okahgs1Q3fyX2uPUzWVYUVY43fdvXvGLtD6Mya/m8M1B2 Dr/qAT+MMuOhgEXbmP2OkeNCNoleD1Xr9RChVb6f85V2JFw930BCv0RzYuCW3ecU4lWY t3h80r5BmMgSSlECbaUHXx2Rhmp2G2JKYNjmQatVSfu1rrMSn8peBox06QHoDaZtMZQk +9qQ== 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=McRFUIge4fQoILwMiGmWwQrc3CoM/b4cGuqJZzLx74A=; b=FxwJDJCLVeVE9uRuIlVxXs/1FQZiUV2GWvKobKBvrAXOQllwWy70bZl0JNFqI1Bb8t 5rClzGz0VR21eEMKRo4IR8mfVhd35qrxeYsrFIQT/dJgplJ3jZlJ38lBhIo2+goUJGyQ WLo4lJcUxHttvS8fD8M50kqtk8OIaOfggNGnqF9DhanWaIkyS2hgmXBcZTfZb2P1lh62 O0zkjTG47YEVG76RHlXRA3ytvWsdJ+ecI+mion8L1GQ/gXkHwY9OoPDaP9DbRX98bpno v5181ZxcqhZFkxZzeaJZ9iN1v6ayqT2NFTFh+ITqabsTPO/JoA4qlSnWsrxUtKWFMTKi +nfw== X-Gm-Message-State: AMke39kVZMbJor+T3QMFM6lMHQi0Goi6xwN1vPIkzuQRwfGC4PT8K1/Z3PPlGNh+Vs1MLg== X-Received: by 10.28.54.194 with SMTP id y63mr13253758wmh.46.1488794466486; Mon, 06 Mar 2017 02:01:06 -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.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 02:01:05 -0800 (PST) Sender: Jan Blunck From: Jan Blunck To: dev@dpdk.org Date: Mon, 6 Mar 2017 11:00:11 +0100 Message-Id: <1488794430-25179-20-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 19/38] net/cxgbe: 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:07 -0000 Signed-off-by: Jan Blunck --- drivers/net/cxgbe/cxgbe_ethdev.c | 29 +++++++++++++++++++---------- drivers/net/cxgbe/sge.c | 6 +++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 4d543a7..34fed84 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -1039,17 +1040,25 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev *eth_dev) return err; } -static struct eth_driver rte_cxgbe_pmd = { - .pci_drv = { - .id_table = cxgb4_pci_tbl, - .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 = eth_cxgbe_dev_init, - .dev_private_size = sizeof(struct port_info), +static int eth_cxgbe_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 port_info), eth_cxgbe_dev_init); +} + +static int eth_cxgbe_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, NULL); +} + +static struct rte_pci_driver rte_cxgbe_pmd = { + .id_table = cxgb4_pci_tbl, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, + .probe = eth_cxgbe_pci_probe, + .remove = eth_cxgbe_pci_remove, }; -RTE_PMD_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_cxgbe, cxgb4_pci_tbl); RTE_PMD_REGISTER_KMOD_DEP(net_cxgbe, "* igb_uio | uio_pci_generic | vfio"); diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index 37b6090..2f9e12c 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -1641,7 +1641,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, iq->size = cxgbe_roundup(iq->size, 16); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.driver.name, + eth_dev->data->drv_name, fwevtq ? "fwq_ring" : "rx_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); @@ -1694,7 +1694,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, fl->size = cxgbe_roundup(fl->size, 8); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.driver.name, + eth_dev->data->drv_name, fwevtq ? "fwq_ring" : "fl_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); @@ -1890,7 +1890,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.driver.name, "tx_ring", + eth_dev->data->drv_name, "tx_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); -- 2.7.4