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 8B31EAFDC for ; Mon, 21 Apr 2014 17:00:16 +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 1WcFhc-0007dA-VB; Mon, 21 Apr 2014 11:00:17 -0400 From: Neil Horman To: dev@dpdk.org Date: Mon, 21 Apr 2014 10:59:30 -0400 Message-Id: <1398092379-7679-6-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 05/14] xenvirt: 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:16 -0000 convert the xenvirt driver to use the PMD_REGISTER_DRIVER macro. This means that the test applications now have no reference to the xenvirt 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. A few notes: xenvirt was unbuildable as of commit 4c39baf297d10c217e7d3e7370f26a1fede58308.. That commit neglected to include the rte_vdev.h header, so several structs were left undefined. This patch includes a fix for that as well. Also, The linkage for xenvirt is broken in much the same way pmd_ring was, in that the xenvirt pmd has a function that is called directly from applications (the example being the testpmd application). The function is rte_mempool_gntalloc_create, and should clearly be moved into the rte_mempool library, with the supporting code in the function implementation moved to a new xenvirt library separate from the pmd. This is a large undertaking that detracts from the purpose of this series however, and so for now, I'm leaving the linkage to the application in place, and will address this issue in a later series Signed-off-by: Neil Horman --- lib/librte_pmd_xenvirt/rte_eth_xenvirt.c | 8 ++------ mk/rte.app.mk | 7 +++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c index 533aa76..ecafe7a 100644 --- a/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c +++ b/lib/librte_pmd_xenvirt/rte_eth_xenvirt.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -710,9 +711,4 @@ static struct rte_vdev_driver pmd_xenvirt_drv = { .init = rte_pmd_xenvirt_devinit, }; -__attribute__((constructor)) -static void -rte_pmd_xenvirt_init(void) -{ - rte_eal_vdev_driver_register(&pmd_xenvirt_drv); -} +PMD_REGISTER_DRIVER(pmd_xenvirt_drv, PMD_VDEV); diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 16edbce..aabe75e 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -158,16 +158,15 @@ ifeq ($(CONFIG_RTE_LIBRTE_EAL),y) LDLIBS += -lrte_eal endif +ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) +LDLIBS += -lrte_cmdline +endif ifeq ($(CONFIG_RTE_LIBRTE_PMD_XENVIRT),y) LDLIBS += -lrte_pmd_xenvirt LDLIBS += -lxenstore endif -ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y) -LDLIBS += -lrte_cmdline -endif - ifeq ($(RTE_BUILD_SHARED_LIB),n) ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y) -- 1.8.3.1