Skip to content

Commit a0cb76a

Browse files
nithind1988kuba-moo
authored andcommitted
octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2
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: b9d0fed ("octeontx2-af: cn10kb: Add RPM_USX MAC support") Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20240108073036.8766-1-naveenm@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3722a98 commit a0cb76a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

drivers/net/ethernet/marvell/octeontx2/af/rpm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,19 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id)
506506
rpm_t *rpm = rpmd;
507507
u8 num_lmacs;
508508
u32 fifo_len;
509+
u16 max_lmac;
509510

510511
lmac_info = rpm_read(rpm, 0, RPM2_CMRX_RX_LMACS);
511512
/* LMACs are divided into two groups and each group
512513
* gets half of the FIFO
513514
* Group0 lmac_id range {0..3}
514515
* Group1 lmac_id range {4..7}
515516
*/
516-
fifo_len = rpm->mac_ops->fifo_len / 2;
517+
max_lmac = (rpm_read(rpm, 0, CGX_CONST) >> 24) & 0xFF;
518+
if (max_lmac > 4)
519+
fifo_len = rpm->mac_ops->fifo_len / 2;
520+
else
521+
fifo_len = rpm->mac_ops->fifo_len;
517522

518523
if (lmac_id < 4) {
519524
num_lmacs = hweight8(lmac_info & 0xF);

0 commit comments

Comments
 (0)