Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1037844pxb; Thu, 4 Mar 2021 01:20:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwLihaeaZh5x1XMdUuR4S6K+v5Y2fS6WufuTo4gc+W38R1senPQk2uqpeNZZZTnBYhDn9I/ X-Received: by 2002:a17:906:d938:: with SMTP id rn24mr3345012ejb.87.1614849654556; Thu, 04 Mar 2021 01:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614849654; cv=none; d=google.com; s=arc-20160816; b=k22amo0aSQviNcUvpUBKYuko/uCrRK5T6KwrnuO+//vZdptP6zbIhrc2jCdbivdqMe otoIk+gy2pv8ENh17ABWZDJGUkCRSkuo+M+oDm0XMLL+FMv8lIe2DCKVrpHC+CIjiFmE Ur2T6RS5nIAHAgSh1cLlZ8H1qo1j1ya3MYDp6UwRBqWH8gcBwMCm5t/XO96KBX10VkXY mHm4MC0/xWUo+SjtnHwhVLma8JlptfE7zxmIgQJxhEznnFBvd5Lv5NTMMTOG/Klc3Qsc 6CeGA3xrYSlCjoYpTJutvOrqQRppd+piXiCa45Z/Z0sCWvoe7YKs3kwWfRR4Fyd1wnju 5mJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Xp2baeS36lOAYQA8MSwbHgKPO2tqhXypAjA1/lvPvwQ=; b=s84e1Avp8/wtEw67drMHCjQI/NVt/GLBRwX1mddHthW204JmfzKNDWgCMYcsSQuDUf PSnwYGlCjQAYX65kINQCEQQ9LQvlVdQS56fLHlBHKR9Nqw1Pf5gIksZNIy8/X6enQfJX n6C/2Hdfzyce+JS0lxMdFppNLH6S7dJ7stYszj/BDmYTHJ6ngAJT+abbyL4SD4P2sLyA ymS9C9xJf/Xpi9WuojNykjWn54NjEfrdb5fpLMN2oLcScAFDCqPHdDJCyD5TsS3cyBvJ vj9nOKaXh/yXdehSCmJhhuGuUV17lhJ/lOz+An7P/GNrMreUGfY18t0US30/AF1jyJNM lzGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si16624034edo.113.2021.03.04.01.20.32; Thu, 04 Mar 2021 01:20:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383615AbhCCOjg (ORCPT + 99 others); Wed, 3 Mar 2021 09:39:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1843008AbhCCKXr (ORCPT ); Wed, 3 Mar 2021 05:23:47 -0500 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 75C59C061D7C for ; Wed, 3 Mar 2021 01:01:10 -0800 (PST) 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 1lHNN5-0001kz-U1; Wed, 03 Mar 2021 10:00:44 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:a20d:2fb6:f2cb:982e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) 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 5D5DC5ECAB8; Wed, 3 Mar 2021 09:00:37 +0000 (UTC) Date: Wed, 3 Mar 2021 10:00:36 +0100 From: Marc Kleine-Budde To: Dario Binacchi Cc: Kurt Van Dijck , linux-kernel@vger.kernel.org, Federico Vaga , Alexander Stein , "David S. Miller" , Jakub Kicinski , Oliver Hartkopp , Vincent Mailhol , Wolfgang Grandegger , YueHaibing , Zhang Qilong , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v3 5/6] can: c_can: prepare to up the message objects number Message-ID: <20210303090036.aocqk6gp3vqnzaku@pengutronix.de> References: <20210228103856.4089-1-dariobin@libero.it> <20210228103856.4089-6-dariobin@libero.it> <20210302184901.GD26930@x1.vandijck-laurijssen.be> <91394876.26757.1614759793793@mail1.libero.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="chi2fdx3hgvidome" Content-Disposition: inline In-Reply-To: <91394876.26757.1614759793793@mail1.libero.it> 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 --chi2fdx3hgvidome Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03.03.2021 09:23:13, Dario Binacchi wrote: [...] > > > @@ -1205,17 +1203,31 @@ static int c_can_close(struct net_device *dev) > > > return 0; > > > } > > > =20 > > > -struct net_device *alloc_c_can_dev(void) > > > +struct net_device *alloc_c_can_dev(int msg_obj_num) > > > { > > > struct net_device *dev; > > > struct c_can_priv *priv; > > > + int msg_obj_tx_num =3D msg_obj_num / 2; > >=20 > > IMO, a bigger tx queue is not usefull. > > A bigger rx queue however is. >=20 > This would not be good for my application. I think it really depends > on the type of application. We can probably say that being able to > size rx/tx queue would be a useful feature. Ok. There is an ethtool interface to configure the size of the RX and TX queues. In ethtool it's called the RX/TX "ring" size and you can get it via the -g parameter, e.g. here for by Ethernet interface: | $ ethtool -g enp0s25 | Ring parameters for enp0s25: | Pre-set maximums: | RX: 4096 | RX Mini: n/a | RX Jumbo: n/a | TX: 4096 | Current hardware settings: | RX: 256 | RX Mini: n/a | RX Jumbo: n/a | TX: 256 If I understand correctly patch 6 has some assumptions that RX and TX are max 32. To support up to 64 RX objects, you have to convert: - u32 -> u64 - BIT() -> BIT_ULL() - GENMASK() -> GENMASK_ULL() The register access has to be converted, too. For performance reasons you want to do as least as possible. Which is probably the most complicated. In the flexcan driver I have a similar problem. The driver keeps masks, which mailboxes are RX and which TX and I added wrapper functions to minimize IO access: https://elixir.bootlin.com/linux/v5.11/source/drivers/net/can/flexcan.c#L904 This should to IMHO into patch 6. Adding the ethtool support and making the rings configurable would be a separate patch. 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 | --chi2fdx3hgvidome Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmA/UDIACgkQqclaivrt 76kC3AgAtJ3JQNxw4L/+OzOaLHFaUh7ws8JUSJaAFPe3N0+kd7lmWDgBWWH5cDTE Yg7w6S05G+6G9QDI+St3fH1UsOSvBLtN5DPF08e3Vh43bxusvYQ9/mpibYu69hw5 C+nkONomqysTM3umXC+Zo+DmlkPPU3VCMPnvLYWGs8ihDxsOFB6VzRgs9g7CPZm+ UExOHqUQIp2CXglXt/UXywnTuVItEQm6R7HJRfVxfO1j3F2QXe5kH0aNugRciDtp cwG9NQq2r2D8Z0eJdWAoKeIxqVoxJvMTjtqnHjy+JswGfEYKEsBzA+s9yBkHNUJr 9KfHhcqds95Y6ZG6xLcaBPSvcLoqKA== =8a5M -----END PGP SIGNATURE----- --chi2fdx3hgvidome--