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 03A8DA0093 for ; Tue, 19 May 2020 15:10:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDAAC1D6A4; Tue, 19 May 2020 15:10:00 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 2FBB71D6D4 for ; Tue, 19 May 2020 15:09:59 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id j5so15896752wrq.2 for ; Tue, 19 May 2020 06:09:59 -0700 (PDT) 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=Kj7Dx5MYCzlLQQoiFKxPRHoXDrvWdUDVKHURTe65Ob0=; b=FMMdP+ykuT/rrVtfKFgHZssfuYFA4bOfhmclzwuiZrEVq34BnMV4KUDmCgoWDr3DSm MZD2wsrSSbIZ6kqaWFZLUzo9ZKSvB8F6OHXSX55X1BTavQZQAEsk2yCIbbajIhQ/AjzO FJwbdi+BKjynMNK34H5EFc8SRHsZuby2nUsuPGRJ1hLpOVqSY3AHAm+67B5vv4+MwaR9 WbnfVNxGlPInOjqOb/9liwg8fzCwuY4PmIfN0vmTRgD+mtn2hkKxjZQCDu4/sfr04N8J 2tZoG+Kg7NUfp8luW4+jmZ5A/eBwAzs6ivSb6pYyL3/IBR/T7Sgq72TLh3X8GRzOiHTn 4rYg== 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=Kj7Dx5MYCzlLQQoiFKxPRHoXDrvWdUDVKHURTe65Ob0=; b=WNiyfo1o3mrXb4rzpL7waSxjB80SFhIq/AyJfN1LzoSE50vmEQUDChOxDpZk4J7rPc RtxFFKVcdi9IMz/dEQxwPeBq3+4Ydu6VXr38nfI16d19wQzoZVgmq3ZkFin/T+yz4OQU NWZU4BqU0aoKxVOZ/6D1FJxmc05SVP+lxtNZrFqufLQEy06fcFSBh/+5pzPa/Zj5SHje A+JNKlGhaRXYM6R1IRwLLJW98hTqRZoJdDSzNPVOMDR5DxetAk6rUwtyTmyLXKxxhQOO NJo5EjGkBbeOPwf/6XGuY5rJxGs7DNH6Y/Qhh7BeTX7MRrr0vJJ5PUW8IJrD5G1xh916 5tRA== X-Gm-Message-State: AOAM533P/c8xXXwQQe2Z68ZNfdjVmkqOOJPOHQ2rQtkpKiVjapQS2SzG C6O0gGec9S3x8DTrElDJiuA= X-Google-Smtp-Source: ABdhPJz//N2xKWnPAo5gH5Of5jPDUA5tLhUauc6OIX91nv0wtexMaBUPI2Dn318493MGOY31s/IXvQ== X-Received: by 2002:a5d:4e4d:: with SMTP id r13mr25767210wrt.122.1589893798933; Tue, 19 May 2020 06:09:58 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q5sm22248655wra.36.2020.05.19.06.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:09:58 -0700 (PDT) From: luca.boccassi@gmail.com To: Thomas Monjalon Cc: Matan Azrad , dpdk stable Date: Tue, 19 May 2020 14:03:34 +0100 Message-Id: <20200519130549.112823-79-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'common/mlx5: fix build with -fno-common' has been queued to stable release 19.11.3 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.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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 b3e01cd3e46fde2a6872b5b058890ac403701504 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 8 Apr 2020 02:08:59 +0200 Subject: [PATCH] common/mlx5: fix build with -fno-common [ upstream commit 2889d38256906a5cbff717e7e524ec645c89c794 ] 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. Signed-off-by: Thomas Monjalon Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_glue.c | 4 ++++ drivers/net/mlx5/mlx5_glue.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c index 0917bf28d6..c5880dd6f2 100644 --- a/drivers/net/mlx5/mlx5_glue.c +++ b/drivers/net/mlx5/mlx5_glue.c @@ -30,6 +30,10 @@ #include "mlx5_autoconf.h" #include "mlx5_glue.h" +#ifdef MLX5_GLUE +const struct mlx5_glue *mlx5_glue; +#endif + static int mlx5_glue_fork_init(void) { diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index 6442f1eba8..4e6465523a 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -258,6 +258,6 @@ struct mlx5_glue { struct mlx5dv_devx_port *mlx5_devx_port); }; -const struct mlx5_glue *mlx5_glue; +extern const struct mlx5_glue *mlx5_glue; #endif /* MLX5_GLUE_H_ */ -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:47.681096737 +0100 +++ 0079-common-mlx5-fix-build-with-fno-common.patch 2020-05-19 14:04:44.248648953 +0100 @@ -1,8 +1,10 @@ -From 2889d38256906a5cbff717e7e524ec645c89c794 Mon Sep 17 00:00:00 2001 +From b3e01cd3e46fde2a6872b5b058890ac403701504 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 8 Apr 2020 02:08:59 +0200 Subject: [PATCH] common/mlx5: fix build with -fno-common +[ upstream commit 2889d38256906a5cbff717e7e524ec645c89c794 ] + 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 @@ -17,35 +19,34 @@ 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; + drivers/net/mlx5/mlx5_glue.c | 4 ++++ + drivers/net/mlx5/mlx5_glue.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c +index 0917bf28d6..c5880dd6f2 100644 +--- a/drivers/net/mlx5/mlx5_glue.c ++++ b/drivers/net/mlx5/mlx5_glue.c +@@ -30,6 +30,10 @@ + #include "mlx5_autoconf.h" + #include "mlx5_glue.h" +#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 cd1136f382..184c41071e 100644 ---- a/drivers/common/mlx5/mlx5_glue.h -+++ b/drivers/common/mlx5/mlx5_glue.h -@@ -304,6 +304,6 @@ struct mlx5_glue { - size_t event_resp_len); ++ + static int + mlx5_glue_fork_init(void) + { +diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h +index 6442f1eba8..4e6465523a 100644 +--- a/drivers/net/mlx5/mlx5_glue.h ++++ b/drivers/net/mlx5/mlx5_glue.h +@@ -258,6 +258,6 @@ struct mlx5_glue { + struct mlx5dv_devx_port *mlx5_devx_port); }; -const struct mlx5_glue *mlx5_glue;