Skip to contentSkip to conversation

octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2

PATCH Applied Naveen Mamindlapalli 3 participants 3 messages Jan 8, 2024 – Jan 12, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2

From: Nithin Dabilpuram <[email protected]>

RPM0 and RPM1 on the CN10KB SoC have 8 LMACs each, whereas RPM2 has only 4 LMACs. Similarly, the RPM0 and RPM1 have 256KB FIFO, whereas RPM2 has 128KB FIFO. This patch fixes an issue with improper TX credit programming for the RPM2 link.

Fixes b9d0fedc6234 ("octeontx2-af: cn10kb: Add RPM_USX MAC support")

---
v2:
- Added Fixes tag

 drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +6 -1
index 4728ba34b0e3..76218f1cb459 100644
@@ -506,6 +506,7 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)
 	rpm_t *rpm = rpmd;
 	u8 num_lmacs;
 	u32 fifo_len;
+	u16 max_lmac;
 
 	lmac_info = rpm_read(rpm, 0, RPM2_CMRX_RX_LMACS);
 	/* LMACs are divided into two groups and each group
@@ -513,7 +514,11 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)
 	 * Group0 lmac_id range {0..3}
 	 * Group1 lmac_id range {4..7}
 	 */
-	fifo_len = rpm->mac_ops->fifo_len / 2;
+	max_lmac = (rpm_read(rpm, 0, CGX_CONST) >> 24) & 0xFF;
+	if (max_lmac > 4)
+		fifo_len = rpm->mac_ops->fifo_len / 2;
+	else
+		fifo_len = rpm->mac_ops->fifo_len;
 
 	if (lmac_id < 4) {
 		num_lmacs = hweight8(lmac_info & 0xF);
Signature · 1 line
2.39.0.198.ga38d39a4c5
reviewer Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Naveen Mamindlapalli

From: Nithin Dabilpuram <[email protected]>

RPM0 and RPM1 on the CN10KB SoC have 8 LMACs each, whereas RPM2 has only 4 LMACs. Similarly, the RPM0 and RPM1 have 256KB FIFO, whereas RPM2 has 128KB FIFO. This patch fixes an issue with improper TX credit programming for the RPM2 link.

Quoted 6 lines
Fixes b9d0fedc6234 ("octeontx2-af: cn10kb: Add RPM_USX MAC support")

---
v2:
- Added Fixes tag

Thanks for the update.

#2 lore raw
In reply to Naveen Mamindlapalli
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 8 lines · On Mon, 8 Jan 2024 13:00:36 +0530 you wrote:

From: Nithin Dabilpuram <[email protected]>

RPM0 and RPM1 on the CN10KB SoC have 8 LMACs each, whereas RPM2 has only 4 LMACs. Similarly, the RPM0 and RPM1 have 256KB FIFO, whereas RPM2 has 128KB FIFO. This patch fixes an issue with improper TX credit programming for the RPM2 link.

[...]

Here is the summary with links:
- [net,v2] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2

    https://git.kernel.org/netdev/net/c/a0cb76a77008

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html