* [PATCH v2 0/2] MIPS: OCTEON: PKO_REG_QUEUE_MODE on CN63XX and CN66XX
@ 2026-12-02 13:15 Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 2/2] MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
0 siblings, 2 replies; 3+ messages in thread
From: Orgad Shaneh @ 2026-12-02 13:15 UTC (permalink / raw)
To: tsbogend; +Cc: linux-mips, linux-kernel, Orgad Shaneh
cvmx_pko_initialize_global() sizes the PKO's local command storage from
the number of queues in use. It leaves CN63XX and CN66XX out, and it
counts the queues before the interfaces are probed.
1/2 takes the count from the fixed queue map, which does not depend on
the probe.
2/2 adds CN63XX and CN66XX. Without it, the PKO on a CN6635 (CN66XX)
stopped sending under heavy load.
Changes since v1:
https://lore.kernel.org/r/20261201042313.3010724-1-orgads@gmail.com
- v1 1/2 is now two patches; the count fix (1/2) is new.
- v1 2/2, the device-tree prune fix, is unrelated and is sent on its
own.
Applies to torvalds/master and mips-next, where this file is unchanged.
An LLM helped write these patches.
Orgad Shaneh (2):
MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map
MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX
arch/mips/cavium-octeon/executive/cvmx-pko.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map
2026-12-02 13:15 [PATCH v2 0/2] MIPS: OCTEON: PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
@ 2026-12-02 13:15 ` Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 2/2] MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
1 sibling, 0 replies; 3+ messages in thread
From: Orgad Shaneh @ 2026-12-02 13:15 UTC (permalink / raw)
To: tsbogend; +Cc: linux-mips, linux-kernel, Orgad Shaneh
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@gmail.com>
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX
2026-12-02 13:15 [PATCH v2 0/2] MIPS: OCTEON: PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map Orgad Shaneh
@ 2026-12-02 13:15 ` Orgad Shaneh
1 sibling, 0 replies; 3+ messages in thread
From: Orgad Shaneh @ 2026-12-02 13:15 UTC (permalink / raw)
To: tsbogend; +Cc: linux-mips, linux-kernel, Orgad Shaneh
cvmx_pko_initialize_global() sets PKO_REG_QUEUE_MODE only on CN38XX,
CN58XX, CN56XX and CN52XX. On CN63XX and CN66XX it stays 0, and the PKO
splits its local command storage over all 256 queues, 8 words each.
On a CN6635 (CN66XX) the PKO then latched PKO_REG_ERROR[CURRZERO] after
3 to 15 minutes of heavy traffic and stopped sending. With mode 2 (64
queues, 32 words each) the same load ran clean.
The Cavium SDK sets the mode on these chips too, with the same
thresholds.
This needs the previous patch: on CN66XX the last interface has no IPD
port, so the old count would be negative.
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
v2:
- The queue count fix is now the previous patch.
- Shorter commit message.
- v1 was 1/2 of a series with an unrelated device-tree fix, which is
now sent on its own:
https://lore.kernel.org/r/20261201042313.3010724-2-orgads@gmail.com
Tested on a CN6635 (CN66XX) board with a 7.3.7 kernel, both patches
applied: the register reads 2, as with v1. With 8 queues per port on
interfaces 0 and 1 (72 queues, a local change) it reads 1, and the load
ran clean. The transmit path that triggered the hang 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.
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 b1b0a8a985d9..6fd5c3a924e5 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)) {
/*
* This runs before the interfaces are probed, so their
* port counts are still zero here. The queue numbers come
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-02 13:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-02 13:15 [PATCH v2 0/2] MIPS: OCTEON: PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map Orgad Shaneh
2026-12-02 13:15 ` [PATCH v2 2/2] MIPS: OCTEON: set PKO_REG_QUEUE_MODE on CN63XX and CN66XX Orgad Shaneh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®