From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) by dpdk.org (Postfix) with ESMTP id 935AFD278 for ; Tue, 11 Apr 2017 17:45:24 +0200 (CEST) Received: by mail-wr0-f182.google.com with SMTP id z109so712246wrb.1 for ; Tue, 11 Apr 2017 08:45:24 -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=9VudlT24lHKUNRSh2SBthL07P7zFK8bB/xDsRmngbkU=; b=TsfDHAGBMx7MUad0GHlo66kTf/RDY9iJd57uA2SUcwmpar6KT7hWEPhHRef2sxxf4t f9qkkzMXXaVu4tY4BufuPHwTgrLuxbckVSEU10bhn1f3OTU5RRrbWpFLMRTcvZRr39pM OVX9Khbt8jAz6OR/3k9ATUELUtt2BYIworW/3D6KPXIHtnyuP/FaXB/0dRWjg7sc5oyk 6QMpu1yjkjLErZ8qXcROfIh043wOh4V5bQlIOi4emY8gumgNpqu8YT0IO6kL3lTPXWiV bfeBHJWzoqKdkkYkAU+wj9U1F0LU8Y4Td8vmpB6DFjji1LO8ULxtHYGXK80+uDrtbXnM dG3Q== 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=9VudlT24lHKUNRSh2SBthL07P7zFK8bB/xDsRmngbkU=; b=J2N1RtboHJevcMdS5IvyfeGv/hitmrUiOxS2QHroMVNkvFVxMaa3EWhpFEa96psDaU hQUCRNDwcyCAvSbOn1PxhUrRN5EFckc0bLekqccyZ/g7Z3oYzHmoxB/XUYNusFXzDptW 753THW1PBbTI/fJ0lrXr8XVkp/IRKJy3o7+HfCL7eWsnUJ/5i6zWg0PrWb4TnELmK0ti FWdTJtXdHJORkNjH7WhCQZH1+yuAPCh0HHl3ZKdIw3LCc+Ekra+NUi4t1S4xdAiJO9z2 mheU++rWa3DYfu9O2WiJ0pedNYcUz6TzF/TPT4Z4w0OAt0UgzCuqjI4VtBt7gWak0iJ1 WReA== X-Gm-Message-State: AFeK/H3t0L4+lRtHO7u7IBi5o1qdD3IZr5pahGNTRbxBKK78lp1rSgPwtUSKBXdYnSmx89WA X-Received: by 10.223.139.142 with SMTP id o14mr53186622wra.9.1491925524345; Tue, 11 Apr 2017 08:45:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Apr 2017 08:45:23 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck Date: Tue, 11 Apr 2017 17:44:27 +0200 Message-Id: <3d3e9fdfc9f4c7a6f76f42e34a8b56a1cac81cc6.1491924900.git.gaetan.rivet@6wind.com> 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 20/42] 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: Tue, 11 Apr 2017 15:45:25 -0000 From: Jan Blunck 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.1.4