* [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration
@ 2024-10-01 10:10 Lorenzo Bianconi
2024-10-01 10:10 ` [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating Lorenzo Bianconi
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2024-10-01 10:10 UTC (permalink / raw)
To: Lorenzo Bianconi, Felix Fietkau, Sean Wang, Mark Lee,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-arm-kernel, linux-mediatek, netdev, Simon Horman, upstream
Align PSE memory configuration to vendor SDK.
Increase initial value of PSE reserved memory in
airoha_fe_pse_ports_init() by the value used for the second Packet
Processor Engine (PPE2).
Do not overwrite the default value for the number of PSE reserved pages
in airoha_fe_set_pse_oq_rsv().
Post this series to net-next since these are not issues visible to the
user.
---
Changes in v2:
- fixed commit logs
- Link to v1: https://lore.kernel.org/r/20240930-airoha-eth-pse-fix-v1-0-f41f2f35abb9@kernel.org
---
Lorenzo Bianconi (2):
net: airoha: read default PSE reserved pages value before updating
net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init()
drivers/net/ethernet/mediatek/airoha_eth.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
---
base-commit: c824deb1a89755f70156b5cdaf569fca80698719
change-id: 20240923-airoha-eth-pse-fix-f303134e0ccf
Best regards,
--
Lorenzo Bianconi <lorenzo@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating
2024-10-01 10:10 [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration Lorenzo Bianconi
@ 2024-10-01 10:10 ` Lorenzo Bianconi
2024-10-03 13:32 ` Simon Horman
2024-10-01 10:10 ` [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init() Lorenzo Bianconi
2024-10-04 17:00 ` [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Lorenzo Bianconi @ 2024-10-01 10:10 UTC (permalink / raw)
To: Lorenzo Bianconi, Felix Fietkau, Sean Wang, Mark Lee,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-arm-kernel, linux-mediatek, netdev, Simon Horman, upstream
Store the default value for the number of PSE reserved pages in orig_val
at the beginning of airoha_fe_set_pse_oq_rsv routine, before updating it
with airoha_fe_set_pse_queue_rsv_pages().
Introduce airoha_fe_get_pse_all_rsv utility routine.
Introduced by commit 23020f049327 ("net: airoha: Introduce ethernet support
for EN7581 SoC")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/mediatek/airoha_eth.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/airoha_eth.c b/drivers/net/ethernet/mediatek/airoha_eth.c
index 930f180688e5..480540526bdb 100644
--- a/drivers/net/ethernet/mediatek/airoha_eth.c
+++ b/drivers/net/ethernet/mediatek/airoha_eth.c
@@ -1116,17 +1116,23 @@ static void airoha_fe_set_pse_queue_rsv_pages(struct airoha_eth *eth,
PSE_CFG_WR_EN_MASK | PSE_CFG_OQRSV_SEL_MASK);
}
+static u32 airoha_fe_get_pse_all_rsv(struct airoha_eth *eth)
+{
+ u32 val = airoha_fe_rr(eth, REG_FE_PSE_BUF_SET);
+
+ return FIELD_GET(PSE_ALLRSV_MASK, val);
+}
+
static int airoha_fe_set_pse_oq_rsv(struct airoha_eth *eth,
u32 port, u32 queue, u32 val)
{
- u32 orig_val, tmp, all_rsv, fq_limit;
+ u32 orig_val = airoha_fe_get_pse_queue_rsv_pages(eth, port, queue);
+ u32 tmp, all_rsv, fq_limit;
airoha_fe_set_pse_queue_rsv_pages(eth, port, queue, val);
/* modify all rsv */
- orig_val = airoha_fe_get_pse_queue_rsv_pages(eth, port, queue);
- tmp = airoha_fe_rr(eth, REG_FE_PSE_BUF_SET);
- all_rsv = FIELD_GET(PSE_ALLRSV_MASK, tmp);
+ all_rsv = airoha_fe_get_pse_all_rsv(eth);
all_rsv += (val - orig_val);
airoha_fe_rmw(eth, REG_FE_PSE_BUF_SET, PSE_ALLRSV_MASK,
FIELD_PREP(PSE_ALLRSV_MASK, all_rsv));
--
2.46.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init()
2024-10-01 10:10 [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration Lorenzo Bianconi
2024-10-01 10:10 ` [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating Lorenzo Bianconi
@ 2024-10-01 10:10 ` Lorenzo Bianconi
2024-10-03 13:32 ` Simon Horman
2024-10-04 17:00 ` [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Lorenzo Bianconi @ 2024-10-01 10:10 UTC (permalink / raw)
To: Lorenzo Bianconi, Felix Fietkau, Sean Wang, Mark Lee,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-arm-kernel, linux-mediatek, netdev, Simon Horman, upstream
Align PSE memory configuration to vendor SDK. In particular, increase
initial value of PSE reserved memory in airoha_fe_pse_ports_init()
routine by the value used for the second Packet Processor Engine (PPE2)
and do not overwrite the default value.
Introduced by commit 23020f049327 ("net: airoha: Introduce ethernet support
for EN7581 SoC")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
drivers/net/ethernet/mediatek/airoha_eth.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/airoha_eth.c b/drivers/net/ethernet/mediatek/airoha_eth.c
index 480540526bdb..2e01abc70c17 100644
--- a/drivers/net/ethernet/mediatek/airoha_eth.c
+++ b/drivers/net/ethernet/mediatek/airoha_eth.c
@@ -1172,11 +1172,13 @@ static void airoha_fe_pse_ports_init(struct airoha_eth *eth)
[FE_PSE_PORT_GDM4] = 2,
[FE_PSE_PORT_CDM5] = 2,
};
+ u32 all_rsv;
int q;
+ all_rsv = airoha_fe_get_pse_all_rsv(eth);
/* hw misses PPE2 oq rsv */
- airoha_fe_set(eth, REG_FE_PSE_BUF_SET,
- PSE_RSV_PAGES * pse_port_num_queues[FE_PSE_PORT_PPE2]);
+ all_rsv += PSE_RSV_PAGES * pse_port_num_queues[FE_PSE_PORT_PPE2];
+ airoha_fe_set(eth, REG_FE_PSE_BUF_SET, all_rsv);
/* CMD1 */
for (q = 0; q < pse_port_num_queues[FE_PSE_PORT_CDM1]; q++)
--
2.46.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating
2024-10-01 10:10 ` [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating Lorenzo Bianconi
@ 2024-10-03 13:32 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2024-10-03 13:32 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Felix Fietkau, Sean Wang, Mark Lee, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
netdev, upstream
On Tue, Oct 01, 2024 at 12:10:24PM +0200, Lorenzo Bianconi wrote:
> Store the default value for the number of PSE reserved pages in orig_val
> at the beginning of airoha_fe_set_pse_oq_rsv routine, before updating it
> with airoha_fe_set_pse_queue_rsv_pages().
> Introduce airoha_fe_get_pse_all_rsv utility routine.
>
> Introduced by commit 23020f049327 ("net: airoha: Introduce ethernet support
> for EN7581 SoC")
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init()
2024-10-01 10:10 ` [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init() Lorenzo Bianconi
@ 2024-10-03 13:32 ` Simon Horman
0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2024-10-03 13:32 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: Felix Fietkau, Sean Wang, Mark Lee, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
netdev, upstream
On Tue, Oct 01, 2024 at 12:10:25PM +0200, Lorenzo Bianconi wrote:
> Align PSE memory configuration to vendor SDK. In particular, increase
> initial value of PSE reserved memory in airoha_fe_pse_ports_init()
> routine by the value used for the second Packet Processor Engine (PPE2)
> and do not overwrite the default value.
>
> Introduced by commit 23020f049327 ("net: airoha: Introduce ethernet support
> for EN7581 SoC")
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration
2024-10-01 10:10 [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration Lorenzo Bianconi
2024-10-01 10:10 ` [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating Lorenzo Bianconi
2024-10-01 10:10 ` [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init() Lorenzo Bianconi
@ 2024-10-04 17:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-04 17:00 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: nbd, sean.wang, Mark-MC.Lee, davem, edumazet, kuba, pabeni,
matthias.bgg, angelogioacchino.delregno, linux-arm-kernel,
linux-mediatek, netdev, horms, upstream
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 01 Oct 2024 12:10:23 +0200 you wrote:
> Align PSE memory configuration to vendor SDK.
> Increase initial value of PSE reserved memory in
> airoha_fe_pse_ports_init() by the value used for the second Packet
> Processor Engine (PPE2).
> Do not overwrite the default value for the number of PSE reserved pages
> in airoha_fe_set_pse_oq_rsv().
> Post this series to net-next since these are not issues visible to the
> user.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] net: airoha: read default PSE reserved pages value before updating
https://git.kernel.org/netdev/net-next/c/1f3e7ff4f296
- [net-next,v2,2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init()
https://git.kernel.org/netdev/net-next/c/8e38e08f2c56
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-10-04 17:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-01 10:10 [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration Lorenzo Bianconi
2024-10-01 10:10 ` [PATCH net-next v2 1/2] net: airoha: read default PSE reserved pages value before updating Lorenzo Bianconi
2024-10-03 13:32 ` Simon Horman
2024-10-01 10:10 ` [PATCH net-next v2 2/2] net: airoha: fix PSE memory configuration in airoha_fe_pse_ports_init() Lorenzo Bianconi
2024-10-03 13:32 ` Simon Horman
2024-10-04 17:00 ` [PATCH net-next v2 0/2] net: airoha: Fix PSE memory configuration patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).