DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx4: fix unreachable code warnings
@ 2026-11-27  9:09 Dariusz Sosnowski
  0 siblings, 0 replies; only message in thread
From: Dariusz Sosnowski @ 2026-11-27  9:09 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko; +Cc: dev, stable, Stephen Hemminger

Building with clang and -Wunreachable-code generates warnings
on variable declarations inside switch block in mlx4_flow_prepare().
Move them up to silence the warnings.

Bugzilla ID: 2139
Fixes: 267d07dacdeb ("net/mlx4: tidy up flow rule handling code")
Fixes: 078b8b452e6b ("net/mlx4: add RSS flow rule action support")
Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
Fixes: ef134c8daa08 ("net/mlx4: fix ignored RSS hash types")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx4/mlx4_flow.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index b520664d95..f812884c34 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -747,6 +747,13 @@ mlx4_flow_prepare(struct mlx4_priv *priv,
 	}
 	/* Go over actions list. */
 	for (action = actions; action->type; ++action) {
+		const struct rte_flow_action_queue *queue;
+		const struct rte_flow_action_rss *rss;
+		const uint8_t *rss_key;
+		uint32_t rss_key_len;
+		uint64_t fields;
+		unsigned int i;
+
 		/* This one may appear anywhere multiple times. */
 		if (action->type == RTE_FLOW_ACTION_TYPE_VOID)
 			continue;
@@ -758,13 +765,6 @@ mlx4_flow_prepare(struct mlx4_priv *priv,
 		}
 		overlap = 1;
 		switch (action->type) {
-			const struct rte_flow_action_queue *queue;
-			const struct rte_flow_action_rss *rss;
-			const uint8_t *rss_key;
-			uint32_t rss_key_len;
-			uint64_t fields;
-			unsigned int i;
-
 		case RTE_FLOW_ACTION_TYPE_DROP:
 			flow->drop = 1;
 			break;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-27  9:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27  9:09 [PATCH] net/mlx4: fix unreachable code warnings Dariusz Sosnowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox