[PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map
From: Orgad Shaneh
Date: Wed Dec 02 2026 - 08:15:25 EST
cvmx_pko_initialize_global() sets PKO_REG_QUEUE_MODE from the number of
queues in use, taken from the last port of the last interface. It runs
before the interfaces are probed, so every port count is still 0 and
the queues of the last interface are not counted.
The queue numbers come from a fixed map, so take the count from the
last PKO port instead.
CN38XX now counts its PCI ports too, and gets the 64-queue mode instead
of the 32-queue one. CN58XX, CN56XX and CN52XX keep their mode.
Signed-off-by: Orgad Shaneh <orgads@xxxxxxxxx>
---
v2:
- New patch, split out of v1 1/2. v1 kept the old count, from the last
port of the last interface, which is read before the interfaces are
probed.
CN38XX is by inspection only.
arch/mips/cavium-octeon/executive/cvmx-pko.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index b0199d5cb551..b1b0a8a985d9 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -209,9 +209,13 @@ void cvmx_pko_initialize_global(void)
if (OCTEON_IS_MODEL(OCTEON_CN38XX) || OCTEON_IS_MODEL(OCTEON_CN58XX)
|| OCTEON_IS_MODEL(OCTEON_CN56XX)
|| OCTEON_IS_MODEL(OCTEON_CN52XX)) {
- int num_interfaces = cvmx_helper_get_number_of_interfaces();
- int last_port =
- cvmx_helper_get_last_ipd_port(num_interfaces - 1);
+ /*
+ * This runs before the interfaces are probed, so their
+ * port counts are still zero here. The queue numbers come
+ * from a fixed map, so size the mode from the last PKO
+ * port: no queue in use lies beyond that port's queues.
+ */
+ int last_port = CVMX_PKO_NUM_OUTPUT_PORTS - 1;
int max_queues =
cvmx_pko_get_base_queue(last_port) +
cvmx_pko_get_num_queues(last_port);
--
2.53.0