From: David Miller <davem@davemloft.net>
To: shemminger@linux-foundation.org
Cc: mchan@broadcom.com, eliezert@broadcom.com, jeff@garzik.org,
netdev@vger.kernel.org, eilong@broadcom.com, vladz@broadcom.com,
gertner@broadcom.com
Subject: Re: [BNX2X RESUBMIT][PATCH 0/8] New driver for Broadcom 10Gb Ethernet, take two.
Date: Mon, 08 Oct 2007 14:28:01 -0700 (PDT) [thread overview]
Message-ID: <20071008.142801.82028532.davem@davemloft.net> (raw)
In-Reply-To: <20071008140301.3e69d01d@freepuppy.rosehill>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Mon, 8 Oct 2007 14:03:01 -0700
> On Mon, 08 Oct 2007 14:40:22 -0700
> "Michael Chan" <mchan@broadcom.com> wrote:
>
> > On Mon, 2007-10-08 at 12:08 -0700, Stephen Hemminger wrote:
> > > On Mon, 08 Oct 2007 20:34:41 +0200
> > > "Eliezer" <eliezert@broadcom.com> wrote:
> > >
> > > > > * The MACRO's for 64 bit stats look like they could be done with
> > > > > u64 and/or turned into inline's.
> > > >
> > > > The MACRO's modify some of their arguments, plus they need to work on 32
> > > > bit machines (are 64 bit counters always available on 32 bit machines?).
> > > > so using an inline would allow the inline to be more readable but
> > > > calling it would get ugly.
> > > > I'm open to suggestions.
> > > >
> > >
> > > u64 exists on all platforms (including 32 bit).
> > >
> >
> > I think the biggest problem with these 64-bits counters (and 64-bit
> > addresses) is that the hardware treats them as big endian and they get
> > DMA'ed in big endian format. We control the byte swap so that 32-bit
> > quantities will have the correct endianness, but the high and low 32-bit
> > words will be in the wrong spots on little endian machines. That's why
> > we need to separate the high and the low words and convert them back and
> > forth.
> >
> There are types and tools for checking endianness see be64, etc.
It's not a be64 Stephen, Michael is trying to explain this.
They configure the hardware to swap the bytes within a 32-bit word
into cpu endianness, but the chip doesn't swap the 32-bit words within
a 64-bit word properly, which is why the macros are necessary.
prev parent reply other threads:[~2007-10-08 21:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-08 12:34 [BNX2X RESUBMIT][PATCH 0/8] New driver for Broadcom 10Gb Ethernet, take two Eliezer Tamir
2007-10-08 13:02 ` Matti Aarnio
2007-10-08 16:17 ` Randy Dunlap
2007-10-08 17:29 ` Stephen Hemminger
2007-10-08 18:34 ` Eliezer
2007-10-08 19:08 ` Stephen Hemminger
2007-10-08 19:18 ` Eliezer Tamir
2007-10-08 21:40 ` Michael Chan
2007-10-08 21:03 ` Stephen Hemminger
2007-10-08 21:28 ` David Miller [this message]
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=20071008.142801.82028532.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=eliezert@broadcom.com \
--cc=gertner@broadcom.com \
--cc=jeff@garzik.org \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=vladz@broadcom.com \
/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).