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 C4AA3606A325 for ; Mon, 30 Nov 2026 21:52:10 +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=awzuJhpm Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5475540288; Mon, 30 Nov 2026 22:52:09 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTPS id 296E840279 for ; Mon, 30 Nov 2026 22:52:08 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8b9c51097e2so4467574b3a.1 for ; Mon, 30 Nov 2026 13:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796075526; x=1796680326; 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=e4Dz9EKMhpH2MPShbXvSvx/78tco9EkqkemerOHCB00=; b=awzuJhpm0EmJkHx+uGzAn40xRZLNJnFi5ZSCxDiaO/RNVn/lWjrSe77Ch57ZX/XzCD W/4uug1hjTx6nloVyJc9IAgIgzHOhZl/FLE4H59GG0rkP7ihlQsxhnWu+Hk3eNJcy8bE POPbg1VkvocyVSCOkfenqN2KMArKWX5aZNX4gcuhxdByJMJasKF0W4oWTPexaGgq4AXH kc+nQU+bI34lFcTRFI4HIGMtbhf2MVm0UWb52ODpeKFu9uXqIYQRnKJxr5JpxKvMIFwc 2wt7NZFaPMNmhj95xx0w53vlI+n3HMh07nLOj8/n9r9qjiR7+ommmV3PUXMg9veOvA33 8UwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796075526; x=1796680326; 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=e4Dz9EKMhpH2MPShbXvSvx/78tco9EkqkemerOHCB00=; b=anozX4b76Q0CgqMbt0e76c+DFcClpjg02DUnX/4UF7ROtmTvFQ7EqL9EySdY9Ld1Bx M4erQfkDDUmO6kBOAD7mwpgbMS4qhrsfGpvJc6Vgc+VDXawlkrs02AjpIIsjSyewMDBd +24LgRJB4bbjCoIhA3Sg7sT2kbr0eoDoonu3+RP0WOE/Oey2wKAgXd7X2B6CC5ScyuoS M2SXcbX1w4sgeqmBtbaobyy4yeF0KjluxX+KtKxGEaN86F4LIRk1grCQN+1WQpnMGmC/ OK1Z+2IDXKQosn9BGiyw7e381UTa+VUyFSrPuVuYaa1VqOIDY+p+AYjcpQJnQUP0SZWl BeDA== X-Gm-Message-State: APuU4Z8imk50v37R8OWT6EvfeeMHbOAMC9yB4UGYpcwOwAV5wTgcCXZT dNL4sq3wZZFBdqpTiCFAfZuAauT+E8syFRGOj+OoWBCW79s4IdMLPcXjAdDG9N5ll4gbbiuLT2O zsCaMIt8= X-Gm-Gg: AZFdTZeIwFGTY8nzVUs2RPVumIEvqf9/CoWfYOCaspBzAvbVOKVMBgqUiPflBBjadEu IHAtED/sD3JTu/OIvQJcuj2w2btuNDhWka/lq7Fa9uWgCKZS6jrFY1Kkf9sLQwtxpqSZtFV44Tw UbvlGrNQ+gWmC0bXQhY17OSkTOHa6oEazAzbxbdxp8pBENzPWPyLxvAnhfHF4cvMAQv0AyGnxHX Jov4DUTtie2qqfgIPu9qeawBA7iKMvRfxAcHJXiPfpdwlnCrwhmLFkcW7yZLk2Qu4EU9ejqGGlC JngbhdHFUeV8AOq1NnRizQ8byTQeFh2hrQZRH58FYthIZy7liAOnhGtY1ZidDq6bWJGyk2nV6kO +60fYCTrikfsom+CT0WlKJTL0tsCuabWaW2RpqO1iRn+g70nEWdefYwfJEweqF2UmZlGrsOchOQ OXf1K2nE2teUrs8WcwPCb5eKSznQpn7HYjB0UPrbKGJJvxdzIqdK41k2FDs0aupLxa1xwLEZB4n ffMpTDhuTuSxBigfrMhiEFgghaebs5a2FaLXs+3KOtmgSfzqihoNkP6FTrvcPw5oupELw2rgBYz rRFmjIkJ1zWCBp0imqis2C6MOQWYk6soFZMd6pRXysltAYV5ykQtVBmbP9P/yM0QZbgD X-Received: by 2002:a05:6a00:2ea9:b0:8a0:3685:239d with SMTP id d2e1a72fcca58-8c8793b8cf9mr34295536b3a.1.1796075526206; Mon, 30 Nov 2026 13:52:06 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c872e45756sm18561940b3a.27.2026.11.30.13.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 13:52:05 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 00/38] enable unreachable code detection Date: Mon, 30 Nov 2026 13:49:06 -0800 Message-ID: <20261130215203.886245-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261129205006.1440292-1-stephen@networkplumber.org> References: <20261129205006.1440292-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=-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 The patches for mlx4, mlx5 and ipsec-gw are rebased versions of upstream patches in patchwork. v2 - use correct ipsec patch - add patch for building test on FreeBSD Dariusz Sosnowski (2): net/mlx4: fix unreachable code warnings net/mlx5: fix unreachable code warnings Radu Nicolau (1): examples/ipsec-secgw: remove dead code Stephen Hemminger (35): eventdev: fix vector adapter instance allocation test/eal: skip filesystem test on FreeBSD 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/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_eal_fs.c | 12 ++-- 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 - 82 files changed, 282 insertions(+), 245 deletions(-) -- 2.53.0