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 D9F156968 for ; Thu, 10 Apr 2014 22:49:22 +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 1WYLw1-0004PD-Lb; Thu, 10 Apr 2014 16:50:59 -0400 From: Neil Horman To: dev@dpdk.org Date: Thu, 10 Apr 2014 16:50:01 -0400 Message-Id: <1397163009-29950-11-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1397163009-29950-1-git-send-email-nhorman@tuxdriver.com> References: <1397162846-28912-1-git-send-email-nhorman@tuxdriver.com> <1397163009-29950-1-git-send-email-nhorman@tuxdriver.com> X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: Neil Horman Subject: [dpdk-dev] [PATCH 11/19] pmd: Move rte_pmd_init_all to be non-inline 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: Thu, 10 Apr 2014 20:49:23 -0000 Organizational change in support of doing dynamic init routine registration Signed-off-by: Neil Horman --- lib/librte_ether/rte_ethdev.c | 52 ++++++++++++++++++++++++++++++++++++++++++ lib/librte_ether/rte_ethdev.h | 53 +------------------------------------------ 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index a5727dd..dd378f0 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -112,6 +112,58 @@ static uint8_t nb_ports = 0; /* spinlock for eth device callbacks */ static rte_spinlock_t rte_eth_dev_cb_lock = RTE_SPINLOCK_INITIALIZER; +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); + } +#endif /* RTE_LIBRTE_IGB_PMD */ + +#ifdef RTE_LIBRTE_EM_PMD + if ((ret = rte_em_pmd_init()) != 0) { + RTE_LOG(ERR, PMD, "Cannot init em PMD\n"); + return (ret); + } +#endif /* RTE_LIBRTE_EM_PMD */ + +#ifdef RTE_LIBRTE_IXGBE_PMD + if ((ret = rte_ixgbe_pmd_init()) != 0) { + RTE_LOG(ERR, PMD, "Cannot init ixgbe PMD\n"); + return (ret); + } + if ((ret = rte_ixgbevf_pmd_init()) != 0) { + RTE_LOG(ERR, PMD, "Cannot init ixgbevf PMD\n"); + return (ret); + } +#endif /* RTE_LIBRTE_IXGBE_PMD */ + +#ifdef RTE_LIBRTE_VIRTIO_PMD + if ((ret = rte_virtio_pmd_init()) != 0) { + RTE_LOG(ERR, PMD, "Cannot init virtio PMD\n"); + return (ret); + } +#endif /* RTE_LIBRTE_VIRTIO_PMD */ + +#ifdef RTE_LIBRTE_VMXNET3_PMD + if ((ret = rte_vmxnet3_pmd_init()) != 0) { + RTE_LOG(ERR, PMD, "Cannot init vmxnet3 PMD\n"); + return (ret); + } +#endif /* RTE_LIBRTE_VMXNET3_PMD */ + + if (ret == -ENODEV) + RTE_LOG(ERR, PMD, "No PMD(s) are configured\n"); + return (ret); +} + /** * The user application callback description. * diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index dea7471..bf2ded4 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1396,58 +1396,7 @@ extern int rte_vmxnet3_pmd_init(void); * -ENODEV if there are no drivers available * (e.g. if all driver config options are = n). */ -static inline -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); - } -#endif /* RTE_LIBRTE_IGB_PMD */ - -#ifdef RTE_LIBRTE_EM_PMD - if ((ret = rte_em_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init em PMD\n"); - return (ret); - } -#endif /* RTE_LIBRTE_EM_PMD */ - -#ifdef RTE_LIBRTE_IXGBE_PMD - if ((ret = rte_ixgbe_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init ixgbe PMD\n"); - return (ret); - } - if ((ret = rte_ixgbevf_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init ixgbevf PMD\n"); - return (ret); - } -#endif /* RTE_LIBRTE_IXGBE_PMD */ - -#ifdef RTE_LIBRTE_VIRTIO_PMD - if ((ret = rte_virtio_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init virtio PMD\n"); - return (ret); - } -#endif /* RTE_LIBRTE_VIRTIO_PMD */ - -#ifdef RTE_LIBRTE_VMXNET3_PMD - if ((ret = rte_vmxnet3_pmd_init()) != 0) { - RTE_LOG(ERR, PMD, "Cannot init vmxnet3 PMD\n"); - return (ret); - } -#endif /* RTE_LIBRTE_VMXNET3_PMD */ - - if (ret == -ENODEV) - RTE_LOG(ERR, PMD, "No PMD(s) are configured\n"); - return (ret); -} +extern int rte_pmd_init_all(void); /** * Configure an Ethernet device. -- 1.8.3.1