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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B598C433F5 for ; Tue, 3 May 2022 06:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbiECGuU (ORCPT ); Tue, 3 May 2022 02:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbiECGuT (ORCPT ); Tue, 3 May 2022 02:50:19 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D71C73701F for ; Mon, 2 May 2022 23:46:46 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlmIq-00058T-Bn; Tue, 03 May 2022 08:46:32 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id E808F7455F; Tue, 3 May 2022 06:46:27 +0000 (UTC) Date: Tue, 3 May 2022 08:46:26 +0200 From: Marc Kleine-Budde To: Andrew Dennison Cc: Pavel Pisa , linux-can@vger.kernel.org, Oliver Hartkopp , Wolfgang Grandegger , David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Marin Jerabek , Ondrej Ille , Jiri Novak , Jaroslav Beran , Petr Porazil , Pavel Machek , Carsten Emde , Drew Fustini , Matej Vasilevski Subject: Re: [PATCH v1 0/4] can: ctucanfd: clenup acoording to the actual rules and documentation linking Message-ID: <20220503064626.lcc7nl3rze5txive@pengutronix.de> References: <20220428072239.kfgtu2bfcud6tetc@pengutronix.de> <202204292331.28980.pisa@cmp.felk.cvut.cz> <20220502072151.j6nx5kddqxeyfy3h@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cyyqri6cnwnql6qc" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --cyyqri6cnwnql6qc Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03.05.2022 16:32:32, Andrew Dennison wrote: > > > When value is configurable then for (uncommon) number > > > of buffers which is not power of two, there will be likely > > > a problem with way how buffers queue is implemented > > >=20 > Only power of 2 makes sense to me: I didn't consider those corner > cases but the driver could just round down to the next power of 2 and > warn about a misconfiguration of the IP core. +1 > I added the dynamic detection because the IP core default had changed > to 2 TX buffers and this broke some hard coded assumptions in the > driver in a rather obscure way that had me debugging for a bit... The mainline driver uses a hard coded default of 4 still... Can you provide that patch soonish? > > You can make use of more TX buffers, if you implement (fully > > hardware based) TX IRQ coalescing (=3D=3D handle more than one TX > > complete interrupt at a time) like in the mcp251xfd driver, or BQL > > support (=3D=3D send more than one TX CAN frame at a time). I've played > > a bit with BQL support on the mcp251xfd driver (which is attached by > > SPI), but with mixed results. Probably an issue with proper > > configuration. >=20 > Reducing CAN IRQ load would be good. IRQ coalescing comes at the price of increased latency, but if you have a timeout in hardware you can configure the latencies precisely. > > > We need 2 * priv->ntxbufs range to distinguish empty and full > > > queue... But modulo is not nice either so I probably come with > > > some other solution in a longer term. In the long term, I want to > > > implement virtual queues to allow multiqueue to use dynamic Tx > > > priority of up to 8 the buffers... > > > > ACK, multiqueue TX support would be nice for things like the > > Earliest TX Time First scheduler (ETF). 1 TX queue for ETF, the > > other for bulk messages. >=20 > Would be nice, I have multi-queue in the CAN layer I wrote for a > little RTOS (predates socketcan) and have used for a while. Out of interest: What are the use cases? How did you decide which queue to use? regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --cyyqri6cnwnql6qc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmJwz78ACgkQrX5LkNig 010bsQf+MXL6+dSa0vRSipAheKxPJvKrSi8rwE+DztN4k+WRuAuFTxjMr0yg/cZC lxE8J6WmpiSQs+sXFvACYeeLnYtcQpMHc6xvYZZozyJPNetRgkXURby1k/+KJP5U CGvrdjG8G43DioIVcob7gETJ1j28xUW3kCflFgui5o/VmmtRNBhstRBboKf2ORsJ 6DvzmPgeSfos9rVkqtXsP1HtUDZRnBrI6wW8RzCGx0/YLQIadBYspu4IN7zVmWiy WUNR5yLYY3l2rYCmWKDVgMqoXAAwKMZs3pj4AV+58RKjCBMhainOb6v/9GT33NGy Y8UTeBdFSr6v53uivxqxE1wOwyM5NA== =rpae -----END PGP SIGNATURE----- --cyyqri6cnwnql6qc--