net: airoha: Fix debugfs new-tuple display for IPv4 ROUTE entries
Subsystems (4)
PATCH v2 1/1 net: airoha: Fix debugfs new-tuple display for IPv4 ROUTE entries
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.
- Drop redundant PPE_PKT_TYPE_IPV4_ROUTE case, let it fall to default Changes in v2:
--- drivers/net/ethernet/airoha/airoha_ppe_debugfs.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/airoha/airoha_ppe_debugfs.c +0 -2
@@ -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=" );
Signature · 1 line
2.51.0
Quoted 10 lines
In
airoha_ppe_debugfs_foe_show(), the second switch statement falls through from PPE_PKT_TYPE_IPV4_HNAPT/DSLITE toPPE_PKT_TYPE_IPV4_ROUTE, accessinghwe->ipv4.new_tuplefor all three types. However, IPv4 ROUTE (3-tuple) entries do not contain a validnew_tuple— this field is only meaningful for NATted flows (HNAPT/DSLITE). For ROUTE entries, the memory at thenew_tupleoffset holds routing information, not NAT data, so displaying "new=" produces garbage output.Display
new_tupleonly for HNAPT and DSLITE, and letIPV4_ROUTEfall through to the default case.
Quoted 28 lines
Fixes 3fe15c640f38 ("net: airoha: Introduce PPE debugfs support")Signed-off-by Wayen.Yan <[email protected]>- Drop redundant
PPE_PKT_TYPE_IPV4_ROUTEcase, let it fall to default Changes in v2:--- drivers/net/ethernet/airoha/airoha_ppe_debugfs.c | 2 -- 1 file changed, 2 deletions(-)drivers/net/ethernet/airoha/airoha_ppe_debugfs.c +0
-2@@ -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=" );Signature · 1 line
2.51.0
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Fri, 12 Jun 2026 07:09:56 +0800 you wrote:
In
airoha_ppe_debugfs_foe_show(), the second switch statement falls through from PPE_PKT_TYPE_IPV4_HNAPT/DSLITE toPPE_PKT_TYPE_IPV4_ROUTE, accessinghwe->ipv4.new_tuplefor all three types. However, IPv4 ROUTE (3-tuple) entries do not contain a validnew_tuple— this field is only meaningful for NATted flows (HNAPT/DSLITE). For ROUTE entries, the memory at thenew_tupleoffset holds routing information, not NAT data, so displaying "new=" produces garbage output.[...]
Here is the summary with links:
- [v2] net: airoha: Fix debugfs new-tuple display for IPv4 ROUTE entries
https://git.kernel.org/netdev/net/c/1c3a77471afb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html