From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3BA5AA0553 for ; Mon, 17 Feb 2020 18:46:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3652F1DA12; Mon, 17 Feb 2020 18:46:47 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by dpdk.org (Postfix) with ESMTP id 686301DA12 for ; Mon, 17 Feb 2020 18:46:46 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id m10so413894wmc.0 for ; Mon, 17 Feb 2020 09:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O++Z9L1IyAyn1/raBd29gmWRRXDs4qAPwJ4OhUJ2aZY=; b=LmxtnH5ksuRey0bMUdOVx0iZgrx8emvmMsQ71OdyVP/sMYGaO9iieoJryvX25XLkCf oAtWRv2Vv1mqGehmgVdwDYrspEXLGDeUa3h38K42pHwgeSOWCTyG5X8V2LsfHzH+TslG Gp2lagXRMYX+OtSTXuGZ3RN2oITvquhzsFtwtoKUwcSbNel6GmYEl0H3fUfOr/8NLAFV BUuZgJn0bntUmsbW2PZCrBZs6dek4aex2xeYFmF8OEZbgdp1dpmTX9Lg0TReLk3PiI2a Gz60lDHYgRM8yeZrT+JM0WP1Qrzp8IT01kCu+7JKH1G+aX9L/Xbbm5RuCofLSaUsWI9j vHIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O++Z9L1IyAyn1/raBd29gmWRRXDs4qAPwJ4OhUJ2aZY=; b=DmpoGCke+9ajAK0PBY/E+R5+nSmBgTZI1QVJlvCjUwkmteXf8sFv/f4gQwzMlgjmmx lXN6nvfr1G3+W0RkuGaDT1IjNQTBR8AFpsOXtVX+AGH47GjYAK11KSESGuOQUXjj2Lp/ WkxTFAVPOIzjoUQbW1Tkt2CTkuyCMfIRvGy8a3uhwJEXOZIbVwMCSUldo3MVweoQqFQE OtQ4fk3t83E/Tb4VLqo00SzUyZxCnyiNwmab/3FPlgmtx4s/zA0KlRJGksQ92jR8izCO A6HoaH0kHTEyjEEUed0xKRZS1V/YlbWmIw4R/4QzOmJMFUOhp0Gxgvs8PhsGKgSLiodz mIdg== X-Gm-Message-State: APjAAAWRlnK25ZDQ5WscrWIhRJxm0oiZPJZNewQT4paG59VvHSP8yI9n cCGsEfLZTOyTL50cwY6Wk3A= X-Google-Smtp-Source: APXvYqxV3niyurndoXgESluW4NCQf4sHzSqceZqD3YQu0Y4qlxCxuuDBU2BE04opPVr1SxMYGYnF7w== X-Received: by 2002:a05:600c:10d2:: with SMTP id l18mr167892wmd.122.1581961606061; Mon, 17 Feb 2020 09:46:46 -0800 (PST) Received: from localhost (userh634.uk.uudial.com. [194.69.103.7]) by smtp.gmail.com with ESMTPSA id x21sm173412wmi.30.2020.02.17.09.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 09:46:45 -0800 (PST) From: luca.boccassi@gmail.com To: Thomas Monjalon Cc: Bruce Richardson , dpdk stable Date: Mon, 17 Feb 2020 17:45:26 +0000 Message-Id: <20200217174546.25334-34-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200217174546.25334-1-luca.boccassi@gmail.com> References: <20200211112216.3929-190-luca.boccassi@gmail.com> <20200217174546.25334-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx: add static ibverbs linkage with meson' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From ce71a4766c74cf46f793f1c8246892152780b841 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 12 Feb 2020 23:07:04 +0100 Subject: [PATCH] net/mlx: add static ibverbs linkage with meson [ upstream commit 6affeabaf3210f52a90dd1bb96741d23256a39c6 ] The libibverbs (and libmlx4/5) can be statically embedded in the shared PMD library, or in the application with the static PMD. It was supported with make build system in commit 2c0dd7b69fb0 ("config: add static linkage of mlx dependency"). The same feature is enabled with meson when using pkg-config (i.e. only if the call to dependency() is successful). The fallback method for searching library with cc.find_library() is not supported because the dependencies of the found library would not be linked (no such info in .a file unlike .so). The main difference, in meson build system, is the generated .pc file giving arguments to link DPDK with the application. Unfortunately the .pc file will not keep memory of the static linkage option for libibverbs. Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- doc/guides/nics/mlx4.rst | 4 ++++ doc/guides/nics/mlx5.rst | 4 ++++ drivers/net/mlx4/meson.build | 5 +++-- drivers/net/mlx5/meson.build | 5 +++-- meson_options.txt | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst index d0e8a8b2ff..4b1d1aceb2 100644 --- a/doc/guides/nics/mlx4.rst +++ b/doc/guides/nics/mlx4.rst @@ -92,6 +92,10 @@ These options can be modified in the ``.config`` file. adds additional run-time checks and debugging messages at the cost of lower performance. +This option is available in meson: + +- ``ibverbs_link`` can be ``static``, ``shared``, or ``dlopen``. + Environment variables ~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index e772369213..98d53b772b 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -267,6 +267,10 @@ These options can be modified in the ``.config`` file. 64. Default armv8a configuration of make build and meson build set it to 128 then brings performance degradation. +This option is available in meson: + +- ``ibverbs_link`` can be ``static``, ``shared``, or ``dlopen``. + Environment variables ~~~~~~~~~~~~~~~~~~~~~ diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build index 4f16950a4a..a87f439f59 100644 --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build @@ -9,6 +9,7 @@ if not is_linux endif build = true +static_ibverbs = (get_option('ibverbs_link') == 'static') dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' LIB_GLUE_VERSION = '18.02.0' @@ -24,8 +25,8 @@ endif libnames = [ 'mlx4', 'ibverbs' ] libs = [] foreach libname:libnames - lib = dependency('lib' + libname, required:false) - if not lib.found() + lib = dependency('lib' + libname, static:static_ibverbs, required:false) + if not lib.found() and not static_ibverbs lib = cc.find_library(libname, required:false) endif if lib.found() diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index 1b4f6cf831..6f2a0ad5a5 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -9,6 +9,7 @@ if not is_linux endif build = true +static_ibverbs = (get_option('ibverbs_link') == 'static') dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' LIB_GLUE_VERSION = '19.08.0' @@ -24,8 +25,8 @@ endif libnames = [ 'mlx5', 'ibverbs' ] libs = [] foreach libname:libnames - lib = dependency('lib' + libname, required:false) - if not lib.found() + lib = dependency('lib' + libname, static:static_ibverbs, required:false) + if not lib.found() and not static_ibverbs lib = cc.find_library(libname, required:false) endif if lib.found() diff --git a/meson_options.txt b/meson_options.txt index bc369d06c9..0de16b4fdb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,8 +12,8 @@ option('examples', type: 'string', value: '', description: 'Comma-separated list of examples to build by default') option('flexran_sdk', type: 'string', value: '', description: 'Path to FlexRAN SDK optional Libraries for BBDEV device') -option('ibverbs_link', type: 'combo', choices : ['shared', 'dlopen'], value: 'shared', - description: 'Linkage method (shared/dlopen) for Mellanox PMDs with ibverbs dependencies.') +option('ibverbs_link', type: 'combo', choices : ['static', 'shared', 'dlopen'], value: 'shared', + description: 'Linkage method (static/shared/dlopen) for Mellanox PMDs with ibverbs dependencies.') option('include_subdir_arch', type: 'string', value: '', description: 'subdirectory where to install arch-dependent headers') option('kernel_dir', type: 'string', value: '', -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-17 17:00:16.268987682 +0000 +++ 0034-net-mlx-add-static-ibverbs-linkage-with-meson.patch 2020-02-17 17:00:15.351951079 +0000 @@ -1,8 +1,10 @@ -From 6affeabaf3210f52a90dd1bb96741d23256a39c6 Mon Sep 17 00:00:00 2001 +From ce71a4766c74cf46f793f1c8246892152780b841 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 12 Feb 2020 23:07:04 +0100 Subject: [PATCH] net/mlx: add static ibverbs linkage with meson +[ upstream commit 6affeabaf3210f52a90dd1bb96741d23256a39c6 ] + The libibverbs (and libmlx4/5) can be statically embedded in the shared PMD library, or in the application with the static PMD. It was supported with make build system in @@ -22,11 +24,11 @@ Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- - doc/guides/nics/mlx4.rst | 4 ++++ - doc/guides/nics/mlx5.rst | 4 ++++ - drivers/common/mlx5/meson.build | 5 +++-- - drivers/net/mlx4/meson.build | 5 +++-- - meson_options.txt | 4 ++-- + doc/guides/nics/mlx4.rst | 4 ++++ + doc/guides/nics/mlx5.rst | 4 ++++ + drivers/net/mlx4/meson.build | 5 +++-- + drivers/net/mlx5/meson.build | 5 +++-- + meson_options.txt | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doc/guides/nics/mlx4.rst b/doc/guides/nics/mlx4.rst @@ -45,10 +47,10 @@ ~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst -index 2ea4fa9546..5ab7c07165 100644 +index e772369213..98d53b772b 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst -@@ -275,6 +275,10 @@ These options can be modified in the ``.config`` file. +@@ -267,6 +267,10 @@ These options can be modified in the ``.config`` file. 64. Default armv8a configuration of make build and meson build set it to 128 then brings performance degradation. @@ -59,20 +61,20 @@ Environment variables ~~~~~~~~~~~~~~~~~~~~~ -diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build -index c6d4154cd0..206ef75ca2 100644 ---- a/drivers/common/mlx5/meson.build -+++ b/drivers/common/mlx5/meson.build -@@ -7,6 +7,7 @@ if not is_linux - subdir_done() +diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build +index 4f16950a4a..a87f439f59 100644 +--- a/drivers/net/mlx4/meson.build ++++ b/drivers/net/mlx4/meson.build +@@ -9,6 +9,7 @@ if not is_linux endif + build = true +static_ibverbs = (get_option('ibverbs_link') == 'static') - pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') - LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' - LIB_GLUE_VERSION = '20.02.0' -@@ -22,8 +23,8 @@ endif - libnames = [ 'mlx5', 'ibverbs' ] + dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') + LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' + LIB_GLUE_VERSION = '18.02.0' +@@ -24,8 +25,8 @@ endif + libnames = [ 'mlx4', 'ibverbs' ] libs = [] foreach libname:libnames - lib = dependency('lib' + libname, required:false) @@ -82,20 +84,20 @@ lib = cc.find_library(libname, required:false) endif if lib.found() -diff --git a/drivers/net/mlx4/meson.build b/drivers/net/mlx4/meson.build -index 6d2397b3cc..7513516764 100644 ---- a/drivers/net/mlx4/meson.build -+++ b/drivers/net/mlx4/meson.build -@@ -8,6 +8,7 @@ if not is_linux - subdir_done() +diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build +index 1b4f6cf831..6f2a0ad5a5 100644 +--- a/drivers/net/mlx5/meson.build ++++ b/drivers/net/mlx5/meson.build +@@ -9,6 +9,7 @@ if not is_linux endif + build = true +static_ibverbs = (get_option('ibverbs_link') == 'static') - pmd_dlopen = (get_option('ibverbs_link') == 'dlopen') - LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' - LIB_GLUE_VERSION = '18.02.0' -@@ -23,8 +24,8 @@ endif - libnames = [ 'mlx4', 'ibverbs' ] + dlopen_ibverbs = (get_option('ibverbs_link') == 'dlopen') + LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' + LIB_GLUE_VERSION = '19.08.0' +@@ -24,8 +25,8 @@ endif + libnames = [ 'mlx5', 'ibverbs' ] libs = [] foreach libname:libnames - lib = dependency('lib' + libname, required:false) @@ -106,10 +108,10 @@ endif if lib.found() diff --git a/meson_options.txt b/meson_options.txt -index 20be15fe6b..9e4923a4f1 100644 +index bc369d06c9..0de16b4fdb 100644 --- a/meson_options.txt +++ b/meson_options.txt -@@ -14,8 +14,8 @@ option('examples', type: 'string', value: '', +@@ -12,8 +12,8 @@ option('examples', type: 'string', value: '', description: 'Comma-separated list of examples to build by default') option('flexran_sdk', type: 'string', value: '', description: 'Path to FlexRAN SDK optional Libraries for BBDEV device')