]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: airoha: Fix debugfs new-tuple display for IPv4 ROUTE entries
authorWayen.Yan <win847@gmail.com>
Thu, 11 Jun 2026 23:09:56 +0000 (07:09 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 22:18:42 +0000 (15:18 -0700)
In airoha_ppe_debugfs_foe_show(), the second switch statement falls
through from PPE_PKT_TYPE_IPV4_HNAPT/DSLITE to PPE_PKT_TYPE_IPV4_ROUTE,
accessing hwe->ipv4.new_tuple for all three types. However, IPv4 ROUTE
(3-tuple) entries do not contain a valid new_tuple — this field is only
meaningful for NATted flows (HNAPT/DSLITE). For ROUTE entries, the
memory at the new_tuple offset holds routing information, not NAT data,
so displaying "new=" produces garbage output.

Display new_tuple only for HNAPT and DSLITE, and let IPV4_ROUTE fall
through to the default case.

Fixes: 3fe15c640f38 ("net: airoha: Introduce PPE debugfs support")
Link: https://lore.kernel.org/6a2b40ea.4dd82583.3a5c46.e5a2@mx.google.com
Signed-off-by: Wayen.Yan <win847@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/6a2be54b.ef98c1b2.3c3224.2ed8@mx.google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_ppe_debugfs.c

index 0112c41150bb05d1f99def4e58acd1a11e81696c..e46a98514486ffddafda88db072b541ae3403c9d 100644 (file)
@@ -121,8 +121,6 @@ static int airoha_ppe_debugfs_foe_show(struct seq_file *m, void *private,
                case PPE_PKT_TYPE_IPV4_DSLITE:
                        src_port = &hwe->ipv4.new_tuple.src_port;
                        dest_port = &hwe->ipv4.new_tuple.dest_port;
-                       fallthrough;
-               case PPE_PKT_TYPE_IPV4_ROUTE:
                        src_addr = &hwe->ipv4.new_tuple.src_ip;
                        dest_addr = &hwe->ipv4.new_tuple.dest_ip;
                        seq_puts(m, " new=");