]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: airoha: Add missing PPE configurations in airoha_ppe_hw_init()
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 12 Apr 2026 08:43:26 +0000 (10:43 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 14 Apr 2026 13:16:29 +0000 (15:16 +0200)
Add the following PPE configuration in airoha_ppe_hw_init routine:
- 6RD hw offloading is currently not supported by Netfilter flowtable.
  Disable explicitly PPE 6RD offloading in order to prevent PPE to learn
  6RD flows and eventually interrupt the traffic.
- Add missing PPE bind rate configuration for L3 and L2 traffic.
  PPE bind rate configuration specifies the pps threshold to move a PPE
  entry state from UNBIND to BIND. Without this configuration this value
  is random.
- Set ageing thresholds to the values used in the vendor SDK in order to
  improve connection stability under load and avoid packet loss caused by
  fast aging.

Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260412-airoha_ppe_hw_init-missing-bits-v1-1-06ac670819e3@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/airoha/airoha_ppe.c

index c2c32b6833df94031101913807147a7a04343bad..62cfffb4f0e55251f2ddef0d07cc0ed2d66144bb 100644 (file)
@@ -111,13 +111,13 @@ static void airoha_ppe_hw_init(struct airoha_ppe *ppe)
                airoha_fe_rmw(eth, REG_PPE_BND_AGE0(i),
                              PPE_BIND_AGE0_DELTA_NON_L4 |
                              PPE_BIND_AGE0_DELTA_UDP,
-                             FIELD_PREP(PPE_BIND_AGE0_DELTA_NON_L4, 1) |
-                             FIELD_PREP(PPE_BIND_AGE0_DELTA_UDP, 12));
+                             FIELD_PREP(PPE_BIND_AGE0_DELTA_NON_L4, 60) |
+                             FIELD_PREP(PPE_BIND_AGE0_DELTA_UDP, 60));
                airoha_fe_rmw(eth, REG_PPE_BND_AGE1(i),
                              PPE_BIND_AGE1_DELTA_TCP_FIN |
                              PPE_BIND_AGE1_DELTA_TCP,
                              FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP_FIN, 1) |
-                             FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP, 7));
+                             FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP, 60));
 
                airoha_fe_rmw(eth, REG_PPE_TB_HASH_CFG(i),
                              PPE_SRAM_TABLE_EN_MASK |
@@ -145,7 +145,15 @@ static void airoha_ppe_hw_init(struct airoha_ppe *ppe)
                              FIELD_PREP(PPE_DRAM_TB_NUM_ENTRY_MASK,
                                         dram_num_entries));
 
+               airoha_fe_rmw(eth, REG_PPE_BIND_RATE(i),
+                             PPE_BIND_RATE_L2B_BIND_MASK |
+                             PPE_BIND_RATE_BIND_MASK,
+                             FIELD_PREP(PPE_BIND_RATE_L2B_BIND_MASK, 0x1e) |
+                             FIELD_PREP(PPE_BIND_RATE_BIND_MASK, 0x1e));
+
                airoha_fe_wr(eth, REG_PPE_HASH_SEED(i), PPE_HASH_SEED);
+               airoha_fe_clear(eth, REG_PPE_PPE_FLOW_CFG(i),
+                               PPE_FLOW_CFG_IP6_6RD_MASK);
 
                for (p = 0; p < ARRAY_SIZE(eth->ports); p++)
                        airoha_fe_rmw(eth, REG_PPE_MTU(i, p),