From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66E35A0A02 for ; Mon, 17 May 2021 18:12:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FF0A40041; Mon, 17 May 2021 18:12:23 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 2876040041 for ; Mon, 17 May 2021 18:12:22 +0200 (CEST) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=Keschdeichel.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lifqt-0007jh-VZ; Mon, 17 May 2021 16:12:20 +0000 From: Christian Ehrhardt To: Natanael Copa Cc: Thomas Monjalon , Andrew Rybchenko , David Marchand , dpdk stable Date: Mon, 17 May 2021 18:07:52 +0200 Message-Id: <20210517161039.3132619-43-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> References: <20210517161039.3132619-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bus/dpaa: fix build with musl' has been queued to stable release 19.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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.9 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/19/21. 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. Queued patches are on a temporary branch at: https://github.com/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/4b72771849918d48e16c32f2597b0e6afc0d2210 Thanks. Christian Ehrhardt --- >From 4b72771849918d48e16c32f2597b0e6afc0d2210 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 5 Nov 2020 22:17:12 +0100 Subject: [PATCH] bus/dpaa: fix build with musl [ upstream commit e9fd4b87f08d4da01ea9bde075f02e702b65a784 ] The header files argp.h and error.h do not exist in musl libc. Fix build with musl libc by using err(3) instead of the GNU-specific error(3). We could have used the identical errx("...: %s", strerror(ret))` but strerror(3) is not thread-safe and the strerror_r variant has two incompatible versions, one GNU specific and one XSI-compliant. Avoid the mess by letting "err" use the thread-local errno. This also fixes error message for kzmalloc failures which previously would always have given "Unknown error -1", since that is what strerror(-1) returns. Let "err" use the proper error message from errno which is set by kzalloc. Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal") Fixes: f09ede6c8fd1 ("bus/dpaa: add BMAN driver core") Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations") Fixes: 39f373cf015a ("bus/dpaa: add compatibility and helper macros") Signed-off-by: Natanael Copa Signed-off-by: Thomas Monjalon Acked-by: Andrew Rybchenko Acked-by: David Marchand --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 4 ++-- drivers/bus/dpaa/base/qbman/bman_driver.c | 13 +++++++++---- drivers/bus/dpaa/base/qbman/qman_driver.c | 17 ++++++++++++----- drivers/bus/dpaa/include/netcfg.h | 1 - drivers/common/dpaax/compat.h | 1 - 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 36eca88cd4..2ec504c5d2 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ netcfg_acquire(void) */ skfd = socket(AF_PACKET, SOCK_RAW, 0); if (unlikely(skfd < 0)) { - error(0, errno, "%s(): open(SOCK_RAW)", __func__); + err(0, "%s(): open(SOCK_RAW)", __func__); return NULL; } diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 750b756b93..ee35e03da1 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -11,6 +11,7 @@ #include #include "bman_priv.h" #include +#include /* * Global variables of the max portal/pool number this bman version supported @@ -40,7 +41,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + errno = ret; + err(0, "pthread_getaffinity_np()"); return ret; } pcfg.cpu = -1; @@ -60,7 +62,8 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) map.index = idx; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); return ret; } /* Make the portal's cache-[enabled|inhibited] regions */ @@ -104,8 +107,10 @@ static int fsl_bman_portal_finish(void) cfg = bman_destroy_affine_portal(); DPAA_BUG_ON(cfg != &pcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + err(0, "process_portal_unmap()"); + } return ret; } diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index e1dee17542..2aa3b682d0 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -9,6 +9,8 @@ #include #include "qman_priv.h" #include +#include + #include /* Global variable containing revision id (even on non-control plane systems @@ -40,7 +42,8 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) map.index = index; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); return ret; } qpcfg.channel = map.channel; @@ -86,8 +89,10 @@ static int fsl_qman_portal_finish(void) cfg = qman_destroy_affine_portal(NULL); DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); - if (ret) - error(0, ret, "process_portal_unmap()"); + if (ret) { + errno = ret; + err(0, "process_portal_unmap()"); + } return ret; } @@ -136,7 +141,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { - error(0, -1, "q_pcfg kzalloc failed"); + /* kzalloc sets errno */ + err(0, "q_pcfg kzalloc failed"); return NULL; } @@ -145,7 +151,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) q_map.index = QBMAN_ANY_PORTAL_IDX; ret = process_portal_map(&q_map); if (ret) { - error(0, ret, "process_portal_map()"); + errno = ret; + err(0, "process_portal_map()"); kfree(q_pcfg); return NULL; } diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h index bf7bfae8cb..e1f0461fcd 100644 --- a/drivers/bus/dpaa/include/netcfg.h +++ b/drivers/bus/dpaa/include/netcfg.h @@ -9,7 +9,6 @@ #define __NETCFG_H #include -#include /* Configuration information related to a specific ethernet port */ struct fm_eth_port_cfg { diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h index 12c9d99179..d2883d02d4 100644 --- a/drivers/common/dpaax/compat.h +++ b/drivers/common/dpaax/compat.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include -- 2.31.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-17 17:40:31.231301044 +0200 +++ 0043-bus-dpaa-fix-build-with-musl.patch 2021-05-17 17:40:29.175809507 +0200 @@ -1 +1 @@ -From e9fd4b87f08d4da01ea9bde075f02e702b65a784 Mon Sep 17 00:00:00 2001 +From 4b72771849918d48e16c32f2597b0e6afc0d2210 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e9fd4b87f08d4da01ea9bde075f02e702b65a784 ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -40 +41 @@ -index b7009f2299..120deb0bb6 100644 +index 36eca88cd4..2ec504c5d2 100644 @@ -52 +53 @@ -@@ -90,7 +90,7 @@ netcfg_acquire(void) +@@ -89,7 +89,7 @@ netcfg_acquire(void) @@ -107 +108 @@ -index 6d9aaff164..dfbafe581a 100644 +index e1dee17542..2aa3b682d0 100644 @@ -119 +120 @@ -@@ -50,7 +52,8 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) +@@ -40,7 +42,8 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) @@ -129 +130 @@ -@@ -96,8 +99,10 @@ static int fsl_qman_portal_finish(void) +@@ -86,8 +89,10 @@ static int fsl_qman_portal_finish(void) @@ -142 +143 @@ -@@ -146,7 +151,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) +@@ -136,7 +141,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) @@ -152 +153 @@ -@@ -155,7 +161,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) +@@ -145,7 +151,8 @@ struct qman_portal *fsl_qman_fq_portal_create(int *fd) @@ -163 +164 @@ -index d7d1befd24..bb18a34e3d 100644 +index bf7bfae8cb..e1f0461fcd 100644 @@ -175 +176 @@ -index c69e76ab96..7166f8cceb 100644 +index 12c9d99179..d2883d02d4 100644 @@ -178 +179 @@ -@@ -30,7 +30,6 @@ +@@ -34,7 +34,6 @@