From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796217320; b=t8UsxUIQ/+4ODarz03DPMNpX7itIFDWeA5XB3DoKiK2ZqT30nefoEp96Pd9UT6Y7jxB0 62rbwX+Y4PPk0K4N1LIAOEoyGcF6haww9kKaEcdhGsreFHoQ9+Y7YaYCxFXvgiOHSA0RT fNCvKubZEA9SwqabZ4S8/vjI7DfDr9GU5mjogA9Hqn/eKiFDQQZvVKhnicC2FIEu+siWm fuu/wA/L1XLyUYnEbkxmQTwCSFpJKv+3YX8udhQ73a0MgAj6VsXx1RN88JgMg5bRBEKPU 6erNDktiOB/vS1gM5ElRVXBVJntLXhwxS5J25PZ8tDWIyst0u6dAsnj9L/QIhhOFRDQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796217320; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=YP+x/QwD7+r1ToH4LqFHxBfjHNt4K8PXBDoY8cz86hc=; b=oTZvfPCxWx253hYPhvijBlTBjF+Pu2M8+8MBhAYnpIiGaw6V09aNiBQc54sxM/GO0KZT CMkUBYorwyk+/pOoUJUMCCaZPPxGoEwCv8TkwsVBMNIlYILC7g5e6vP5c1MOGGV6nTp8F YUuZj8c5KgaexFJxvgwQWty0zDZIt7oetRLp6QYLHbG4S1V1whyo7ICONjx5rOmVMJc5f PtmSc+wi+3XSMGrwx6OUsWUQKhG6+Wo7Uq0xNDDxDgYOOM62ed9Ag1bCjLz2HHXUDi2FI r7MYNdLVRKjvXRTRMbICLBJaBNLxlkZmSx4k9ppNblu33eRwrFPqDBbdGCUblKlE/Pg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=m5rqWMn2; arc=none smtp.remote-ip=209.85.221.46 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5486B606A329 for ; Wed, 2 Dec 2026 13:15:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5486B606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=m5rqWMn2 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-4ad6219f7d8so12001702f8f.0 for ; Wed, 02 Dec 2026 05:15:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796217319; x=1796822119; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=YP+x/QwD7+r1ToH4LqFHxBfjHNt4K8PXBDoY8cz86hc=; b=m5rqWMn23RkrTDVswVR2tAJc3gXP3i5q2NooFK2+ygYCRgdSdUzeGDwRBOGU1ggobh 8C7k8gVvQm/uwMVUIs03uBk2ypQjehHAZvKpjqshMgB5wesIjG3iIgf0PBdSZsizWeNM kDuelpzkgpEdpJdrBYz8823BQbMG14nHPeDYfebQ2DF2uJBvnwC/YqrvJCr025DC2MCF X8b+PtQmbA5t20JyswRlGE8psazhY41qr9VW3IfwQ1uKI0vdvmS7T86e/niyorEYrLIL MjB/wkBPp0S+rtqlHmk01w7VihXW59uPrC7Xh3Tz+Hm2CS/tYu3QLASydmgKqCxxhHUi icIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796217319; x=1796822119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=YP+x/QwD7+r1ToH4LqFHxBfjHNt4K8PXBDoY8cz86hc=; b=JIL4z/pD50yE0GgXR99Du+O9Bgxr0OLen66e59cOdhoHSfCTtG9ttk0sEDNo2pFEnp f06TR6nROAZUGhWNL9yejGW/j0c4x19gUI6CMIeu9aHugJg9SEfcaWny/IhvHIeEa5VP AucTv7uujeYNR3OYdPvmHK6lbugvpsgYQqH4XeJsbld/cH3/f+gW7d2fJ6UP9+JvP+uF sOqDhtVUVZPFyoyFiw/KDlAohx6/XvKsDG5UJwtaUxaO1T32oJvF3cYxAMtryKQPN9lc XhUJnShHQLkO8zlu+824wxg9RKMpJtuF4psithjc7IVVxgU2noi41/aYoIX4/Lp15ifK RUng== X-Forwarded-Encrypted: i=1; AL+hErHZl548TcsbBJJ8P0C/dOcWiHXez6LDW6BISdt8j8ftBsaFSAO+PlrrDVjrSZlYuLWr83KgePEe3aldHAU=@vger.kernel.org X-Gm-Message-State: APuU4Z8gdgZ3Lrvl1uWRThqgha1tzXdSN3fmPNEBfG4yLLcG0IJnty8T wBdkP+z5kiPxrBeokzVpttDguQ+5VzMr07CN5ZRpuO+Ct42kuo1zY5it X-Gm-Gg: AZFdTZc23IryGuWDQuC8ZB1k7zFncrLwp7gsfOm4iZm04xQCqEV2KqOKok6N5PFFx/m CWORWiNUNdrE8M7mpk+JqojSqk2M5dYa3bUh4YUPpxkb88v2J9foQZvOAp5Z01VzMDxxp7eB+7m hMw/1hthr+Bi2mu0RWbDGIYbFaCzJAmTAqXU/jwgdJ7lQqegIiiOrLz1XsCgsHrokdjyvz4j+SX 0yosXA/35gUeWEu6VvU/y8JG3TaYHBWSThEvOWTjWn8+nCEjvIEYI1Nf2qZDxQMxFQz3Kj6byRH S3O22ZToTaPIKp1HPTdZNb2fHxUHoCXjOoL1so55KqoC7O9CkhBpuN8oYwTAjpzyYLJ1KB5sFt3 NniBD8zr06ldJ5GhlhuLDe0wXbk+9lmhygMZCTaydAf0eA46dFtyCe3dumMi8t4W10Ll6GmsFeb N4WoHLsLk8ftw4+A4QZJBINcnCgNjRlZpWc+0W7GijE7SFdAs/mvYRgNJ/QdROn1vpxLn3ij7xo GBWHp1t/ui8RGnT2TKnIAk9OyWWJ58zTkebI5RWvLSBoQXFmJqIC5/1JixFYPLNjAMlsu+LfT+U 8tujCAWS3BAOWMwZbc1Xap3L4HBCOhnkZsyCo10IsLFMXuGWyHauJw== X-Received: by 2002:a05:600c:5493:b0:4a2:8c5:5e5 with SMTP id 5b1f17b1804b1-4bb8881c734mr878804205e9.7.1796217318620; Wed, 02 Dec 2026 05:15:18 -0800 (PST) Received: from center.. ([131.189.143.225]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906d6a13sm676358975e9.3.2026.12.02.05.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 05:15:18 -0800 (PST) From: Orgad Shaneh To: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Orgad Shaneh Subject: [PATCH v2 1/2] MIPS: OCTEON: size PKO_REG_QUEUE_MODE from the fixed queue map Date: Wed, 2 Dec 2026 13:15:14 +0000 Message-ID: <20261202131515.3630964-2-orgads@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261202131515.3630964-1-orgads@gmail.com> References: <20261202131515.3630964-1-orgads@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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