patch 'net/ixgbe/base: fix lock checker errors' has been queued to stable release 24.11.3

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:31:40 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.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 07/23/25. 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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/6785173ef4e12b2e941fe5c236dedf16898795b3

Thanks.

Kevin

---
>From 6785173ef4e12b2e941fe5c236dedf16898795b3 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Fri, 28 Mar 2025 11:16:17 +0000
Subject: [PATCH] net/ixgbe/base: fix lock checker errors

[ upstream commit b4ce09b852e27dc37c18ebff52ea994cd5253352 ]

When building on FreeBSD, errors are reported in the base code by the
lock checker (-Wthread-safety). For example:

../drivers/net/intel/ixgbe/base/ixgbe_osdep.c:42:1: error: mutex 'lock->mutex' is still held at the end of function [-Werror,-Wthread-safety-analysis]
   42 | }
      | ^

These errors are due to the checker not recognising the lock wrapper
functions. We can avoid these errors by converting these functions into
macros. While converting the lock macros, we can also convert the memory
allocation functions too, which allows us to remove the osdep.c file
entirely from the build.

Fixes: 30b19d1b5c43 ("net/ixgbe/base: add definitions for E610")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 drivers/net/ixgbe/base/ixgbe_osdep.c | 47 ----------------------------
 drivers/net/ixgbe/base/ixgbe_osdep.h | 18 ++++++-----
 drivers/net/ixgbe/base/meson.build   |  1 -
 3 files changed, 10 insertions(+), 56 deletions(-)
 delete mode 100644 drivers/net/ixgbe/base/ixgbe_osdep.c

diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.c b/drivers/net/ixgbe/base/ixgbe_osdep.c
deleted file mode 100644
index d3d7e8e116..0000000000
--- a/drivers/net/ixgbe/base/ixgbe_osdep.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2024 Intel Corporation
- */
-
-#include <stdlib.h>
-
-#include <rte_common.h>
-
-#include "ixgbe_osdep.h"
-
-void *
-ixgbe_calloc(struct ixgbe_hw __rte_unused *hw, size_t count, size_t size)
-{
-	return malloc(count * size);
-}
-
-void *
-ixgbe_malloc(struct ixgbe_hw __rte_unused *hw, size_t size)
-{
-	return malloc(size);
-}
-
-void
-ixgbe_free(struct ixgbe_hw __rte_unused *hw, void *addr)
-{
-	free(addr);
-}
-
-void ixgbe_init_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_init(&lock->mutex, NULL);
-}
-
-void ixgbe_destroy_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_destroy(&lock->mutex);
-}
-
-void ixgbe_acquire_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_lock(&lock->mutex);
-}
-
-void ixgbe_release_lock(struct ixgbe_lock *lock)
-{
-	pthread_mutex_unlock(&lock->mutex);
-}
diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h
index 900791a93e..cacb85cf29 100644
--- a/drivers/net/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/ixgbe/base/ixgbe_osdep.h
@@ -12,4 +12,6 @@
 #include <stdarg.h>
 #include <stdbool.h>
+#include <malloc.h>
+
 #include <rte_common.h>
 #include <rte_debug.h>
@@ -51,5 +53,5 @@
 #define true                1
 #ifndef RTE_EXEC_ENV_WINDOWS
-#define min(a,b)	RTE_MIN(a,b) 
+#define min(a,b)	RTE_MIN(a,b)
 #endif
 
@@ -164,12 +166,12 @@ struct ixgbe_lock {
 };
 
-void *ixgbe_calloc(struct ixgbe_hw *hw, size_t count, size_t size);
-void *ixgbe_malloc(struct ixgbe_hw *hw, size_t size);
-void ixgbe_free(struct ixgbe_hw *hw, void *addr);
+#define ixgbe_calloc(hw, c, s) ((void)hw, calloc(c, s))
+#define ixgbe_malloc(hw, s) ((void)hw, malloc(s))
+#define ixgbe_free(hw, a) ((void)hw, free(a))
 
-void ixgbe_init_lock(struct ixgbe_lock *lock);
-void ixgbe_destroy_lock(struct ixgbe_lock *lock);
-void ixgbe_acquire_lock(struct ixgbe_lock *lock);
-void ixgbe_release_lock(struct ixgbe_lock *lock);
+#define ixgbe_init_lock(lock) pthread_mutex_init(&(lock)->mutex, NULL)
+#define ixgbe_destroy_lock(lock) pthread_mutex_destroy(&(lock)->mutex)
+#define ixgbe_acquire_lock(lock) pthread_mutex_lock(&(lock)->mutex)
+#define ixgbe_release_lock(lock)	pthread_mutex_unlock(&(lock)->mutex)
 
 #endif /* _IXGBE_OS_H_ */
diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
index 64e0bfd7be..2af8a55e92 100644
--- a/drivers/net/ixgbe/base/meson.build
+++ b/drivers/net/ixgbe/base/meson.build
@@ -13,5 +13,4 @@ sources = [
         'ixgbe_hv_vf.c',
         'ixgbe_mbx.c',
-        'ixgbe_osdep.c',
         'ixgbe_phy.c',
         'ixgbe_vf.c',
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:16.789390814 +0100
+++ 0166-net-ixgbe-base-fix-lock-checker-errors.patch	2025-07-18 20:29:11.175908082 +0100
@@ -1 +1 @@
-From b4ce09b852e27dc37c18ebff52ea994cd5253352 Mon Sep 17 00:00:00 2001
+From 6785173ef4e12b2e941fe5c236dedf16898795b3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b4ce09b852e27dc37c18ebff52ea994cd5253352 ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -25,3 +26,3 @@
- drivers/net/intel/ixgbe/base/ixgbe_osdep.c | 47 ----------------------
- drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 18 +++++----
- drivers/net/intel/ixgbe/base/meson.build   |  1 -
+ drivers/net/ixgbe/base/ixgbe_osdep.c | 47 ----------------------------
+ drivers/net/ixgbe/base/ixgbe_osdep.h | 18 ++++++-----
+ drivers/net/ixgbe/base/meson.build   |  1 -
@@ -29 +30 @@
- delete mode 100644 drivers/net/intel/ixgbe/base/ixgbe_osdep.c
+ delete mode 100644 drivers/net/ixgbe/base/ixgbe_osdep.c
@@ -31 +32 @@
-diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c b/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
+diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.c b/drivers/net/ixgbe/base/ixgbe_osdep.c
@@ -34 +35 @@
---- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.c
+--- a/drivers/net/ixgbe/base/ixgbe_osdep.c
@@ -84,4 +85,4 @@
-diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
-index 398c38bffd..53d0422193 100644
---- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
-+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h
+index 900791a93e..cacb85cf29 100644
+--- a/drivers/net/ixgbe/base/ixgbe_osdep.h
++++ b/drivers/net/ixgbe/base/ixgbe_osdep.h
@@ -122 +123 @@
-diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
+diff --git a/drivers/net/ixgbe/base/meson.build b/drivers/net/ixgbe/base/meson.build
@@ -124,2 +125,2 @@
---- a/drivers/net/intel/ixgbe/base/meson.build
-+++ b/drivers/net/intel/ixgbe/base/meson.build
+--- a/drivers/net/ixgbe/base/meson.build
++++ b/drivers/net/ixgbe/base/meson.build



More information about the stable mailing list