From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 801434C77 for ; Thu, 1 Mar 2018 13:43:22 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id v65so5950121wrc.11 for ; Thu, 01 Mar 2018 04:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=qDwIAQMOpXJV3XbHxkfbKAFZ2hyOeSA8zJ1jeiX5lUA=; b=qY4jAoadKX1BV5uLaqe+OBeegNhuIFl1b4W15x26VK3cnAIIXWXB2DclG1s2plJ7xn ng4bOa2E17IDn5bV9tYpa351uEik8QdIJNlfX/93eDkAxf6hC5i28WzJ60b9zfDaZEXQ +tcS7GMvf0QxTNkrXj3aRvIJir+UzG+elF5UCEHLd2KBINjPqcKCP/b4mKXLlkEh78aM uqYdwmIXAhqOPb+NvmZ6ZrKaDhUCDGf2EMWOS3hXTveL1/m2EnN2kuauEGmdokmmGicU XWlYftwMLjiUxLL7bhCVLXiJUclEdNmrwbyResQHqsBBodUqlcGuQfre46zxAp41zdHw PrWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=qDwIAQMOpXJV3XbHxkfbKAFZ2hyOeSA8zJ1jeiX5lUA=; b=YMQ8IC+m2+Qm+P2ADkHHc00R0miDgI+Jdtnkx/DO1n05gqWdnP9xy0J6jMeOsmOt75 5YDmaeJ3Ags/dSJ/0+tbvYvzX3NPtSu7zln5d6JCD1oLpjrF5j7LQCEn4osgrWgMyJ6T XV8NwwcU8nxl4YCT57lW4VGRFIQqXhOoUeWtvtfXbNV0rsw6Qe+IUIXRd48T2R0N/RMC 3JWju/YdH52ZAmCevR5p0sR165ZpMJxQTEzQqb766wtDWnbWKsm41VY2FQw/Om5F595p BqrMhYGkskrUWh1fAYEkdPDYRVTiWS7s7NMs8bQ0G4FxdJeTjYPE4FjXXVCsieO7KZnw qiag== X-Gm-Message-State: APf1xPChgA2SLNZQiMXKFoDG49ozRi8Hw/Y+T+FqHI7P2DtV7ZkMt0Ku HOIWVswzKpqTOlP/zxABf/RhVg== X-Google-Smtp-Source: AG47ELs8Cav4VVjhi36xrApnUUWlqDqk09nWLi8CyBxTxzFQ17KWh2dJ80NLZTzWI2fhIuG52uSuGA== X-Received: by 10.223.144.2 with SMTP id h2mr1582742wrh.114.1519908202104; Thu, 01 Mar 2018 04:43:22 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 59sm3442880wro.57.2018.03.01.04.43.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 04:43:21 -0800 (PST) Date: Thu, 1 Mar 2018 13:43:08 +0100 From: Adrien Mazarguil To: Shahaf Shuler Cc: dev@dpdk.org, stable@dpdk.org, Timothy Redaelli Message-ID: <20180301124129.9606-1-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] net/mlx: fix rdma-core glue path with EAL plugins 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: , X-List-Received-Date: Thu, 01 Mar 2018 12:43:22 -0000 Glue object files are looked up in RTE_EAL_PMD_PATH by default when set and should be installed in this directory. During startup, EAL attempts to load them automatically like other plug-ins found in this directory. While normally harmless, dlopen() fails when rdma-core is not installed, EAL interprets this as a fatal error and terminates the application. This patch requests glue objects to be installed into a sub-directory of RTE_EAL_PMD_PATH to prevent their automatic loading. Fixes: f6242d0655cd ("net/mlx: make rdma-core glue path configurable") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil Cc: Timothy Redaelli --- doc/guides/nics/mlx4.rst | 7 ++++--- doc/guides/nics/mlx5.rst | 7 ++++--- drivers/net/mlx4/mlx4.c | 3 ++- drivers/net/mlx5/mlx5.c | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst index 98b971667..602a5e257 100644 --- a/doc/guides/nics/mlx4.rst +++ b/doc/guides/nics/mlx4.rst @@ -98,9 +98,10 @@ These options can be modified in the ``.config`` file. missing with ``ldd(1)``. It works by moving these dependencies to a purpose-built rdma-core "glue" - plug-in, which must either be installed in ``CONFIG_RTE_EAL_PMD_PATH`` if - set, or in a standard location for the dynamic linker (e.g. ``/lib``) if - left to the default empty string (``""``). + plug-in, which must either be installed in the ``glue`` sub-directory of + ``CONFIG_RTE_EAL_PMD_PATH`` if set, or in a standard location for the + dynamic linker (e.g. ``/lib``) if left to the default empty string + (``""``). This option has no performance impact. diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 0e6e525c9..ad96d66f2 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -171,9 +171,10 @@ These options can be modified in the ``.config`` file. missing with ``ldd(1)``. It works by moving these dependencies to a purpose-built rdma-core "glue" - plug-in, which must either be installed in ``CONFIG_RTE_EAL_PMD_PATH`` if - set, or in a standard location for the dynamic linker (e.g. ``/lib``) if - left to the default empty string (``""``). + plug-in, which must either be installed in the ``glue`` sub-directory of + ``CONFIG_RTE_EAL_PMD_PATH`` if set, or in a standard location for the + dynamic linker (e.g. ``/lib``) if left to the default empty string + (``""``). This option has no performance impact. diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index ee93dafe6..cfa2533ed 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -720,7 +720,8 @@ mlx4_glue_init(void) */ (geteuid() == getuid() && getegid() == getgid() ? getenv("MLX4_GLUE_PATH") : NULL), - RTE_EAL_PMD_PATH, + /* Use glue sub-directory when RTE_EAL_PMD_PATH is set. */ + *RTE_EAL_PMD_PATH ? RTE_EAL_PMD_PATH "/glue" : "", }; unsigned int i = 0; void *handle = NULL; diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 61cb93101..22275be80 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1055,7 +1055,8 @@ mlx5_glue_init(void) */ (geteuid() == getuid() && getegid() == getgid() ? getenv("MLX5_GLUE_PATH") : NULL), - RTE_EAL_PMD_PATH, + /* Use glue sub-directory when RTE_EAL_PMD_PATH is set. */ + *RTE_EAL_PMD_PATH ? RTE_EAL_PMD_PATH "/glue" : "", }; unsigned int i = 0; void *handle = NULL; -- 2.11.0