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 4BE84606A31C for ; Mon, 30 Nov 2026 00:28:16 +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=RTBsBY0k Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9BD7A40659; Mon, 30 Nov 2026 01:28:02 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTPS id 1DA39402B4 for ; Mon, 30 Nov 2026 01:28:00 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3b405d8f1cfso4711793a91.3 for ; Sun, 29 Nov 2026 16:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1795998478; x=1796603278; 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=K/X+M33it7RztcgOUx5U9tcD5o03poHK3x8H532jwz0=; b=RTBsBY0kLP/Jt3SZhGD5RMRSwnAC6iDDWfyS6ahnmtiZ3OrNFz9j6W7lgFlCz4aqti Yq+IvLETOABCtj3ZKuG6nuo8cv9GeazEII5wu0JFMZBPsOrZoDNf2ojl8oKJBeBVErUf Myfpqo/wPudlyGvvA7aNeEPL8Y0r56UorXwNrC/r+YHNJDX/f65WElomvqHsm6W+r2a6 vLtjgvGVakb8wBvtkzARvEbxKwlMFGfiZe9L8f3U6fnsOoJeerQsKOKnOkau+fWjdxrd P6ZE/0R1Brewkbw8n5CB4slW2/BsneYHJYXyUxUPevNrZ0O7M36tzitRW2dBF6SH38Xz 42Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795998478; x=1796603278; 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=K/X+M33it7RztcgOUx5U9tcD5o03poHK3x8H532jwz0=; b=cV3xRWTuAvykYMKENkgqTtzghDni5boQdh7qsKj8sXRhVwEXSdI2y6mli0epV01bf9 w80tFrlRo0TULu5qzwo3SG1DjewMd2CTS/b8TNbeEJEfN7paIClcUrTPBcqfLPumkJzB SmAMyLqpI+2kyHYhp7bTdilwYB18skxSkTnD1iqz72uLe37NeacLggOH25sqblnQzE43 2FXpiU/vbZVEIiRcbA2UtOWASKpQ9mc1qACfXDP/6ulqzB3v4wx15Q33+wHjC90toWkN 1vbCzvu548j/Xn7RWOlBfvhou7GrN+SppmSX4Rz1PmuOcEn9Yqk5j0z4MOKvROBlhu4L zM+A== X-Gm-Message-State: APuU4Z/uCZdFKO6dpEpYY4PwY1eKaSt5cbAWKXoQKjKTjznQdjYY7Wrj goHCnyfDdJgIzwMI8Bsfo1LDSvkyGwEKBnEEtKMVzn1lRD8ImmNEbfCJNDDMoJhIWYOODR4WD3l dao4ag9I= X-Gm-Gg: AZFdTZfpYP4XaEmleHKeIW2fiAkn7DRzbFgDhgnDne13A/cyMpEzhktKX4lezmXLWxr Dyvdg2JeElh4MzSnIwhaTh/5/z1bEO4jAWoagvSXtiw8L2oO47NNpJ+LCMymJeJQyRc2tdZnmho u8V3Wnl2fmrvChOpzFnoOXMsYUvDA55ZgeDx874lac8VLKhMz5mqKR2eTbezNicRGgUvOm8mXAH g9CFr6Jjqfh8rcAbxW1bE1vBogkXdQ2UFHCStecI7wG+ryfLyUiEC5OrzE6xwZKOoflRxYhGoLK nD6gTqZ5MxTkafd3XURWTAYg/JgCADZ/q4h/ucfMOtOVZZdhSDY7RxuSAOyuT8Hlk1TGMhCf43j zJO9P2Ddi5+pVw16ZN8HM9Sc0NOndDgwuBBKpv6AjVsTqyxgGwh01GVii43N0reT4e6BFW5VDzb TZO1kZp3wDKHc5DQEQ9/tQjkW/elfWZwQ6kjLa4vjF5r8Z0Q4eHKsvr6/QDb110BzRNtA21Vy3i hWwL5HKyndQ1VvGU5xVltPF4byH5mVlqJm4daFdIYb00QMoLguylSnOWkapURNuA/untAg1XdYS RjGfxKRyI0xsCp1jU5Fq6b5LzUJNFJs59gSo0vsxaw0h3WSUc2siHa+LAu3zP1pVqGz58fR/O5D i1Q3SRe0eSGlFPw== X-Received: by 2002:a17:90b:2651:b0:3b5:5c8a:985e with SMTP id 98e67ed59e1d1-3b55c8aa5f7mr3570842a91.63.1795998478449; Sun, 29 Nov 2026 16:27:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:27:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Dariusz Sosnowski , xuemingl@nvidia.com, 14pwcse1224@uetpeshawar.edu.pk, stable@dpdk.org, Stephen Hemminger , Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH 02/37] net/mlx5: fix unreachable code warnings Date: Sun, 29 Nov 2026 16:26:47 -0800 Message-ID: <20261130002752.2342213-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130002752.2342213-1-stephen@networkplumber.org> References: <20261130002752.2342213-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 From: Dariusz Sosnowski Building with clang and -Wunreachable-code produces warnings: - In flow_verbs_discover_priorities() - With recent rdma-core versions, a condition is skipped because of goto statement under ifdefs for new version. - In flow_hw_validate_rule_pattern() and flow_hw_validate_rule_actions() - On variable declarations inside switch at the beginning of switch blocks. This patch silences these warnings. First issue is resolved by reorganizing ifdef guards to remove the need for goto. Second issue is resolved by moving variable declarations out of the switch block. Bugzilla ID: 2140 Fixes: 1d47e9335e2f ("net/mlx5: improve Verbs flow priority discovery") Fixes: 57c7b94301ee ("net/mlx5: add async flow operation validation") Fixes: 179e70fd7ad2 ("net/mlx5: fix connection tracking state item validation") Cc: xuemingl@nvidia.com Cc: 14pwcse1224@uetpeshawar.edu.pk Cc: stable@dpdk.org Reported-by: Stephen Hemminger Signed-off-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 17 ++++++++--------- drivers/net/mlx5/mlx5_flow_verbs.c | 16 +++++++--------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 6e6bf07799..62482c911d 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -17351,6 +17351,11 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev, pt_item++; for (; pt_item->type != RTE_FLOW_ITEM_TYPE_END; pt_item++, items++) { + const struct rte_flow_item_ethdev *ethdev; + const struct rte_flow_item_tx_queue *tx_queue; + const struct rte_flow_item_conntrack *spec; + struct mlx5_txq_ctrl *txq; + if (pt_item->type != items->type) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, items, "Item type does not match the template"); @@ -17375,11 +17380,6 @@ flow_hw_validate_rule_pattern(struct rte_eth_dev *dev, items, "Item spec is required"); switch (items->type) { - const struct rte_flow_item_ethdev *ethdev; - const struct rte_flow_item_tx_queue *tx_queue; - const struct rte_flow_item_conntrack *spec; - struct mlx5_txq_ctrl *txq; - case RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT: ethdev = items->spec; if (flow_hw_validate_target_port_id(dev, ethdev->port_id)) { @@ -17486,7 +17486,10 @@ flow_hw_validate_rule_actions(struct rte_eth_dev *dev, * Configuration of masked actions is ignored. */ LIST_FOREACH(act_data, &hw_acts->act_list, next) { + const struct rte_flow_action_modify_field *mf; + const struct rte_flow_action_ethdev *ethdev; const struct rte_flow_action *user_action; + enum rte_flow_action_type expected_type; user_action = &actions[act_data->action_src]; @@ -17507,10 +17510,6 @@ flow_hw_validate_rule_actions(struct rte_eth_dev *dev, "Action requires configuration"); switch ((int)user_action->type) { - enum rte_flow_action_type expected_type; - const struct rte_flow_action_ethdev *ethdev; - const struct rte_flow_action_modify_field *mf; - case RTE_FLOW_ACTION_TYPE_INDIRECT: expected_type = act_data->indirect.expected_type; if (!flow_hw_valid_indirect_action_type(user_action, expected_type)) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index eb576f73d4..f404d2c739 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -50,14 +50,15 @@ struct ibv_spec_header { */ static int flow_verbs_discover_priorities(struct rte_eth_dev *dev, - const uint16_t *vprio, int vprio_n) + const uint16_t *vprio __rte_unused, + int vprio_n __rte_unused) { struct mlx5_priv *priv = dev->data->dev_private; struct { struct ibv_flow_attr attr; struct ibv_flow_spec_eth eth; struct ibv_flow_spec_action_drop drop; - } flow_attr = { + } __rte_unused flow_attr = { .attr = { .num_of_specs = 2, .port = (uint8_t)priv->dev_port, @@ -79,16 +80,15 @@ flow_verbs_discover_priorities(struct rte_eth_dev *dev, .type = IBV_FLOW_SPEC_ACTION_DROP, }, }; - struct ibv_flow *flow; - struct mlx5_hrxq *drop = priv->drop_queue.hrxq; - int i; + struct ibv_flow *flow __rte_unused; + struct mlx5_hrxq *drop __rte_unused = priv->drop_queue.hrxq; + int i __rte_unused; int priority = 0; #if defined(HAVE_MLX5DV_DR_DEVX_PORT) || defined(HAVE_MLX5DV_DR_DEVX_PORT_V35) /* If DevX supported, driver must support 16 verbs flow priorities. */ priority = 16; - goto out; -#endif +#else if (!drop->qp) { rte_errno = ENOTSUP; return -rte_errno; @@ -101,8 +101,6 @@ flow_verbs_discover_priorities(struct rte_eth_dev *dev, claim_zero(mlx5_glue->destroy_flow(flow)); priority = vprio[i]; } -#if defined(HAVE_MLX5DV_DR_DEVX_PORT) || defined(HAVE_MLX5DV_DR_DEVX_PORT_V35) -out: #endif DRV_LOG(INFO, "port %u supported flow priorities:" " 0-%d for ingress or egress root table," -- 2.53.0