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 EDD0946BAE for ; Fri, 18 Jul 2025 21:38:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E810140E30; Fri, 18 Jul 2025 21:38:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 2CDB340611 for ; Fri, 18 Jul 2025 21:38:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6CTU2SnU9NOGKFcMx+gAV5HqALvMz6WoXDtNuVZAZAI=; b=PhijjPyHJZYl0flRetCnrOfp1/uNlOFZDFL5RMaUEWS7CeSFh87BxbnvuH054kHkkliFEy yhstOSuDpd9bZSFIaYTyPpjFKou2I3gx3aI5pt24hnUlQK6K4ihJK2m1ngL4H14LirQ5eb 7K+Mch1wUrEK4YsLz5ZvsztwrggGhjg= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-Pxd6JWfZNXyozLl2Os7ENA-1; Fri, 18 Jul 2025 15:38:39 -0400 X-MC-Unique: Pxd6JWfZNXyozLl2Os7ENA-1 X-Mimecast-MFC-AGG-ID: Pxd6JWfZNXyozLl2Os7ENA_1752867518 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4B922180028F; Fri, 18 Jul 2025 19:38:38 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B854818003FC; Fri, 18 Jul 2025 19:38:36 +0000 (UTC) From: Kevin Traynor To: Bruce Richardson Cc: Anatoly Burakov , dpdk stable Subject: patch 'net/ixgbe/base: fix lock checker errors' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:31:40 +0100 Message-ID: <20250718193247.1008129-166-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: pSFJJXlm4nYKqkZiTJfy1O--SzNsEEJrc_4nQ3V9kfU_1752867518 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 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 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 Reviewed-by: Anatoly Burakov --- 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 - -#include - -#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 #include +#include + #include #include @@ -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@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