From: Dale Farnsworth <dale@farnsworth.org>
To: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 37/39] mv643xx_eth: don't read from upper parts of 64-bit mib registers
Date: Thu, 5 Jun 2008 05:46:58 -0700 [thread overview]
Message-ID: <20080605124657.GT3807@farnsworth.org> (raw)
In-Reply-To: <1212490974-23719-38-git-send-email-buytenh@wantstofly.org>
On Tue, Jun 03, 2008 at 01:02:52PM +0200, Lennert Buytenhek wrote:
> The two 64-bit MIB registers (good_octets_received and
> good_octets_sent) can trigger weird behavior if reads are done
> from their 32-bit top parts. This patch avoids reading the top
> halves entirely.
>
> Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
> ---
> drivers/net/mv643xx_eth.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
> index 0f8e79f..54c9c76 100644
> --- a/drivers/net/mv643xx_eth.c
> +++ b/drivers/net/mv643xx_eth.c
> @@ -983,7 +983,7 @@ static void mib_counters_update(struct mv643xx_eth_private *mep)
> struct mib_counters *p = &mep->mib_counters;
>
> p->good_octets_received += mib_read(mep, 0x00);
> - p->good_octets_received += (u64)mib_read(mep, 0x04) << 32;
> +// p->good_octets_received += (u64)mib_read(mep, 0x04) << 32;
> p->bad_octets_received += mib_read(mep, 0x08);
> p->internal_mac_transmit_err += mib_read(mep, 0x0c);
> p->good_frames_received += mib_read(mep, 0x10);
> @@ -997,7 +997,7 @@ static void mib_counters_update(struct mv643xx_eth_private *mep)
> p->frames_512_to_1023_octets += mib_read(mep, 0x30);
> p->frames_1024_to_max_octets += mib_read(mep, 0x34);
> p->good_octets_sent += mib_read(mep, 0x38);
> - p->good_octets_sent += (u64)mib_read(mep, 0x3c) << 32;
> +// p->good_octets_sent += (u64)mib_read(mep, 0x3c) << 32;
> p->good_frames_sent += mib_read(mep, 0x40);
> p->excessive_collision += mib_read(mep, 0x44);
> p->multicast_frames_sent += mib_read(mep, 0x48);
I'd add a comment referring to the weird behavior. Also, aren't
C++-style comments discouraged?
-Dale
next prev parent reply other threads:[~2008-06-05 12:47 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-03 11:02 [PATCH 00/39] mv643xx_eth: complete overhaul Lennert Buytenhek
2008-06-03 11:02 ` [PATCH 01/39] mv643xx_eth: reverse topological sort of functions Lennert Buytenhek
2008-06-05 11:23 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 02/39] mv643xx_eth: trim unnecessary includes Lennert Buytenhek
2008-06-05 11:02 ` Dale Farnsworth
2008-06-06 8:18 ` Lennert Buytenhek
2008-06-06 10:55 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 03/39] mv643xx_eth: shorten reg names Lennert Buytenhek
2008-06-05 11:21 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 04/39] mv643xx_eth: get rid of individual port config register bit defines Lennert Buytenhek
2008-06-05 11:07 ` Dale Farnsworth
2008-06-06 6:58 ` Lennert Buytenhek
2008-06-06 10:52 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 05/39] mv643xx_eth: get rid of individual port config extend " Lennert Buytenhek
2008-06-05 11:24 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 06/39] mv643xx_eth: delete unused SDMA config " Lennert Buytenhek
2008-06-05 11:25 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 07/39] mv643xx_eth: delete unused port serial control " Lennert Buytenhek
2008-06-05 11:27 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 08/39] mv643xx_eth: nuke port status " Lennert Buytenhek
2008-06-05 11:26 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 09/39] mv643xx_eth: remove unused DESC_SIZE define Lennert Buytenhek
2008-06-05 11:28 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 10/39] mv643xx_eth: clarify irq masking and unmasking Lennert Buytenhek
2008-06-05 11:35 ` Dale Farnsworth
2008-06-05 11:44 ` Dale Farnsworth
2008-06-05 20:36 ` Lennert Buytenhek
2008-06-05 21:22 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 11/39] mv643xx_eth: move PHY wait defines into callers Lennert Buytenhek
2008-06-05 11:39 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 12/39] mv643xx_eth: get rid of RX_BUF_OFFSET Lennert Buytenhek
2008-06-05 11:37 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 13/39] mv643xx_eth: move MIB offset defines into their only user Lennert Buytenhek
2008-06-05 11:47 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 14/39] mv643xx_eth: remove port serial status register bit defines Lennert Buytenhek
2008-06-05 11:41 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 15/39] mv643xx_eth: clean up rx/tx descriptor field defines Lennert Buytenhek
2008-06-05 11:37 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 16/39] mv643xx_eth: get rid of ETH_/ethernet_/eth_ prefixes Lennert Buytenhek
2008-06-05 11:50 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 17/39] mv643xx_eth: use 'mv643xx_eth_' prefix consistently Lennert Buytenhek
2008-06-05 11:59 ` Dale Farnsworth
2008-06-06 7:09 ` Lennert Buytenhek
2008-06-03 11:02 ` [PATCH 18/39] mv643xx_eth: kill superfluous comments Lennert Buytenhek
2008-06-05 12:03 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 19/39] mv643xx_eth: kill ->rx_resource_err Lennert Buytenhek
2008-06-05 11:48 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 20/39] mv643xx_eth: get rid of hungarian variable naming Lennert Buytenhek
2008-06-05 12:06 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 21/39] mv643xx_eth: move port_receive() into its only caller Lennert Buytenhek
2008-06-05 11:53 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 22/39] mv643xx_eth: move rx_return_buff() " Lennert Buytenhek
2008-06-05 12:01 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 23/39] mv643xx_eth: kill FUNC_RET_STATUS/pkt_info Lennert Buytenhek
2008-06-05 11:59 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 24/39] mv643xx_eth: kill private unused instance of struct net_device_stats Lennert Buytenhek
2008-06-05 12:08 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 25/39] mv643xx_eth: massively simplify multicast address crc8 computation Lennert Buytenhek
2008-06-05 12:05 ` Dale Farnsworth
2008-06-05 14:08 ` Brent Cook
2008-06-05 20:44 ` Lennert Buytenhek
2008-06-03 11:02 ` [PATCH 26/39] mv643xx_eth: split out rx queue state Lennert Buytenhek
2008-06-05 12:39 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 27/39] mv643xx_eth: split out tx " Lennert Buytenhek
2008-06-05 12:09 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 28/39] mv643xx_eth: remove write-only interrupt coalescing variables Lennert Buytenhek
2008-06-05 12:53 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 29/39] mv643xx_eth: general cleanup Lennert Buytenhek
2008-06-05 12:33 ` Dale Farnsworth
2008-06-06 8:24 ` Lennert Buytenhek
2008-06-06 10:59 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 30/39] mv643xx_eth: add tx rate control Lennert Buytenhek
2008-06-05 12:51 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 31/39] mv643xx_eth: allow multiple RX queues Lennert Buytenhek
2008-06-05 12:35 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 32/39] mv643xx_eth: allow multiple TX queues Lennert Buytenhek
2008-06-05 12:41 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 33/39] mv643xx_eth: work around TX hang hardware issue Lennert Buytenhek
2008-06-05 12:37 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 34/39] mv643xx_eth: detect extended rx coal register field Lennert Buytenhek
2008-06-05 12:50 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 35/39] mv643xx_eth: detect alternate TX BW control register location Lennert Buytenhek
2008-06-05 12:40 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 36/39] mv643xx_eth: be more agressive about RX refill Lennert Buytenhek
2008-06-05 12:48 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 37/39] mv643xx_eth: don't read from upper parts of 64-bit mib registers Lennert Buytenhek
2008-06-05 12:46 ` Dale Farnsworth [this message]
2008-06-06 7:45 ` Lennert Buytenhek
2008-06-03 11:02 ` [PATCH 38/39] mv643xx_eth: add PHY-less mode Lennert Buytenhek
2008-06-05 12:49 ` Dale Farnsworth
2008-06-03 11:02 ` [PATCH 39/39] mv643xx_eth: update driver version and author fields Lennert Buytenhek
2008-06-05 12:48 ` Dale Farnsworth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080605124657.GT3807@farnsworth.org \
--to=dale@farnsworth.org \
--cc=buytenh@wantstofly.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).