mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: airoha: ppe: Flush PPE SRAM table during PPE setup
Rely on airoha_ppe_foe_commit_sram_entry routine to flush SRAM PPE table entries. This patch allow moving PPE SRAM flush during PPE setup and avoid dumping uninitialized values via the debugfs if no entries are offloaded yet. Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20251017-an7583-eth-support-v3-9-f28319666667@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
306b78f503
commit
620d7b91aa
@@ -1291,18 +1291,22 @@ static int airoha_ppe_flow_offload_cmd(struct airoha_eth *eth,
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static int airoha_ppe_flush_sram_entries(struct airoha_ppe *ppe,
|
||||
struct airoha_npu *npu)
|
||||
static int airoha_ppe_flush_sram_entries(struct airoha_ppe *ppe)
|
||||
{
|
||||
u32 sram_num_entries = airoha_ppe_get_total_sram_num_entries(ppe);
|
||||
struct airoha_foe_entry *hwe = ppe->foe;
|
||||
int i;
|
||||
int i, err = 0;
|
||||
|
||||
for (i = 0; i < sram_num_entries; i++) {
|
||||
int err;
|
||||
|
||||
for (i = 0; i < PPE_SRAM_NUM_ENTRIES; i++)
|
||||
memset(&hwe[i], 0, sizeof(*hwe));
|
||||
err = airoha_ppe_foe_commit_sram_entry(ppe, i);
|
||||
if (err)
|
||||
break;
|
||||
}
|
||||
|
||||
return npu->ops.ppe_flush_sram_entries(npu, ppe->foe_dma,
|
||||
sram_num_entries);
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct airoha_npu *airoha_ppe_npu_get(struct airoha_eth *eth)
|
||||
@@ -1339,10 +1343,6 @@ static int airoha_ppe_offload_setup(struct airoha_eth *eth)
|
||||
}
|
||||
|
||||
airoha_ppe_hw_init(ppe);
|
||||
err = airoha_ppe_flush_sram_entries(ppe, npu);
|
||||
if (err)
|
||||
goto error_npu_put;
|
||||
|
||||
airoha_ppe_foe_flow_stats_reset(ppe, npu);
|
||||
|
||||
rcu_assign_pointer(eth->npu, npu);
|
||||
@@ -1513,6 +1513,10 @@ int airoha_ppe_init(struct airoha_eth *eth)
|
||||
if (!ppe->foe_check_time)
|
||||
return -ENOMEM;
|
||||
|
||||
err = airoha_ppe_flush_sram_entries(ppe);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = rhashtable_init(ð->flow_table, &airoha_flow_table_params);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
Reference in New Issue
Block a user