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 A769D606A31C for ; Mon, 30 Nov 2026 00:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=jRXBG9kn Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AD3040272; Mon, 30 Nov 2026 01:27:59 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTPS id 6BF0D4003C for ; Mon, 30 Nov 2026 01:27:57 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2f048476ab9so68179685ad.0 for ; Sun, 29 Nov 2026 16:27:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1795998475; x=1796603275; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=7atgenxX7buxbTSU/+aFiBpzaaZRWO4OdpDh/tkSy1k=; b=jRXBG9knj1MSVWQO1+SE4bQGXmg49yE7yW0Zp8IpoRFAPyH6OMIQwj2elvfMuCBqLe a59ZE/ijk8sLVeN/I4pcBck5IOKSxHCja22GoT+TxbUBX9JaK3HlF1hGNBrtvpfGDvXp qLUuKv8RqZgwnhgVvhe7i67WyyY2+KXF0zFa4ayeizLD2EOaoSsONOQOJmXI2gx0zlFk k2T6uAZHzSbMJTIWI3Bzf/IS6Z2R0XiEpeayN8/fVz28IMmTlkGdFrejmbpbiQlGfmTZ KLzDkNwkGSBcM0PPWo8MSq526YiUwjJYpfgJg/IpdoRNRAge1g0n4Fdc1SOmyXpMGpmy 7e4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795998475; x=1796603275; h=content-transfer-encoding:mime-version: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=7atgenxX7buxbTSU/+aFiBpzaaZRWO4OdpDh/tkSy1k=; b=boBGqH3wPUvmS+01ycQG3nTL6FvihX5ZDRi7bQeXMJW5j2zYYsOWlpMkI3eZS//nFL GeVIJtcGSxFFdU6DKIxsLm6V1PPigMGKITi1MMtOakWafncm+FLFxwIo6fPsSnDjcLK1 CREZaru+GBC2c91zfwcZwsYmcH0Qz2XDMqd67HOXzjGU4Q1iRc+CVktnWXFllHzkoaYm ASKLkWTxmq0FKnCu8H8SCRU+rOYlWQyujZrAhmI2B8tsdgca350AFk9NRRNFjo/ejzfQ q3srIUif9WHM5ic9v14eELkrpE8CHROFJcsEd7Ap0zwwAY3/jAFGMVNDCzjM1FWAC4G3 zazQ== X-Gm-Message-State: APuU4Z+f8Yubk7OsO9mxWzGqUAfB9cKAorxjT9uKPYDwphahVe1D5AOI q6msBk3FfwS4ZtITvXF0T91jPYL/SVV9lHKV7YK72ltm1opm4PJGWvhGfQ/a8XQG2BISUudsjSG EUElz6Go= X-Gm-Gg: AZFdTZcUE/exOSMG7XfoKEpF9wt705kFsxP/o3iNd15cneIqJkUlQ/WnyrOnpqtZE6M XxdB6cYtMGV/s1HDeMeAoxG0Vi+O27whrSyflUgfFFLVABYAwYQZAZKfrS9yEKeoXkWlQZ6LCtP 8/CAZDvkbJiBHkCgN5uN0IhssbFaMTDxq3Q9oIjhJgXOFydPBdEUmiOapbv5+fpboU/a/o6CJEV IXSBEUdMWCHkAXgze18x+goJq/KI9DQMBteM/O50gSM3KjFttuNgrFOHNwF2/iQg3r6a6ukNM4V cSpQyUbvQovXxFWBV+IgJVS+lvzYx6ZfqusW4T0vwbkv9LKdfcUzVCmARxfotzhX3c019814JN4 2hlKR9ZBrnNIDOt0Qgh3+WT1IWYQtjtZqI+HnqDHfxetFglP0pjG54GmGcoiMJfCTz170n1fwap FXnFzUqyRVHcWxSvKOrLYhBdpiUM6ZMS/Xu48LoPJGdBzR8Uiq51uRuSTWC1jfDMHAwTMuEvtlF M3tQeRGvumV+sTUbpLnRt+1O5vo1+RyMEAWQxfU4vwFBZLgQ/E+mNUJWT5ItzJMRRYsa2uYTKO3 j1DRi4tnPU7WoCGQ9ONKOgBDmxrkf4Cq0eiKCjAXHImq0eY9l5OCFL7xC9oSCcy7p4iZ X-Received: by 2002:a17:90b:4e83:b0:3b3:ff70:4d06 with SMTP id 98e67ed59e1d1-3b41c9b324emr30623657a91.16.1795998475395; Sun, 29 Nov 2026 16:27:55 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b44b21e19fsm19455840a91.0.2026.11.29.16.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:27:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 00/37] enable unreachable code detection Date: Sun, 29 Nov 2026 16:26:45 -0800 Message-ID: <20261130002752.2342213-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 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=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 Unreachable code is often a symptom of a real bug: a misplaced return, an inverted condition, or a loop that can only run once. DPDK does not build with -Wunreachable-code anywhere, so none of it gets caught. This series fixes everything clang reports with -Wunreachable-code-aggressive and turns the check on for the whole tree. Only clang implements it; GCC rejects the flag and documents -Wunreachable-code as doing nothing. It found four real bugs: only one event vector adapter per queue was usable, a leftover debug abort() in the dpaa2 flow engine, the dpaa2 traffic manager port state check stubbed out as "if (0)", and eight dead error paths in the ipsec-secgw config parser. The rest is dead statements and examples that could never run their own cleanup, which now handle SIGINT and SIGTERM. Removing a trailing return is not just tidying: a case that later forgets to return becomes a compiler error rather than silently returning zero. Eleven drivers keep an exemption for base code imported from vendors, applied through base_cflags where the driver separates its base sources so its own code is still checked. Bugzilla ID: 2135 Bugzilla ID: 2139 Bugzilla ID: 2140 Tested on x86 with clang and gcc, both -Dwerror=true examples=all, and on Arm64. Two of the defects were invisible in an x86 clang build alone. Removing common/ exports that no other driver uses is a related but larger job, and will be sent separately. Dariusz Sosnowski (2): net/mlx4: fix unreachable code warnings net/mlx5: fix unreachable code warnings Stephen Hemminger (35): eventdev: fix vector adapter instance allocation eal: silence unreachable code in version string net/dpaa2: remove debug abort in flow destroy app/testpmd: fix unreachable VF traffic error message examples/eventdev_pipeline: remove dead continue examples/ipsec-secgw: remove unreachable config error path examples/skeleton: handle SIGINT and SIGTERM examples/rxtx_callbacks: handle SIGINT and SIGTERM examples/service_cores: handle SIGINT and SIGTERM examples/timer: handle SIGINT and SIGTERM examples/multi_process: handle SIGINT and SIGTERM in client examples/server_node_efd: handle SIGINT and SIGTERM in node examples/pipeline: handle SIGINT and SIGTERM ethdev: fix unreachable warnings from switch declarations config: add per-directory option for -Wunreachable-code bus/dpaa: exempt this driver from unreachable code detection net/qede: disable unreachable code checks net/txgbe: disable unreachable code checks net/ixgbe: disable unreachable code check net/ngbe: disable unreachable code check net/octeontx: replace unreachable code common/sfc_efx: disable unreachable code check for base code net/dpaa2: check port state before changing TM hierarchy net/e1000: disable unreachable code check for base code net/ice: disable unreachable code check for base code raw/ifpga: disable unreachable code check for base code net/bnxt: disable unreachable code check net/ntnic: disable unreachable code check lib: mark never returning thread functions lib: remove unreachable statements app: remove unreachable statements examples: remove unreachable statements drivers: remove unreachable statements efd: mark configuration dependent vector selection config: enable unreachable code detection app/dumpcap/main.c | 1 - app/pdump/main.c | 1 - .../comp_perf_options_parse.c | 1 - app/test-crypto-perf/cperf_ops.c | 1 - app/test-crypto-perf/cperf_options_parsing.c | 1 - app/test-flow-perf/main.c | 1 - app/test-gpudev/main.c | 1 - app/test-pmd/config.c | 4 +- app/test-pmd/parameters.c | 2 - app/test-regex/main.c | 2 - app/test-security-perf/test_security_perf.c | 1 - app/test/test_cryptodev.c | 9 --- app/test/test_cryptodev_crosscheck.c | 6 -- app/test/test_eal_flags.c | 1 - app/test/test_event_vector_adapter.c | 19 +++-- config/meson.build | 9 +++ drivers/bus/dpaa/meson.build | 3 + drivers/common/cnxk/roc_nix_fc.c | 2 - drivers/common/mlx5/linux/mlx5_nl.c | 1 - drivers/common/sfc_efx/base/meson.build | 1 + drivers/crypto/caam_jr/caam_jr.c | 1 - drivers/crypto/openssl/rte_openssl_pmd.c | 1 - drivers/dma/dpaa/dpaa_qdma.c | 2 - drivers/event/dsw/dsw_xstats.c | 1 - drivers/ml/cnxk/cnxk_ml_ops.c | 10 --- drivers/net/bnx2x/bnx2x.c | 2 - drivers/net/bnxt/meson.build | 3 + drivers/net/cnxk/cnxk_ethdev_mtr.c | 3 - drivers/net/dpaa2/dpaa2_flow.c | 1 - drivers/net/dpaa2/dpaa2_tm.c | 6 +- drivers/net/intel/e1000/meson.build | 3 + drivers/net/intel/ice/meson.build | 3 + drivers/net/intel/ipn3ke/ipn3ke_representor.c | 3 - drivers/net/intel/ipn3ke/ipn3ke_tm.c | 1 - drivers/net/intel/ixgbe/meson.build | 3 + drivers/net/mlx4/mlx4_flow.c | 14 ++-- drivers/net/mlx5/linux/mlx5_mp_os.c | 1 - drivers/net/mlx5/mlx5_flow_dv.c | 1 - drivers/net/mlx5/mlx5_flow_flex.c | 1 - drivers/net/mlx5/mlx5_flow_hw.c | 18 +++-- drivers/net/mlx5/mlx5_flow_verbs.c | 16 ++--- drivers/net/ngbe/base/meson.build | 3 + drivers/net/ntnic/meson.build | 3 + drivers/net/octeontx/base/octeontx_pkovf.c | 9 ++- drivers/net/qede/base/meson.build | 3 + drivers/net/qede/meson.build | 2 +- drivers/net/sfc/sfc_mae.c | 2 - drivers/net/txgbe/base/meson.build | 3 + drivers/net/txgbe/meson.build | 1 + drivers/raw/ifpga/base/meson.build | 1 + drivers/vdpa/ifc/ifcvf_vdpa.c | 4 -- drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 1 - drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 - drivers/vdpa/nfp/nfp_vdpa.c | 5 -- examples/bond/main.c | 1 - examples/eventdev_pipeline/main.c | 4 +- examples/ipsec-secgw/parser.c | 40 +++-------- examples/l2fwd-jobstats/main.c | 2 - examples/l3fwd/main.c | 4 -- .../client_server_mp/mp_client/client.c | 20 +++++- examples/ntb/ntb_fwd.c | 1 - examples/pipeline/main.c | 21 +++++- examples/pipeline/thread.c | 2 +- examples/pipeline/thread.h | 6 ++ examples/rxtx_callbacks/main.c | 19 ++++- examples/server_node_efd/efd_node/node.c | 20 +++++- examples/service_cores/main.c | 23 +++++- examples/skeleton/basicfwd.c | 18 ++++- examples/timer/main.c | 23 +++++- examples/vhost/main.c | 4 +- lib/cmdline/cmdline_parse_num.c | 2 - lib/eal/common/rte_version.c | 7 +- lib/efd/rte_efd.c | 10 +-- lib/ethdev/rte_flow.c | 71 +++++++++---------- lib/eventdev/rte_event_eth_rx_adapter.c | 4 +- lib/eventdev/rte_event_vector_adapter.c | 5 +- lib/fib/rte_fib.c | 1 - lib/fib/rte_fib6.c | 1 - lib/sched/rte_sched.c | 1 - lib/vhost/socket.c | 4 +- lib/vhost/vhost_crypto.c | 1 - 81 files changed, 278 insertions(+), 237 deletions(-) -- 2.53.0