From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id E1DEBB0A4 for ; Mon, 21 Apr 2014 17:00:24 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1WcFho-0007di-3q; Mon, 21 Apr 2014 11:00:26 -0400 From: Neil Horman To: dev@dpdk.org Date: Mon, 21 Apr 2014 10:59:32 -0400 Message-Id: <1398092379-7679-8-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1398092379-7679-1-git-send-email-nhorman@tuxdriver.com> References: <1397585169-14537-1-git-send-email-nhorman@tuxdriver.com> <1398092379-7679-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH 0/X v5 07/14] igb: Convert to use of PMD_REGISTER_DRIVER and fix linking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 15:00:25 -0000 convert the igb pmd driver to use the PMD_REGISTER_DRIVER macro. This means that the test applications now have no reference to the igb library when building DSO's and must specify its use on the command line with the -d option. Static linking will still initalize the driver automatically. Signed-off-by: Neil Horman --- examples/dpdk_qat/main.c | 4 ---- lib/librte_ether/rte_ethdev.h | 13 ------------- lib/librte_pmd_e1000/igb_ethdev.c | 12 ++++++++++-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c index cdf6832..64cb610 100644 --- a/examples/dpdk_qat/main.c +++ b/examples/dpdk_qat/main.c @@ -697,10 +697,6 @@ MAIN(int argc, char **argv) return -1; /* init driver */ -#ifdef RTE_LIBRTE_IGB_PMD - if (rte_igb_pmd_init() < 0) - rte_panic("Cannot init igb pmd\n"); -#endif #ifdef RTE_LIBRTE_IXGBE_PMD if (rte_ixgbe_pmd_init() < 0) rte_panic("Cannot init ixgbe pmd\n"); diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index dea7471..e50ed48 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1317,15 +1317,6 @@ extern void rte_eth_driver_register(struct eth_driver *eth_drv); /** * The initialization function of the driver for - * Intel(r) IGB Gigabit Ethernet Controller devices. - * This function is invoked once at EAL start time. - * @return - * 0 on success - */ -extern int rte_igb_pmd_init(void); - -/** - * The initialization function of the driver for * Intel(r) EM Gigabit Ethernet Controller devices. * This function is invoked once at EAL start time. * @return @@ -1402,10 +1393,6 @@ int rte_pmd_init_all(void) int ret = -ENODEV; #ifdef RTE_LIBRTE_IGB_PMD - if ((ret = rte_igb_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init igb PMD\n"); - return (ret); - } if ((ret = rte_igbvf_pmd_init()) != 0) { RTE_LOG(ERR, PMD, "Cannot init igbvf PMD\n"); return (ret); diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 673b4de..5e578c5 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -51,6 +51,7 @@ #include #include #include +#include #include "e1000_logs.h" #include "e1000/e1000_api.h" @@ -619,8 +620,8 @@ static struct eth_driver rte_igbvf_pmd = { .dev_private_size = sizeof(struct e1000_adapter), }; -int -rte_igb_pmd_init(void) +static int +rte_igb_pmd_init(const char *name __rte_unused, const char *params __rte_unused) { rte_eth_driver_register(&rte_igb_pmd); return 0; @@ -2182,3 +2183,10 @@ eth_igb_rss_reta_query(struct rte_eth_dev *dev, return 0; } + +static struct rte_driver pmd_igb_drv = { + .type = PMD_PDEV, + .init = rte_igb_pmd_init, +}; + +PMD_REGISTER_DRIVER(pmd_igb_drv); -- 1.8.3.1