From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B830AD3E196 for ; Mon, 21 Oct 2024 17:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=84FFr9VQLa1SJol6stO39srQY57ZOMWmg6GfF4bl0Us=; b=goFMdI68K+hYRbklgn9qBOj17M 2ScbPWp5s8DVUtqEY159+3u/e8WO8J7yrXdJ3WG16cv/aGZrk2ZIQJ+zFDwQof56A7s+ryTJxITz7 257nyvC5PUkrDfoelpdug6ft/goj0ek72B3YE+07PFYz0dKo2W1n/W6zT1x8Ig/dStzJP4fAwzeSZ OSuhGl8VQ1H1jeqJ4ND4Y9NPl8X0N+Jqu3CZ+pisA1TQ6vEFJCZsMt+KXE1v4yy3dkKPWFX24wovU vyQn8tkPr+2xSiouvcHx50gI5t69amX9MA7iPxuNHxDoS65io6OzJztZIaMucyn8QQp+olEmeLrja jeqg5Gmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2wan-00000008BNo-1jMO; Mon, 21 Oct 2024 17:53:21 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2wZG-00000008B7B-3GTk for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 17:51:49 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id CFD1C60002; Mon, 21 Oct 2024 17:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1729533103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=84FFr9VQLa1SJol6stO39srQY57ZOMWmg6GfF4bl0Us=; b=CSNYIcgRmuuf08U+jaMLL6qq0AiUL/Z4S1vC02DdI1FXjOR64SayRr+x7k9BC9lcFlK/km hsl+yo3Nwh+uRbatrh3kzZi2uoeajKSASH4MFRfolP+K8qlczqY4yOtmEMTVoSoxnKS4vW tC+vkXIeKPBKV2IXi86CvQl7IWDmF49EZJMce4g4/fa8yUFP1H4kvEPUzgEn+klaGTqtKG PHxVmg/QJpc2tGb32YR8mcbmyCO3XS9xxrebS9xwEuS94gu2j77OHj/3o1AS3uyUfzM0r7 3/CUqn3C/gbKdm8ytb88wU/9TbRz2YyDiKhQ300627px+w0yPYL0ylcq1x5Tiw== Date: Mon, 21 Oct 2024 19:51:40 +0200 From: Maxime Chevallier To: Daniel Machon Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , Lars Povlsen , Steen Hegelund , , , , , , Richard Cochran , Rob Herring , Krzysztof Kozlowski , Conor Dooley , , , , , , Subject: Re: [PATCH net-next 11/15] net: lan969x: add function for calculating the DSM calendar Message-ID: <20241021195140.442c0a4f@device-21.home> In-Reply-To: <20241021-sparx5-lan969x-switch-driver-2-v1-11-c8c49ef21e0f@microchip.com> References: <20241021-sparx5-lan969x-switch-driver-2-v1-0-c8c49ef21e0f@microchip.com> <20241021-sparx5-lan969x-switch-driver-2-v1-11-c8c49ef21e0f@microchip.com> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_105147_049327_B7738742 X-CRM114-Status: GOOD ( 15.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Daniel, On Mon, 21 Oct 2024 15:58:48 +0200 Daniel Machon wrote: > Lan969x has support for RedBox / HSR / PRP (not implemented yet). In > order to accommodate for this in the future, we need to give lan969x it's > own function for calculating the DSM calendar. > > The function calculates the calendar for each taxi bus. The calendar is > used for bandwidth allocation towards the ports attached to the taxi > bus. A calendar configuration consists of up-to 64 slots, which may be > allocated to ports or left unused. Each slot accounts for 1 clock cycle. > > Also expose sparx5_cal_speed_to_value(), sparx5_get_port_cal_speed, > sparx5_cal_bw and SPX5_DSM_CAL_EMPTY for use by lan969x. > > Reviewed-by: Steen Hegelund > Signed-off-by: Daniel Machon [...] > + /* Place the remaining devices */ > + for (u32 i = 0; i < DSM_CAL_DEV_MAX; i++) { > + speed = &dev_speeds[i]; > + for (u32 dev = 0; dev < speed->n_devs; dev++) { > + u32 idx = 0; > + > + for (n_slots = 0; n_slots < speed->n_slots; n_slots++) { > + lan969x_dsm_cal_idx_find_next_free(data->schedule, > + cal_len, > + &idx); You're not checking the return of lan969x_dsm_cal_idx_find_next_free(), can this be a problem ? Thanks, Maxime