From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 92CB0C70E for ; Fri, 31 Jul 2015 15:15:57 +0200 (CEST) Received: by wicgj17 with SMTP id gj17so17471482wic.1 for ; Fri, 31 Jul 2015 06:15:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4l8jfMW2I6S2uBAT0CZscmzwn5LMQ908ler5RQgX6oA=; b=hmsyxfgP88a0h51xxElpkichCc89b6xZNnz+xfh6s+FN+LF7irXPuK3Ei1X3g3ebt2 z5IkxnMSrzCoOHYmPA/YSnet6P9Wthep/wNH11uclmLooKEnuKgEGhBGwJNVFHAPNybm zdjrANo/cFWyWtcFHq0OlJ5c4gmYuyU/KPu8uRhyo50MlFptohOrWFKTdefn9wvztDmz +6/6QqkIsyLxF0lPtOGFPOKrcxQR7S7ITYmnxzdMcDrDQV8UdGvYz5Wcx7hD/skdE2eE IAynBZ/iOkkJ4fmBOJVPNu7JjvsH/ksbrOOoJfFO+X5lzecgB65wgzDbLlEGJJtAno9g IyMA== X-Gm-Message-State: ALoCoQkoQ6WLHPUV6fTV1kWwp1Rv3YOR0rFPOachrVp6tFoLl/cYfBtWDPSnbjhZ8MToK5fIhwfj X-Received: by 10.180.91.79 with SMTP id cc15mr6547853wib.53.1438348557293; Fri, 31 Jul 2015 06:15:57 -0700 (PDT) Received: from ping.vm.6wind.com (6wind.net2.nerim.net. [213.41.151.210]) by smtp.gmail.com with ESMTPSA id lm5sm4447988wic.22.2015.07.31.06.15.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Jul 2015 06:15:56 -0700 (PDT) From: Nelio Laranjeiro To: dev@dpdk.org Date: Fri, 31 Jul 2015 15:14:18 +0200 Message-Id: <1438348458-12291-2-git-send-email-nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438348458-12291-1-git-send-email-nelio.laranjeiro@6wind.com> References: <1438178178-5062-1-git-send-email-nelio.laranjeiro@6wind.com> <1438348458-12291-1-git-send-email-nelio.laranjeiro@6wind.com> Subject: [dpdk-dev] [PACTH v3 2/2] mlx4: fix shared library dependency 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: Fri, 31 Jul 2015 13:15:58 -0000 librte_pmd_mlx4.so needs to be linked with libibverbs otherwise, the PMD is not able to open Mellanox devices and the following message is printed by testpmd at startup "librte_pmd_mlx4: cannot access device, is mlx4_ib loaded?". Applications dependency on libibverbs are moved to be only valid in static mode, in shared mode, applications do not depend on it anymore, librte_pmd_mlx4.so keeps this dependency and thus is linked with libibverbs. MLX4 cannot be supported in combined shared library because there is no clean way of adding -libverbs to the combined library. Signed-off-by: Nelio Laranjeiro Acked-by: Olivier Matz --- Changelog: fail the compilation of the PMD when the configuration is not supported. doc/guides/nics/mlx4.rst | 5 +++++ drivers/net/mlx4/Makefile | 7 +++++++ mk/rte.app.mk | 3 +++ 3 files changed, 15 insertions(+) diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst index c33aa38..562db06 100644 --- a/doc/guides/nics/mlx4.rst +++ b/doc/guides/nics/mlx4.rst @@ -47,6 +47,11 @@ There is also a `section dedicated to this poll mode driver be enabled manually by setting ``CONFIG_RTE_LIBRTE_MLX4_PMD=y`` and recompiling DPDK. +.. warning:: + + ``CONFIG_RTE_BUILD_COMBINE_LIBS`` with ``CONFIG_RTE_BUILD_SHARED_LIB`` + is not supported and thus the compilation will fail with this configuration. + Implementation details ---------------------- diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile index 14cb53f..0399aff 100644 --- a/drivers/net/mlx4/Makefile +++ b/drivers/net/mlx4/Makefile @@ -31,6 +31,12 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) +$(info MLX4: Not supported in a combined shared library) +all: + false +endif + # Library name. LIB = librte_pmd_mlx4.a @@ -50,6 +56,7 @@ CFLAGS += -g CFLAGS += -I. CFLAGS += -D_XOPEN_SOURCE=600 CFLAGS += $(WERROR_FLAGS) +LDLIBS += -libverbs # A few warnings cannot be avoided in external headers. CFLAGS += -Wno-error=cast-qual diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 97719cb..3871205 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -100,7 +100,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n) _LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse endif +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n) _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs +endif # ! CONFIG_RTE_BUILD_SHARED_LIBS + _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz _LDLIBS-y += --start-group -- 1.9.1