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 C39ADC3DA78 for ; Sat, 14 Jan 2023 15:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: 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=sIQ3sARoI2IVoUEyc9lzEmG+dnwxIyH/hTIVRrEKq/8=; b=FftP6YJaiiOlqA sNI1LhM19C5ZC94NPmy4s/3NUN1j8gui+u1Z0PLgZnUlq77zrUR2gt8im5MBdr/uKH9aZ01aMHXVL 9q/34aXuRyVrueoxuD3ITk+dftMpWhhRnWu03abXWiSlauJM6xz6+UXuVmv070Lv/oCJyy7eeFSm/ RlQVaqQK6NnCKuihYxuoHf77GZeOCAxUIhybE+DPYUVlVRBBHxeOGbhFxwPF+rJVIflxnMwf1Ix9h Z006ylxv+pdsVEGW03hjk2ryOdRVKk8tWA2zkMnOanbpu8mmn/xnWZhVnl8IaNb2c+r1IyZ4jFC+i zt6a7r61MCEMsBlKvqqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGiAy-0063bi-SV; Sat, 14 Jan 2023 15:10:32 +0000 Received: from vps0.lunn.ch ([156.67.10.101]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGiAv-0063ab-Nq for linux-arm-kernel@lists.infradead.org; Sat, 14 Jan 2023 15:10:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Pd8XWrHTZcbCfMNT/i6MsIqkST/pHeVYMBqNhxl9+HQ=; b=abfWvaRkyX29jyqlxgt7D5br+r K++KY3ANInELjwiXuYm1SpSgerBoWBhmktvnKTHiXftGi3RWuBtPp+TIBIzH5LJeBt2qTCXMWbPKR fqhYbHW9wJ9Dt7Ct0M+OOprtWX2kKbuvw8yVBsJV1IyGRdKi13dfb1tVndE7scukp+8w=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pGiAU-0025FR-1m; Sat, 14 Jan 2023 16:10:02 +0100 Date: Sat, 14 Jan 2023 16:10:02 +0100 From: Andrew Lunn To: Kurt Kanzenbach Cc: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Vijayakannan Ayyathurai , Wong Vee Khee Subject: Re: [PATCH net v1] net: stmmac: Fix queue statistics reading Message-ID: References: <20230114120437.383514-1-kurt@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230114120437.383514-1-kurt@linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230114_071029_797428_572372D2 X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Jan 14, 2023 at 01:04:37PM +0100, Kurt Kanzenbach wrote: > Correct queue statistics reading. All queue statistics are stored as unsigned > long values. The retrieval for ethtool fetches these values as u64. However, on > some systems the size of the counters are 32 bit. > @@ -551,16 +551,16 @@ static void stmmac_get_per_qstats(struct stmmac_priv *priv, u64 *data) > p = (char *)priv + offsetof(struct stmmac_priv, > xstats.txq_stats[q].tx_pkt_n); > for (stat = 0; stat < STMMAC_TXQ_STATS; stat++) { > - *data++ = (*(u64 *)p); > - p += sizeof(u64 *); > + *data++ = (*(unsigned long *)p); > + p += sizeof(unsigned long); As you said in the comment, the register is 32 bits. So maybe u32 would be better than unsigned long? And it would also avoid issues if this code is every used on a 64 bit machine. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel