Re: natsemi.c - multicast hash bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 Dec 2002, Nat Ersoz wrote:

> I'm debugging a problem in the natsemi.c driver which has the symptom
> that muticast reception quits for no apparent reason.

This is very likely a receiver reset that clears the hash table.

Note: I've updated the natsemi.c driver three times in the past three
months.  You might want to look at the changes.

> Unicast still works fine, the multicast stream is being sent, but no
> packets make it past the hash filter.  In versions of the driver,
> 2.4.19 and before, we "fixed" this problem by setting ifconfig
> "allmuti" on the device.

A poor solution.  If the chip has a broken filter (see the epic100
driver) the driver should handle the flaw based on the chip version.

If a driver isn't calculating the hash table correctly, you can work
around the problem for that driver only by setting the module option
   multicast_filter_limit=0

> As I'm writing a debug routine, I notice that:
> static void __set_rx_mode(struct net_device *dev)
> {
> ...
> 
>     for (i = 0, mclist = dev->mc_list; 
>       mclist && i < dev->mc_count;
>       i++, mclist = mclist->next) {
>          set_bit_le(
>            dp83815_crc(ETH_ALEN, mclist->dmi_addr) & 0x1ff,
>            mc_filter);    /* WHOOPS!! Shouldn't this be &mc_filter[i*2] 
> ?? */

No.  See what set_bit() (and set_bit_le() in this case) does.  It works
on a bit arry and handles any byte arithmetic/shifting internally.

The dp83815 chip is quirky:
   the filter index is a byte address,
   the filter entries must be written as pairs of bytes
   the filter entry write must be a 32 bit operation.

You may note that the natsemi.c driver in the kernel does not write
registers using the correct bit width.

Keep in mind: it's clear that the dp83815 designers were trying to do
big-endian design on a little-endian bus.  Do not expect that code for
the superficially similar dp83820 will work on the dp83815!

-- 
Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Scyld Beowulf cluster system
Annapolis MD 21403			410-990-9993

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux