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 A8762C2BD09 for ; Sat, 6 Jul 2024 12:58:36 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u2DfsvH/AqGx/pjlamisY+uKro5IpS7i/qNUkWDaM5k=; b=HMAoZG3I2KS0XfIL0y6hF5tTUZ AJo4pDUKYc9Cu8VtzIVojnBxbDyQEleCOexB6TvzQCJCGhya1SrJ8tDt77FgSX17tg+PXA9+5/I+3 MRmwPsTUpi6Sw5lPf2F0EIW6+0MtWDIRN7EwFqWL7rM1Ckrr+qEmLNTBIFgJzSqHRWMp2jyviCy+7 Runzn/3PLuD1I0KMCXae9FKNwlCLAnBHn63IlMz0VZCDSaEO19O15C7vDC7jsJvbwE8DuZ/e/Rgb1 VbgAN68KE1qk0thfp0qxiOA7VtvVIGb3dH1U0OLnRLbtv3KiW/DiUblVo/QQvELbJybyyU2wc/SCN Si2P+Xjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ4zg-00000000EdX-3Wnz; Sat, 06 Jul 2024 12:58:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ4zS-00000000Eb3-10bH for linux-arm-kernel@lists.infradead.org; Sat, 06 Jul 2024 12:58:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F31A861B45; Sat, 6 Jul 2024 12:58:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B385C3277B; Sat, 6 Jul 2024 12:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720270688; bh=4i+n6jLTfRQb5qAWWBPB966ZtbRLERn012w742IXk4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JL1PmJgBQEE+L1HdW7mi2M0tjGNixcBcuePxq+x3oZLpJfaGQMfoIJO2Q83eBpYzr KPgSohB7RUP5i4ejkTHwddzZdV9jW9Uq6CP7k6+bTVGKi7407HBJ2sLX8VX519Mr60 zO8vRBYBv0byZjPb4s3RRltqAZa6/o9k5glB9BkBdhCRTlCzGwORKB1seUqfUoArBC dzkE5GjbCHdnh8uhFU8SL6dWqL0G1rrGJwFpT3Xek8tuAERNsZ2kT8j9CYtUCXFoFb jXP6icGtm/S89mpvAIzLbH7FsGtriEbv7+T6uCClkJ99lCw75I61xLgywpJl+HdQk4 9x4A1FEjohzdA== Date: Sat, 6 Jul 2024 14:58:04 +0200 From: Lorenzo Bianconi To: Simon Horman Cc: netdev@vger.kernel.org, nbd@nbd.name, lorenzo.bianconi83@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, conor@kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, upstream@airoha.com, angelogioacchino.delregno@collabora.com, benjamin.larsson@genexis.eu, rkannoth@marvell.com, sgoutham@marvell.com, andrew@lunn.ch, arnd@arndb.de Subject: Re: [PATCH v5 net-next 2/2] net: airoha: Introduce ethernet support for EN7581 SoC Message-ID: References: <18e837f0f9377b68302d42ec9174473046a4a30a.1720079772.git.lorenzo@kernel.org> <20240705190644.GB1480790@kernel.org> <20240706122754.GD1481495@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="27jVVEXjJPrb9d+/" Content-Disposition: inline In-Reply-To: <20240706122754.GD1481495@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240706_055810_406573_023B81ED X-CRM114-Status: GOOD ( 33.26 ) 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 --27jVVEXjJPrb9d+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Sat, Jul 06, 2024 at 10:27:00AM +0200, Lorenzo Bianconi wrote: > > > On Thu, Jul 04, 2024 at 10:08:11AM +0200, Lorenzo Bianconi wrote: > > > > Add airoha_eth driver in order to introduce ethernet support for > > > > Airoha EN7581 SoC available on EN7581 development board (en7581-evb= ). > > > > en7581-evb networking architecture is composed by airoha_eth as mac > > > > controller (cpu port) and a mt7530 dsa based switch. > > > > EN7581 mac controller is mainly composed by Frame Engine (FE) and > > > > QoS-DMA (QDMA) modules. FE is used for traffic offloading (just bas= ic > > > > functionalities are supported now) while QDMA is used for DMA opera= tion > > > > and QOS functionalities between mac layer and the dsa switch (hw Qo= S is > > > > not available yet and it will be added in the future). > > > > Currently only hw lan features are available, hw wan will be added = with > > > > subsequent patches. > > > >=20 > > > > Tested-by: Benjamin Larsson > > > > Signed-off-by: Lorenzo Bianconi > > >=20 > > > ... > > >=20 > > > > +static const char * const airoha_ethtool_stats_name[] =3D { > > > > + "tx_eth_pkt_cnt", > > > > + "tx_eth_byte_cnt", > > > > + "tx_ok_pkt_cnt", > > > > + "tx_ok_byte_cnt", > > > > + "tx_eth_drop_cnt", > > > > + "tx_eth_bc_cnt", > > > > + "tx_eth_mc_cnt", > > > > + "tx_eth_lt64_cnt", > > > > + "tx_eth_eq64_cnt", > > > > + "tx_eth_65_127_cnt", > > > > + "tx_eth_128_255_cnt", > > > > + "tx_eth_256_511_cnt", > > > > + "tx_eth_512_1023_cnt", > > > > + "tx_eth_1024_1518_cnt", > > > > + "tx_eth_gt1518_cnt", > > > > + "rx_eth_pkt_cnt", > > > > + "rx_eth_byte_cnt", > > > > + "rx_ok_pkt_cnt", > > > > + "rx_ok_byte_cnt", > > > > + "rx_eth_drop_cnt", > > > > + "rx_eth_bc_cnt", > > > > + "rx_eth_mc_cnt", > > > > + "rx_eth_crc_drop_cnt", > > > > + "rx_eth_frag_cnt", > > > > + "rx_eth_jabber_cnt", > > > > + "rx_eth_lt64_cnt", > > > > + "rx_eth_eq64_cnt", > > > > + "rx_eth_65_127_cnt", > > > > + "rx_eth_128_255_cnt", > > > > + "rx_eth_256_511_cnt", > > > > + "rx_eth_512_1023_cnt", > > > > + "rx_eth_1024_1518_cnt", > > > > + "rx_eth_gt1518_cnt", > > > > +}; > > >=20 > > > Hi Lorenzo, > > >=20 > > > Sorry for not noticing this earlier. > >=20 > > Hi Simon, > >=20 > > no worries :) > >=20 > > > It seems to me that some of the stats above could > > > use standard stats, which is preferred. > >=20 > > Please correct me if I am wrong but it seems quite a common approach to= have > > same stats in both .ndo_get_stats64() and .get_ethtool_stats(): > > - https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/me= diatek/mtk_eth_soc.c#L212 > > - https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/ma= rvell/mvneta.c#L435 > > - https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/in= tel/i40e/i40e_ethtool.c#L243 > > - https://github.com/torvalds/linux/blob/master/net/mac80211/ethtool.c#= L52 > > - ... > >=20 > > Do you mean I should just report common stats (e.g. tx_packets or tx_by= tes) in > > .ndo_get_stats64()? Or it is fine to just add .ndo_get_stats64() callba= ck (not > > supported at the moment)? >=20 > The first option: It is my understanding that it preferred to only > report common stats via ndo_get_stats64. >=20 > "Please limit stats you report in ethtool -S to just the stats for which > proper interfaces don't exist. Don't duplicate what's already reported > via rtase_get_stats64(), also take a look at what can be reported via > various *_stats members of struct ethtool_ops." >=20 > - Re: [PATCH net-next v18 10/13] rtase: Implement ethtool function > by Jakub Kicinski > https://lore.kernel.org/netdev/20240509204047.149e226e@kernel.org/ ack, thx for the clarification. I will move common stats in ndo_get_stats64= () in v6. Regards, Lorenzo >=20 > > > Basically, my understanding is that one should: > > > 1. Implement .ndo_get_stats64 > > > (that seems relevant here) > > > 2. As appropriate implement ethtool_stats non-extended stats operatio= ns > > > (perhaps not relevant here) > >=20 > > Can you please provide me a pointer for it? >=20 > Sorry, that was not at all clear. > I meant, as per the quote above, *_stats members of struct ethtool_ops, > other than those that implement extended ops. > e.g. get_rmon_stats. >=20 > >=20 > > Regards, > > Lorenzo > >=20 > > > 3. Then implement get_ethtool_stats for what is left over > > >=20 > > > ... >=20 >=20 --27jVVEXjJPrb9d+/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZok/XAAKCRA6cBh0uS2t rJsvAQDWPekAHROreseCbMT+1YpFHd0F30QgDgH1589HPspJ1QEAhbBE4UYjpZkr oldsh7UQ+AykBLlnzqmMoEmvhnuvrA8= =KxMj -----END PGP SIGNATURE----- --27jVVEXjJPrb9d+/--