[dpdk-stable] patch 'bus/dpaa: fix build with musl' has been queued to stable release 19.11.9

Christian Ehrhardt christian.ehrhardt at canonical.com
Mon May 17 18:07:52 CEST 2021


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 <christian.ehrhardt at canonical.com>

---
>From 4b72771849918d48e16c32f2597b0e6afc0d2210 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa at alpinelinux.org>
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 <ncopa at alpinelinux.org>
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
Acked-by: David Marchand <david.marchand at redhat.com>
---
 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 <dpaa_of.h>
 #include <net/if.h>
 #include <sys/ioctl.h>
-#include <error.h>
+#include <err.h>
 #include <net/if_arp.h>
 #include <assert.h>
 #include <unistd.h>
@@ -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 <process.h>
 #include "bman_priv.h"
 #include <sys/ioctl.h>
+#include <err.h>
 
 /*
  * 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 <process.h>
 #include "qman_priv.h"
 #include <sys/ioctl.h>
+#include <err.h>
+
 #include <rte_branch_prediction.h>
 
 /* 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 <fman.h>
-#include <argp.h>
 
 /* 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 <assert.h>
 #include <dirent.h>
 #include <inttypes.h>
-#include <error.h>
 #include <rte_byteorder.h>
 #include <rte_atomic.h>
 #include <rte_spinlock.h>
-- 
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 at 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 @@


More information about the stable mailing list