From patchwork Wed Apr 8 00:08:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 67922 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 452DFA058B; Wed, 8 Apr 2020 02:09:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9B5D21BFBA; Wed, 8 Apr 2020 02:09:13 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id A60D91BF26 for ; Wed, 8 Apr 2020 02:09:11 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4781A5C01AC; Tue, 7 Apr 2020 20:09:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 Apr 2020 20:09:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=s5jROJ8vMA COiZTnkKHoqsDPq85Chd9b4i048gkGJTY=; b=nWfWoGpZvUEwLmtPK4v8TTtsmi Bo4zVj0ZdEQcMmcX0Q6hx7TdpUWk2UQSgFBGVWcJgTtww+RV7r98uuoF/yVqCupW SlyoAWV61vdrQl0M0nGvbHqV4Q5V0YBnU4tkPVemPbelXf5HEx+QHYe3Q+rjyE0G MDfykLqLvnz4c4aww= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=s5jROJ8vMACOiZTnkKHoqsDPq85Chd9b4i048gkGJTY=; b=CAptYb9J e3coPW2yiGpOib6UYlsCO4QYiE8XM4D8zURXv+iGyEDp+OoTfn2Te/J3H1Y7YG8N v9XrGAH+bgupO1HVSP4BmvKaYFYrkd422+Q3CiM8T10p3atD0XZbx0a8J8QxcGyZ fPOYBIzBE+asYnCqRwLyAP0u2U8qEGks+co5k7TOYemgJD50ioWmbVjxVUIEblqz kKJ3/4ao+P+atJEDx5a/hdkt7o1RvKWeMIMKsYXWwWPFPYCoaciTIF+V5YBox6na atclk9vC20qSfDAoAvhOavZsaTPX++8oVzs02WXqdZtWUpvMRvkg5HKQXBh7Bh/Q TF8gjTYRim1/RQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeigdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5F121306D613; Tue, 7 Apr 2020 20:09:10 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 8 Apr 2020 02:08:58 +0200 Message-Id: <20200408000900.61896-2-thomas@monjalon.net> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200408000900.61896-1-thomas@monjalon.net> References: <20200210103216.1168439-1-thomas@monjalon.net> <20200408000900.61896-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 1/3] common/mlx5: split glue initialization 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The function mlx5_glue_init was doing three things: - initialize logs - load glue library if in dlopen mode - initialize glue layer They are split in three functions for clarity. The config option RTE_IBVERBS_LINK_DLOPEN is not used anymore outside of make and meson files. It is replaced with MLX5_GLUE, which is defined in the same condition and is already used with dlopen. Signed-off-by: Thomas Monjalon Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_common.c | 79 ++++++++++++++++++------------- 1 file changed, 47 insertions(+), 32 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index 9ea56f2ef2..d8c01a5d14 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -162,7 +162,7 @@ mlx5_translate_port_name(const char *port_name_in, return; } -#ifdef RTE_IBVERBS_LINK_DLOPEN +#ifdef MLX5_GLUE /** * Suffix RTE_EAL_PMD_PATH with "-glue". @@ -204,34 +204,10 @@ mlx5_glue_path(char *buf, size_t size) " re-configure DPDK"); return NULL; } -#endif -/** - * Initialization routine for run-time dependency on rdma-core. - */ -RTE_INIT_PRIO(mlx5_glue_init, CLASS) +static int +mlx5_glue_dlopen(void) { - /* Initialize common log type. */ - mlx5_common_logtype = rte_log_register("pmd.common.mlx5"); - if (mlx5_common_logtype >= 0) - rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE); - /* - * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use - * huge pages. Calling ibv_fork_init() during init allows - * applications to use fork() safely for purposes other than - * using this PMD, which is not supported in forked processes. - */ - setenv("RDMAV_HUGEPAGES_SAFE", "1", 1); - /* Match the size of Rx completion entry to the size of a cacheline. */ - if (RTE_CACHE_LINE_SIZE == 128) - setenv("MLX5_CQE_SIZE", "128", 0); - /* - * MLX5_DEVICE_FATAL_CLEANUP tells ibv_destroy functions to - * cleanup all the Verbs resources even when the device was removed. - */ - setenv("MLX5_DEVICE_FATAL_CLEANUP", "1", 1); - /* The glue initialization was done earlier by mlx5 common library. */ -#ifdef RTE_IBVERBS_LINK_DLOPEN char glue_path[sizeof(RTE_EAL_PMD_PATH) - 1 + sizeof("-glue")]; void *handle = NULL; @@ -303,7 +279,49 @@ RTE_INIT_PRIO(mlx5_glue_init, CLASS) goto glue_error; } mlx5_glue = *sym; -#endif /* RTE_IBVERBS_LINK_DLOPEN */ + return 0; + +glue_error: + if (handle) + dlclose(handle); + return -1; +} + +#endif + +RTE_INIT_PRIO(mlx5_log_init, LOG) +{ + mlx5_common_logtype = rte_log_register("pmd.common.mlx5"); + if (mlx5_common_logtype >= 0) + rte_log_set_level(mlx5_common_logtype, RTE_LOG_NOTICE); +} + +/** + * Initialization routine for run-time dependency on rdma-core. + */ +RTE_INIT_PRIO(mlx5_glue_init, CLASS) +{ + /* + * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use + * huge pages. Calling ibv_fork_init() during init allows + * applications to use fork() safely for purposes other than + * using this PMD, which is not supported in forked processes. + */ + setenv("RDMAV_HUGEPAGES_SAFE", "1", 1); + /* Match the size of Rx completion entry to the size of a cacheline. */ + if (RTE_CACHE_LINE_SIZE == 128) + setenv("MLX5_CQE_SIZE", "128", 0); + /* + * MLX5_DEVICE_FATAL_CLEANUP tells ibv_destroy functions to + * cleanup all the Verbs resources even when the device was removed. + */ + setenv("MLX5_DEVICE_FATAL_CLEANUP", "1", 1); + +#ifdef MLX5_GLUE + if (mlx5_glue_dlopen() != 0) + goto glue_error; +#endif + #ifdef RTE_LIBRTE_MLX5_DEBUG /* Glue structure must not contain any NULL pointers. */ { @@ -321,11 +339,8 @@ RTE_INIT_PRIO(mlx5_glue_init, CLASS) } mlx5_glue->fork_init(); return; + glue_error: -#ifdef RTE_IBVERBS_LINK_DLOPEN - if (handle) - dlclose(handle); -#endif DRV_LOG(WARNING, "Cannot initialize MLX5 common due to missing" " run-time dependency on rdma-core libraries (libibverbs," " libmlx5)"); From patchwork Wed Apr 8 00:08:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 67923 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98E24A058B; Wed, 8 Apr 2020 02:09:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 229B81C021; Wed, 8 Apr 2020 02:09:17 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 5EB0B1BF59; Wed, 8 Apr 2020 02:09:13 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 131955C01AE; Tue, 7 Apr 2020 20:09:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 Apr 2020 20:09:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=PEGC7hqX8o A9B8OgU/eVIuQY/RKm4BShPCl7bk+fK3U=; b=Jjhrmv+6gXFnZ0+rtby8zHkmdy 0mdhn9pZcKQjJAqKuJ+PUDx9QCS1mnDq5MLH+amnDRfH0wh/H3imUX+/K8R2nLdL DtFiRuuhHBkAPAFvt9HyBRJcbn0Y8i4IO/uYOq0ndo9mV0HW8aIOaSGc5lA9PoBW R1WgM41r0B0HIr+ls= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=PEGC7hqX8oA9B8OgU/eVIuQY/RKm4BShPCl7bk+fK3U=; b=eKzSQr+W q1S0KoLXDSGdCrKehWIiiUtsYt3eRcQNFtFoeDaKPfFxvqqiXI6doJjT5OFa9O+1 B0u9/sS0D1/who8bRcme7Pk0AlLg3XsNDi7R+DtVadwReMuwVtrh7tf/Ezrr3QzD Z2ca4qqE2jreiS43AJUbrilpoB3sTYykYPl3I0uUJ2HAPAI+4mg4KwcXcS/KUQv9 hOrak7lflONSe22m+V1Z5+d0vHA9VBXzTaPh6udCDpVb7v7RJ/yxqQxIYJiQ3iL5 zI6jOTAxEsiucA/3nH1xwz26sAjTSCfyHx7igRpzZj0QSptLXWo8aeLvbmIVEZDN KnpjiaLjvCIwCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeigdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 27AE4306D631; Tue, 7 Apr 2020 20:09:12 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org, Matan Azrad , Shahaf Shuler , Viacheslav Ovsiienko Date: Wed, 8 Apr 2020 02:08:59 +0200 Message-Id: <20200408000900.61896-3-thomas@monjalon.net> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200408000900.61896-1-thomas@monjalon.net> References: <20200210103216.1168439-1-thomas@monjalon.net> <20200408000900.61896-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 2/3] common/mlx5: fix build with -fno-common 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The variable storages of the same name are merged together if compiled with -fcommon. This is the default. This default behaviour allows to declare a variable in a header file and share the variable in every .o binaries thanks to merge at link-time. In the case of dlopen linking of the glue library, the pointer mlx5_glue is referencing the glue functions struct and is set after calling dlopen. If compiling with -fno-common (default in GCC 10), the variable must be declared as extern to avoid multiple re-definitions. In case the glue layer is split in glue library, the variable mlx5_glue needs to have its own storage for the rest of the PMD. Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Matan Azrad --- drivers/common/mlx5/mlx5_common.c | 3 +++ drivers/common/mlx5/mlx5_glue.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index d8c01a5d14..42610459f7 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -18,6 +18,9 @@ int mlx5_common_logtype; +#ifdef MLX5_GLUE +const struct mlx5_glue *mlx5_glue; +#endif /** * Get PCI information by sysfs device path. diff --git a/drivers/common/mlx5/mlx5_glue.h b/drivers/common/mlx5/mlx5_glue.h index 6238b43946..29678623e4 100644 --- a/drivers/common/mlx5/mlx5_glue.h +++ b/drivers/common/mlx5/mlx5_glue.h @@ -300,6 +300,6 @@ struct mlx5_glue { size_t event_resp_len); }; -const struct mlx5_glue *mlx5_glue; +extern const struct mlx5_glue *mlx5_glue; #endif /* MLX5_GLUE_H_ */ From patchwork Wed Apr 8 00:09:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 67924 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EBB60A058B; Wed, 8 Apr 2020 02:09:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D25A1C02D; Wed, 8 Apr 2020 02:09:18 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 4383F1C01F; Wed, 8 Apr 2020 02:09:15 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EBE885C0112; Tue, 7 Apr 2020 20:09:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 07 Apr 2020 20:09:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=+n4laSwYoV 2HSUg1Uzug9SZjGhBaknP+mKAkXEt13R8=; b=DpVD4evG09CGFJ7JJKLrkJIWsO a19Rve15J5sJPmWYe3mtnHPyZly1xxL6ABQ3SRw9HCZFZ6/276sO2c0egjqaFVNy iCqOKYBI/vrkbrzOF0PhaE+K2cXTLKGz2S0IL0X+rUlwhRPiLcezfosFvYEW/Pxa jE2A0hblCN0K19pTc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=+n4laSwYoV2HSUg1Uzug9SZjGhBaknP+mKAkXEt13R8=; b=ra9eOtz8 ErWi44kIW9ECQbVmpWseT1ojZc6wfc8S6pEuC4mf0VWeylZTQgh6QUfyMulwS8WE dq3AcZO0+gjxqS8xLTyji7pFakXF03Mvq0XA3B4E7BGWMeKvpEMrbNcTrsvrv1y6 NWxl+xkJFOHvTb3BHEUH/K8wMg4pdg3dFH/RbiLcETtZZajq2YJQZfO4xRBfk/sF LYXzvlI11TNl7TA/4DBdCXU3YXuusEyLWpuZxD9Ye/UeVZz7Fc5K0ux+b3DM7wvl 2UD3YcytXo8fNmhosXTDJwlnl6VcDYRlFMkC/4ZitbD4KrBEz5SB0WanIzeWVmj+ +0cFVUR88KjhtQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeigdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 21FB4306D622; Tue, 7 Apr 2020 20:09:14 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org, Matan Azrad , Shahaf Shuler Date: Wed, 8 Apr 2020 02:09:00 +0200 Message-Id: <20200408000900.61896-4-thomas@monjalon.net> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200408000900.61896-1-thomas@monjalon.net> References: <20200210103216.1168439-1-thomas@monjalon.net> <20200408000900.61896-1-thomas@monjalon.net> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 3/3] net/mlx4: fix build with -fno-common 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The variable storages of the same name are merged together if compiled with -fcommon. This is the default. This default behaviour allows to declare a variable in a header file and share the variable in every .o binaries thanks to merge at link-time. In the case of dlopen linking of the glue library, the pointer mlx4_glue is referencing the glue functions struct and is set after calling dlopen. If compiling with -fno-common (default in GCC 10), the variables must be declared as extern to avoid multiple re-definitions. In case the glue layer is split in glue library, the variable mlx4_glue needs to have its own storage for the rest of the PMD. Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon Acked-by: Matan Azrad --- drivers/net/mlx4/mlx4.c | 4 ++++ drivers/net/mlx4/mlx4_glue.h | 2 +- drivers/net/mlx4/mlx4_rxtx.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 8e298788af..5d7202720b 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -49,6 +49,10 @@ #include "mlx4_rxtx.h" #include "mlx4_utils.h" +#ifdef MLX4_GLUE +const struct mlx4_glue *mlx4_glue; +#endif + static const char *MZ_MLX4_PMD_SHARED_DATA = "mlx4_pmd_shared_data"; /* Shared memory between primary and secondary processes. */ diff --git a/drivers/net/mlx4/mlx4_glue.h b/drivers/net/mlx4/mlx4_glue.h index 668ca86700..5d9e985495 100644 --- a/drivers/net/mlx4/mlx4_glue.h +++ b/drivers/net/mlx4/mlx4_glue.h @@ -84,6 +84,6 @@ struct mlx4_glue { void *attr); }; -const struct mlx4_glue *mlx4_glue; +extern const struct mlx4_glue *mlx4_glue; #endif /* MLX4_GLUE_H_ */ diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h index 8baf33fa94..9de6c59411 100644 --- a/drivers/net/mlx4/mlx4_rxtx.h +++ b/drivers/net/mlx4/mlx4_rxtx.h @@ -124,7 +124,7 @@ struct txq { /* mlx4_rxq.c */ -uint8_t mlx4_rss_hash_key_default[MLX4_RSS_HASH_KEY_SIZE]; +extern uint8_t mlx4_rss_hash_key_default[MLX4_RSS_HASH_KEY_SIZE]; int mlx4_rss_init(struct mlx4_priv *priv); void mlx4_rss_deinit(struct mlx4_priv *priv); struct mlx4_rss *mlx4_rss_get(struct mlx4_priv *priv, uint64_t fields,