[PATCH 1/2] MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX

From: Orgad Shaneh

Date: Mon Nov 30 2026 - 23:23:22 EST


cvmx_pko_initialize_global() sets PKO_REG_QUEUE_MODE from the number of
queues in use, but only on CN38XX, CN58XX, CN56XX and CN52XX. On CN63XX
and CN66XX the register keeps its reset value of 0. The PKO then splits
its local command storage over all 256 queues, 8 words each, however
few queues the system actually uses.

On a CN6635 (CN66XX) this breaks transmit under load. With one queue per
port shared by all cores, and the PKO freeing the sent buffers itself,
the PKO latched PKO_REG_ERROR[CURRZERO] after 3 to 15 minutes of heavy
traffic and stopped sending. A dump at that point showed an engine
holding command words from the neighbouring queue's stream, while
the command buffers in memory and the doorbell counts were correct.

With the mode set to 2 (up to 64 queues, 32 words each) the same load
ran three times for 20 minutes without an error.

The Cavium SDK that this file comes from includes CN63XX and CN66XX in
this check, with the same thresholds. Do the same here.

Signed-off-by: Orgad Shaneh <orgads@xxxxxxxxx>
---
Tested on a CN6635 (CN66XX) board with a 7.3.4 kernel. The transmit
path that triggered it is ours, out of tree: it hands buffers to the
PKO to free, which mainline's octeon-ethernet does only when it reuses
skbs. CN63XX is by inspection only; the SDK treats it the same way.

Applies to torvalds/master and mips-next, where this file is unchanged.
An LLM helped write this patch.

arch/mips/cavium-octeon/executive/cvmx-pko.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index b0199d5..b98b7e6 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -208,7 +208,9 @@ 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)) {
+ || OCTEON_IS_MODEL(OCTEON_CN52XX)
+ || OCTEON_IS_MODEL(OCTEON_CN63XX)
+ || OCTEON_IS_MODEL(OCTEON_CN66XX)) {
int num_interfaces = cvmx_helper_get_number_of_interfaces();
int last_port =
cvmx_helper_get_last_ipd_port(num_interfaces - 1);
--
2.47.0