From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0BF8606A31A for ; Wed, 2 Dec 2026 01:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=pvRa+uxs Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95AC940687; Wed, 2 Dec 2026 02:12:08 +0100 (CET) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTPS id BF13340687 for ; Wed, 2 Dec 2026 02:12:07 +0100 (CET) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cde827b7b95so4479209a12.0 for ; Tue, 01 Dec 2026 17:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796173926; x=1796778726; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=G3Ab1jRENpLrDahZM7QgC8IP6ru9tkcFO5Kiks0xKVg=; b=pvRa+uxsUkT7k6+HmZY7meud6CzppaMneZGSm20WIb3NL4p1j9TljSG6sfgRGTT8Jb gsXMmTBrPcAQH1fHWxZhCyIcHSjLsQJLyxV5oMxH+hD4Bmtu8YFxpKtatWbRgYkV9Sdr Zlo06jaVu2Vap8nGAiU03DrExrr10SfF3S2ba5Kfup6BRj0l1+1ckCSGlYC36NdpUceE kZVd4heOk8d+y/92FdDqr4eO3aN5ZgjlW+oIr/VQfda8V//DbBAmaTokR6+HTkRct3px 2u2qU149ew8QOyfGDMA3h/i/XxUHLKmD/TByTQBj6pA/sxh9pVmsLw93N2fgUJfiw6Q7 Ufjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796173926; x=1796778726; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=G3Ab1jRENpLrDahZM7QgC8IP6ru9tkcFO5Kiks0xKVg=; b=CcwQ+b183wi8FuB8acQGUXXfTCbD/5e45R8ADuzneN0ph0Pu3stoKYm20XDssT0shk ZoXt8K5pQzV8WD0KQYS4KkTH7X8swJDL3W9OPN9Lqii9MV0FvS1A0pJSoMTYbwRl5UKC 2FhOJOVeE6wRuyP5BRwaOfRF+D2IT7GdbRW0JxydAs/8BHE3J/8S+uOh1DygH8L634nv Rqizrx7/uy36CGHv7R6Td1AEMlzAwfP+aP13GusOoLwIe8VHR26EIKD5oKW5ec9qxqme rOzpy4M5ufo+1rfLtrrYsPYY/+6QQDcRg0moaNOOvHRjO65vVEhDtu2CisfVK+b0ZlJO Ni9g== X-Gm-Message-State: APuU4Z9BEGhoexEVbGLMbfcH8f8FZ/w2YDq6UgceGaaMGhavq0XImduE pBR8dqLkCx5SbK1g9SNnhvh31xv2rrqjcobVqzQj+jMswYKNO2LjgLu/7tXT0fi9IO7TmBvBz7s 7Ch10b6E= X-Gm-Gg: AZFdTZew3PIwnFMYvtAoB+R1M72G4fVEQo15BmPatwVO8SUmStpF7e4oIc5Qz23LozH B5zS3jVSjMD1pYNK2USXUK1kZ4zQUeayJQlL86/ZYP1SGGYTy00BbseE41zGpAfD3xvJkM0Uba5 SPqILR/5ETMI4KtEiyJ7sbhw0qBDqwAZBaf2vcxa3zoM+NZZuqd6l/98MKhRpiyMCf1pB0VkieQ RaK/eCfuB5KjyA5al/dDE4q+0LpFkTo29tIKnZuNXbQqS/5O4hGVysVuqvhvOq4AgZCLV0Fm147 Lxiw0Ls5aDzstYrAxu1yUTtI4A7SIjgpjvbdNO8gponUOr3WGa82gotMYzEVtxoudNwys+HPBzE bZlZK3/AJ/foyA9mgPbf2tw/7VAUrF/CbQErUvIfBoL2xr7FGTsxKDWpQRMHc0BXmsjAP/jyMk9 VNn9+dx2g0Ul5BqmmLwnq5iSg0kr0wlu8sSgsLymNtO0nRmgDByol5yKYobSo+2dH1u88sD92BW SfgZfVUh3682rIdJOjwC782B01FEwfDS+bk75rKUvAac+N/QT80kuFqaw+G2IdH7MzSkP3UBK05 Nae+SEo1erAnJPhBTXvf4i2VFppebsX6Y0W5IGbu0pLX3ltrUYfZ2Pu8ESQGVKPZslSUARpWiht Htd0zsaYszumjKw== X-Received: by 2002:a05:6a21:1f8e:b0:400:bd0d:8e21 with SMTP id adf61e73a8af0-4014c7554acmr37977516637.32.1796173926310; Tue, 01 Dec 2026 17:12:06 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cdec1168866sm11120980a12.25.2026.12.01.17.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 17:12:06 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon Subject: [PATCH v2 6/6] devtools: forbid direct use of sys/queue.h Date: Tue, 1 Dec 2026 17:05:06 -0800 Message-ID: <20261202011153.3255223-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261202011153.3255223-1-stephen@networkplumber.org> References: <20260917172116.660120-1-stephen@networkplumber.org> <20261202011153.3255223-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 The set of list macros provided by differs per platform: glibc lacks the _FOREACH_SAFE variants, and musl and Windows have no such header. DPDK now provides rte_queue.h with the complete set. Both headers use the same multiple inclusion guard, so a single direct include of anywhere in a translation unit disables rte_queue.h for all of it. Reject new occurrences. Signed-off-by: Stephen Hemminger --- devtools/checkpatches.sh | 9 +++++++++ doc/guides/contributing/coding_style.rst | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index c52fb5d1b6..d14e7598f4 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -105,6 +105,15 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # include rte_queue.h, the system header has fewer macros + awk -v FOLDERS="lib drivers app examples" \ + -v SKIP_FILES='lib/eal/include/rte_queue.h' \ + -v EXPRESSIONS='include.*' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using , prefer ' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # check %l or %ll format specifier awk -v FOLDERS='lib drivers app examples' \ -v EXPRESSIONS='%ll*[xud]' \ diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst index 11de3bb39a..f2c2cd8503 100644 --- a/doc/guides/contributing/coding_style.rst +++ b/doc/guides/contributing/coding_style.rst @@ -317,11 +317,14 @@ Queues ~~~~~~ Use queue(3) macros rather than rolling your own lists, whenever possible. +Include ```` rather than ````: +the set of macros provided by the system header differs per platform, +and the DPDK one provides the same complete set everywhere. Thus, the previous example would be better written: .. code-block:: c - #include + #include struct foo { LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */ -- 2.53.0