netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3
@ 2008-10-26 17:31 Leonid Slobodchikov
  2008-10-26 23:51 ` Aras Vaichas
  2008-10-27  0:16 ` [PATCH] at91_ether: multicast packet are not received due toincorrect " Gururaja Hebbar K R
  0 siblings, 2 replies; 4+ messages in thread
From: Leonid Slobodchikov @ 2008-10-26 17:31 UTC (permalink / raw)
  To: netdev; +Cc: linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

Hello,

Multicast packets are not received by the Ethernet driver for the
Atmel AT91RM9200. This is due to incorrect mc_filter array index
evaluation in the at91ether_sethashtable function. The point is that
AT91_EMAC_HSH and AT91_EMAC_HSL registers are 64-bit length. So when
evaluating the index the bit number must be diveded at 64, which is
2^6, not 2^5.
The below is a fix for that issue.


--- drivers/net/arm/at91_ether.c.orig	2006-06-30 20:37:38.000000000 +0300
+++ drivers/net/arm/at91_ether.c	2008-10-26 17:35:50.000000000 +0200
@@ -520,7 +520,7 @@ static void at91ether_sethashtable(struc
 		if (!curr) break;	/* unexpected end of list */

 		bitnr = hash_get_index(curr->dmi_addr);
-		mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
+		mc_filter[bitnr >> 6] |= 1 << (bitnr & 31);
 	}

 	at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);

Signed-off-by: Leonid V. Slobodchikov <curvex@gmail.com>

Best regards,
Leonid Slobodchikov

[-- Attachment #2: at91_ether.patch.gz --]
[-- Type: application/x-gzip, Size: 362 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3
  2008-10-26 17:31 [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3 Leonid Slobodchikov
@ 2008-10-26 23:51 ` Aras Vaichas
  2008-10-27  1:10   ` Leonid Slobodchikov
  2008-10-27  0:16 ` [PATCH] at91_ether: multicast packet are not received due toincorrect " Gururaja Hebbar K R
  1 sibling, 1 reply; 4+ messages in thread
From: Aras Vaichas @ 2008-10-26 23:51 UTC (permalink / raw)
  To: Leonid Slobodchikov; +Cc: netdev, linux-arm-kernel, Andrew Victor

Leonid Slobodchikov wrote:
> Hello,
>
> Multicast packets are not received by the Ethernet driver for the
> Atmel AT91RM9200. This is due to incorrect mc_filter array index
> evaluation in the at91ether_sethashtable function. The point is that
> AT91_EMAC_HSH and AT91_EMAC_HSL registers are 64-bit length. So when
> evaluating the index the bit number must be diveded at 64, which is
> 2^6, not 2^5.
> The below is a fix for that issue.
>
>
> --- drivers/net/arm/at91_ether.c.orig	2006-06-30 20:37:38.000000000 +0300
> +++ drivers/net/arm/at91_ether.c	2008-10-26 17:35:50.000000000 +0200
> @@ -520,7 +520,7 @@ static void at91ether_sethashtable(struc
>  		if (!curr) break;	/* unexpected end of list */
>
>  		bitnr = hash_get_index(curr->dmi_addr);
> -		mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
> +		mc_filter[bitnr >> 6] |= 1 << (bitnr & 31);
>  	}
>
>  	at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
>   
Hmm, that is strange. I received a patch quite some time ago from Andrew
Victor to fix just such a problem. Maybe it reappeared? Or maybe I
didn't test my patch patch well enough?

--- SNIP ---

hi Aras,

> I'm using 2.6.16, at91rm9200 with a DM9161 PHY. I can't receive multicast
> packets on eth0 unless I enable "allmulti" using ifconfig - which I
shouldn't
> have to do.

Looks like the bug in the AT91RM9200 Ethernet driver's Multicast support
might have been found.

Since I know you use multicast, could you possibly test this patch
(without enabling "allmulti") and let me know?  Thanks.

Regards.
  Andrew Victor



--- linux-2.6/drivers/net/arm/at91_ether.c.orig  2007-04-25
09:46:29.000000000 +0200
+++ linux-2.6/drivers/net/arm/at91_ether.c      2007-04-25
10:00:25.000000000 +0200
@@ -535,8 +535,8 @@ static void at91ether_sethashtable(struc
                mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
        }

-       at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
-       at91_emac_write(AT91_EMAC_HSL, mc_filter[1]);
+       at91_emac_write(AT91_EMAC_HSL, mc_filter[0]);
+       at91_emac_write(AT91_EMAC_HSH, mc_filter[1]);
 }

 /*


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] at91_ether: multicast packet are not received due toincorrect setting of the multicast hashtable, kernel linux-2.6.17.3
  2008-10-26 17:31 [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3 Leonid Slobodchikov
  2008-10-26 23:51 ` Aras Vaichas
@ 2008-10-27  0:16 ` Gururaja Hebbar K R
  1 sibling, 0 replies; 4+ messages in thread
From: Gururaja Hebbar K R @ 2008-10-27  0:16 UTC (permalink / raw)
  To: Leonid Slobodchikov, netdev; +Cc: linux-arm-kernel

Hi,

Looking at AT91RM9200 preliminary in page 605 & 619, the ETH_HSL & ETH_HSH registers are 32 bit in length. Together they give 64 bit Hash Address.

Kindly correct me if i am wrong.

TIA

Regards
Gururaja

> -----Original Message-----
> From: linux-arm-kernel-bounces@lists.arm.linux.org.uk 
> [mailto:linux-arm-kernel-bounces@lists.arm.linux.org.uk] On 
> Behalf Of Leonid Slobodchikov
> Sent: Sunday, October 26, 2008 10:31 AM
> To: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.arm.linux.org.uk
> Subject: [PATCH] at91_ether: multicast packet are not 
> received due toincorrect setting of the multicast hashtable, 
> kernel linux-2.6.17.3
> 
> Hello,
> 
> Multicast packets are not received by the Ethernet driver for 
> the Atmel AT91RM9200. This is due to incorrect mc_filter 
> array index evaluation in the at91ether_sethashtable 
> function. The point is that AT91_EMAC_HSH and AT91_EMAC_HSL 
> registers are 64-bit length. So when evaluating the index the 
> bit number must be diveded at 64, which is 2^6, not 2^5.
> The below is a fix for that issue.
> 
> 
> --- drivers/net/arm/at91_ether.c.orig	2006-06-30 
> 20:37:38.000000000 +0300
> +++ drivers/net/arm/at91_ether.c	2008-10-26 
> 17:35:50.000000000 +0200
> @@ -520,7 +520,7 @@ static void at91ether_sethashtable(struc
>  		if (!curr) break;	/* unexpected end of list */
> 
>  		bitnr = hash_get_index(curr->dmi_addr);
> -		mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
> +		mc_filter[bitnr >> 6] |= 1 << (bitnr & 31);
>  	}
> 
>  	at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
> 
> Signed-off-by: Leonid V. Slobodchikov <curvex@gmail.com>
> 
> Best regards,
> Leonid Slobodchikov
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3
  2008-10-26 23:51 ` Aras Vaichas
@ 2008-10-27  1:10   ` Leonid Slobodchikov
  0 siblings, 0 replies; 4+ messages in thread
From: Leonid Slobodchikov @ 2008-10-27  1:10 UTC (permalink / raw)
  To: Aras Vaichas; +Cc: netdev, linux-arm-kernel, Andrew Victor

Hello,

Just for more info regarding this issue. I could not recevieve
multicast packets adding 01-00-5e-00-01-81 MAC address to the driver's
multicast table. After applying the patch this was fixed for me.
The MAC address above corresponds to 224.0.1.229 IP address. This IP
is used in IEEE-1588 protocol. I have been testing it with the
PTPd-1.0.0 http://sourceforge.net/projects/ptpd/.


Best regards,
Leonid Slobodchikov



On Mon, Oct 27, 2008 at 5:51 AM, Aras Vaichas <arasv@magtech.com.au> wrote:
> Leonid Slobodchikov wrote:
>> Hello,
>>
>> Multicast packets are not received by the Ethernet driver for the
>> Atmel AT91RM9200. This is due to incorrect mc_filter array index
>> evaluation in the at91ether_sethashtable function. The point is that
>> AT91_EMAC_HSH and AT91_EMAC_HSL registers are 64-bit length. So when
>> evaluating the index the bit number must be diveded at 64, which is
>> 2^6, not 2^5.
>> The below is a fix for that issue.
>>
>>
>> --- drivers/net/arm/at91_ether.c.orig 2006-06-30 20:37:38.000000000 +0300
>> +++ drivers/net/arm/at91_ether.c      2008-10-26 17:35:50.000000000 +0200
>> @@ -520,7 +520,7 @@ static void at91ether_sethashtable(struc
>>               if (!curr) break;       /* unexpected end of list */
>>
>>               bitnr = hash_get_index(curr->dmi_addr);
>> -             mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
>> +             mc_filter[bitnr >> 6] |= 1 << (bitnr & 31);
>>       }
>>
>>       at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
>>
> Hmm, that is strange. I received a patch quite some time ago from Andrew
> Victor to fix just such a problem. Maybe it reappeared? Or maybe I
> didn't test my patch patch well enough?
>
> --- SNIP ---
>
> hi Aras,
>
>> I'm using 2.6.16, at91rm9200 with a DM9161 PHY. I can't receive multicast
>> packets on eth0 unless I enable "allmulti" using ifconfig - which I
> shouldn't
>> have to do.
>
> Looks like the bug in the AT91RM9200 Ethernet driver's Multicast support
> might have been found.
>
> Since I know you use multicast, could you possibly test this patch
> (without enabling "allmulti") and let me know?  Thanks.
>
> Regards.
>  Andrew Victor
>
>
>
> --- linux-2.6/drivers/net/arm/at91_ether.c.orig  2007-04-25
> 09:46:29.000000000 +0200
> +++ linux-2.6/drivers/net/arm/at91_ether.c      2007-04-25
> 10:00:25.000000000 +0200
> @@ -535,8 +535,8 @@ static void at91ether_sethashtable(struc
>                mc_filter[bitnr >> 5] |= 1 << (bitnr & 31);
>        }
>
> -       at91_emac_write(AT91_EMAC_HSH, mc_filter[0]);
> -       at91_emac_write(AT91_EMAC_HSL, mc_filter[1]);
> +       at91_emac_write(AT91_EMAC_HSL, mc_filter[0]);
> +       at91_emac_write(AT91_EMAC_HSH, mc_filter[1]);
>  }
>
>  /*
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-27  1:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-26 17:31 [PATCH] at91_ether: multicast packet are not received due to incorrect setting of the multicast hashtable, kernel linux-2.6.17.3 Leonid Slobodchikov
2008-10-26 23:51 ` Aras Vaichas
2008-10-27  1:10   ` Leonid Slobodchikov
2008-10-27  0:16 ` [PATCH] at91_ether: multicast packet are not received due toincorrect " Gururaja Hebbar K R

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).