public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: "David S. Miller" <davem@redhat.com>
Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: multicast hash incorrect on big endian archs
Date: Mon, 04 Jun 2001 09:02:00 +0200	[thread overview]
Message-ID: <3B1B3268.2A02D2C@colorfullife.com> (raw)
In-Reply-To: <3B1A9558.2DBAECE7@colorfullife.com> <15130.61778.471925.245018@pizda.ninka.net>

"David S. Miller" wrote:
> 
> Manfred Spraul writes:
>  > I noticed that the multicast hash calculations assumed little endian
>  > byte ordering in the winbond-840 driver, and it seems that several other
>  > drivers are also affected:
>  >
>  > 8139too, epic100, fealnx, pci-skeleton, sis900, starfile, sundance,
>  > via-rhine, yellowfin
>  > perhaps drivers/net/pcmcia/xircom_tulip_cb
> 
> Many big-endian systems already need to provide little-endian bitops,
> for ext2's sake for example.
> 
> We should formalize this, with {set,clear,change,test}_le_bit which
> technically every port has implemented in some for or another already.
>
The multicast hash is written into a nic register with

	set_bit(crc(...),mc_list);
	...
	out{b,w,l}(mc_list[i],ioaddr);

set_bit_le only helps for outb. My patch uses set_bit_16 and set_bit_32.

Another option would be
	set_bit_le(crc(...),mc_list)
	...
	out{w,l}(le{16,32}_to_cpu(mc_list[i]),ioaddr);

but I think set_bit_{8,16,32,64} are the better solution.

Obviously we could move them into a header file.

--
	Manfred

  reply	other threads:[~2001-06-04  7:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-03 19:51 multicast hash incorrect on big endian archs Manfred Spraul
2001-06-04  2:24 ` David S. Miller
2001-06-04  7:02   ` Manfred Spraul [this message]
2001-06-04  9:35     ` Manfred Spraul
2001-06-04 10:54       ` David S. Miller

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=3B1B3268.2A02D2C@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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