public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Multi-cast support in Ethernet drivers
@ 2007-07-06 13:06 Alexander Aganichev
  2007-07-08 18:51 ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Aganichev @ 2007-07-06 13:06 UTC (permalink / raw)
  To: eCos Discussion

Hello,

I noticed that when I use DM9000 driver I have a complaint from the IO
subsystem that multi-cast is not supported, but wanted by FreeBSD
stack. I added this support and everything stop working. I dig it a
bit and found that FreeBSD wanted some bogus address to be added. It
seems it cannot work at all since link level address is seems not
filled in the struct sockaddr_dl anywhere in the eCos tree (correct me
if I'm wrong, but I was unable to find it). So now I'm confused why
this complaint was ever introduced and how it works for the Ethernet
drivers that support multi-cast mode already... For now I just
disabled the feature and return good result to prevent complaint. Any
ideas how it should work correctly?

-- 
WBR, Alexander

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-06 13:06 [ECOS] Multi-cast support in Ethernet drivers Alexander Aganichev
@ 2007-07-08 18:51 ` Andrew Lunn
  2007-07-09  6:59   ` Alexander Aganichev
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2007-07-08 18:51 UTC (permalink / raw)
  To: Alexander Aganichev; +Cc: eCos Discussion

On Fri, Jul 06, 2007 at 05:06:41PM +0400, Alexander Aganichev wrote:
> Hello,
>
> I noticed that when I use DM9000 driver I have a complaint from the IO
> subsystem that multi-cast is not supported, but wanted by FreeBSD
> stack. I added this support and everything stop working. I dig it a
> bit and found that FreeBSD wanted some bogus address to be added. It
> seems it cannot work at all since link level address is seems not
> filled in the struct sockaddr_dl anywhere in the eCos tree (correct me
> if I'm wrong, but I was unable to find it). So now I'm confused why
> this complaint was ever introduced and how it works for the Ethernet
> drivers that support multi-cast mode already... For now I just
> disabled the feature and return good result to prevent complaint. Any
> ideas how it should work correctly?

Multicast support is required for IPv6 support. It is not needed for
IPv4.

It looks like the IPv4 code is joining the all hosts group at start
up. See packages/net/bsd_tcpip/current/src/sys/netinet/in.c:738 Is it
this call which is causing your problems?

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-08 18:51 ` Andrew Lunn
@ 2007-07-09  6:59   ` Alexander Aganichev
  2007-07-09  8:34     ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Aganichev @ 2007-07-09  6:59 UTC (permalink / raw)
  To: eCos Discussion

On 7/8/07, Andrew Lunn <andrew@lunn.ch> wrote:
> On Fri, Jul 06, 2007 at 05:06:41PM +0400, Alexander Aganichev wrote:
> > Hello,
> >
> > I noticed that when I use DM9000 driver I have a complaint from the IO
> > subsystem that multi-cast is not supported, but wanted by FreeBSD
> > stack. I added this support and everything stop working. I dig it a
> > bit and found that FreeBSD wanted some bogus address to be added. It
> > seems it cannot work at all since link level address is seems not
> > filled in the struct sockaddr_dl anywhere in the eCos tree (correct me
> > if I'm wrong, but I was unable to find it). So now I'm confused why
> > this complaint was ever introduced and how it works for the Ethernet
> > drivers that support multi-cast mode already... For now I just
> > disabled the feature and return good result to prevent complaint. Any
> > ideas how it should work correctly?
>
> Multicast support is required for IPv6 support. It is not needed for
> IPv4.
>
> It looks like the IPv4 code is joining the all hosts group at start
> up. See packages/net/bsd_tcpip/current/src/sys/netinet/in.c:738 Is it
> this call which is causing your problems?

Yes, it is this call. What is the best way to resolve that?

-- 
WBR, Alexander

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-09  6:59   ` Alexander Aganichev
@ 2007-07-09  8:34     ` Andrew Lunn
  2007-07-16 12:58       ` Alexander Aganichev
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2007-07-09  8:34 UTC (permalink / raw)
  To: Alexander Aganichev; +Cc: eCos Discussion

On Mon, Jul 09, 2007 at 10:59:42AM +0400, Alexander Aganichev wrote:
> On 7/8/07, Andrew Lunn <andrew@lunn.ch> wrote:
>> On Fri, Jul 06, 2007 at 05:06:41PM +0400, Alexander Aganichev wrote:
>> > Hello,
>> >
>> > I noticed that when I use DM9000 driver I have a complaint from the IO
>> > subsystem that multi-cast is not supported, but wanted by FreeBSD
>> > stack. I added this support and everything stop working. I dig it a
>> > bit and found that FreeBSD wanted some bogus address to be added. It
>> > seems it cannot work at all since link level address is seems not
>> > filled in the struct sockaddr_dl anywhere in the eCos tree (correct me
>> > if I'm wrong, but I was unable to find it). So now I'm confused why
>> > this complaint was ever introduced and how it works for the Ethernet
>> > drivers that support multi-cast mode already... For now I just
>> > disabled the feature and return good result to prevent complaint. Any
>> > ideas how it should work correctly?
>>
>> Multicast support is required for IPv6 support. It is not needed for
>> IPv4.
>>
>> It looks like the IPv4 code is joining the all hosts group at start
>> up. See packages/net/bsd_tcpip/current/src/sys/netinet/in.c:738 Is it
>> this call which is causing your problems?
>
> Yes, it is this call. What is the best way to resolve that?

The call looks valid. At least it does not cause other platforms to
break. I suggests that the problem is in your modifications to the
DM9000 driver to support this IOCTL call.

      Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-09  8:34     ` Andrew Lunn
@ 2007-07-16 12:58       ` Alexander Aganichev
  2007-07-17 16:00         ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Aganichev @ 2007-07-16 12:58 UTC (permalink / raw)
  To: Alexander Aganichev, eCos Discussion

On 7/9/07, Andrew Lunn <andrew@lunn.ch> wrote:
> On Mon, Jul 09, 2007 at 10:59:42AM +0400, Alexander Aganichev wrote:
> > On 7/8/07, Andrew Lunn <andrew@lunn.ch> wrote:
> >> On Fri, Jul 06, 2007 at 05:06:41PM +0400, Alexander Aganichev wrote:
> >> > Hello,
> >> >
> >> > I noticed that when I use DM9000 driver I have a complaint from the IO
> >> > subsystem that multi-cast is not supported, but wanted by FreeBSD
> >> > stack. I added this support and everything stop working. I dig it a
> >> > bit and found that FreeBSD wanted some bogus address to be added. It
> >> > seems it cannot work at all since link level address is seems not
> >> > filled in the struct sockaddr_dl anywhere in the eCos tree (correct me
> >> > if I'm wrong, but I was unable to find it). So now I'm confused why
> >> > this complaint was ever introduced and how it works for the Ethernet
> >> > drivers that support multi-cast mode already... For now I just
> >> > disabled the feature and return good result to prevent complaint. Any
> >> > ideas how it should work correctly?
> >>
> >> Multicast support is required for IPv6 support. It is not needed for
> >> IPv4.
> >>
> >> It looks like the IPv4 code is joining the all hosts group at start
> >> up. See packages/net/bsd_tcpip/current/src/sys/netinet/in.c:738 Is it
> >> this call which is causing your problems?
> >
> > Yes, it is this call. What is the best way to resolve that?
>
> The call looks valid. At least it does not cause other platforms to
> break. I suggests that the problem is in your modifications to the
> DM9000 driver to support this IOCTL call.

I dig a little bit more, and found that address I suspect in
incorrectness is generated with this macro in netinet/if_ether.h:

/*
 * Macro to map an IP multicast address to an Ethernet multicast address.
 * The high-order 25 bits of the Ethernet address are statically assigned,
 * and the low-order 23 bits are taken from the low end of the IP address.
 */
#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr) \
	/* struct in_addr *ipaddr; */ \
	/* u_char enaddr[ETHER_ADDR_LEN];	   */ \
{ \
	(enaddr)[0] = 0x01; \
	(enaddr)[1] = 0x00; \
	(enaddr)[2] = 0x5e; \
	(enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
	(enaddr)[4] = ((u_char *)ipaddr)[2]; \
	(enaddr)[5] = ((u_char *)ipaddr)[3]; \
}

The stack sets up multi-cast MAC to 01:00:5e:00:00:01 and cannot talk
to my DHCP anymore.

-- 
WBR, Alexander

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-16 12:58       ` Alexander Aganichev
@ 2007-07-17 16:00         ` Andrew Lunn
  2007-07-19 10:42           ` Alexander Aganichev
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2007-07-17 16:00 UTC (permalink / raw)
  To: Alexander Aganichev; +Cc: eCos Discussion

> The stack sets up multi-cast MAC to 01:00:5e:00:00:01 and cannot talk
> to my DHCP anymore.

My first guess is that you are programming the filter incorrectly in
your MAC chip. It could be you are blocking the broadcast address, or
the unicast address for your device. Is the DHCP server broadcasting
is response, or unicasting it? 

   Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-17 16:00         ` Andrew Lunn
@ 2007-07-19 10:42           ` Alexander Aganichev
  2007-07-20 19:22             ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Alexander Aganichev @ 2007-07-19 10:42 UTC (permalink / raw)
  To: Alexander Aganichev, eCos Discussion

On 7/17/07, Andrew Lunn <andrew@lunn.ch> wrote:
> > The stack sets up multi-cast MAC to 01:00:5e:00:00:01 and cannot talk
> > to my DHCP anymore.
>
> My first guess is that you are programming the filter incorrectly in
> your MAC chip. It could be you are blocking the broadcast address, or
> the unicast address for your device. Is the DHCP server broadcasting
> is response, or unicasting it?

Shouldn't the upper layer provide broadcast address in the list to
ETH_DRV_SET_MC_LIST if it wants to receive broadcast packets? My guess
it is upper layer responsibility to do so, because of otherwise I do
not see any sense for that call...

-- 
WBR, Alexander

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] Multi-cast support in Ethernet drivers
  2007-07-19 10:42           ` Alexander Aganichev
@ 2007-07-20 19:22             ` Andrew Lunn
  2007-07-20 19:44               ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2007-07-20 19:22 UTC (permalink / raw)
  To: Alexander Aganichev; +Cc: eCos Discussion

On Thu, Jul 19, 2007 at 02:42:45PM +0400, Alexander Aganichev wrote:
> On 7/17/07, Andrew Lunn <andrew@lunn.ch> wrote:
>> > The stack sets up multi-cast MAC to 01:00:5e:00:00:01 and cannot talk
>> > to my DHCP anymore.
>>
>> My first guess is that you are programming the filter incorrectly in
>> your MAC chip. It could be you are blocking the broadcast address, or
>> the unicast address for your device. Is the DHCP server broadcasting
>> is response, or unicasting it?
>
> Shouldn't the upper layer provide broadcast address in the list to
> ETH_DRV_SET_MC_LIST if it wants to receive broadcast packets? My guess
> it is upper layer responsibility to do so, because of otherwise I do
> not see any sense for that call...

No, i would expect the default is that the upper layer expects the
device to always receive broadcast. However maybe your device does
not? It is at least something to test. Maybe take a look at the Linux
driver and see what it does for its multicast call. You cannot
directly use the code, since it is GPL, but you can look and see if it
does anything interesting.

     Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* [ECOS]  Re: Multi-cast support in Ethernet drivers
  2007-07-20 19:22             ` Andrew Lunn
@ 2007-07-20 19:44               ` Grant Edwards
  0 siblings, 0 replies; 9+ messages in thread
From: Grant Edwards @ 2007-07-20 19:44 UTC (permalink / raw)
  To: ecos-discuss

On 2007-07-20, Andrew Lunn <andrew@lunn.ch> wrote:
> On Thu, Jul 19, 2007 at 02:42:45PM +0400, Alexander Aganichev wrote:
>> On 7/17/07, Andrew Lunn <andrew@lunn.ch> wrote:
>>> > The stack sets up multi-cast MAC to 01:00:5e:00:00:01 and cannot talk
>>> > to my DHCP anymore.
>>>
>>> My first guess is that you are programming the filter incorrectly in
>>> your MAC chip. It could be you are blocking the broadcast address, or
>>> the unicast address for your device. Is the DHCP server broadcasting
>>> is response, or unicasting it?
>>
>> Shouldn't the upper layer provide broadcast address in the
>> list to ETH_DRV_SET_MC_LIST if it wants to receive broadcast
>> packets?

I've never seen that behavior.

>> My guess it is upper layer responsibility to do so, because of
>> otherwise I do not see any sense for that call...

I think it's there to allow multiple unicast addresses to be
used.  However, none of the drivers I've looked at implement
that.

> No, i would expect the default is that the upper layer expects
> the device to always receive broadcast.

Based on the Ethernet drivers I've worked on, that certainly
seems to be the case.

> However maybe your device does not?

If the Ethernet driver didn't pass on to the stack received
broadcast packetsARP wouldn't work, and you couldn't even ping
the device.

> It is at least something to test. Maybe take a look at the
> Linux driver and see what it does for its multicast call. You
> cannot directly use the code, since it is GPL, but you can
> look and see if it does anything interesting.

-- 
Grant Edwards                   grante             Yow!
                                  at               BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-
                               visi.com            


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2007-07-20 19:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-06 13:06 [ECOS] Multi-cast support in Ethernet drivers Alexander Aganichev
2007-07-08 18:51 ` Andrew Lunn
2007-07-09  6:59   ` Alexander Aganichev
2007-07-09  8:34     ` Andrew Lunn
2007-07-16 12:58       ` Alexander Aganichev
2007-07-17 16:00         ` Andrew Lunn
2007-07-19 10:42           ` Alexander Aganichev
2007-07-20 19:22             ` Andrew Lunn
2007-07-20 19:44               ` [ECOS] " Grant Edwards

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 read-only IMAP folder(s) and NNTP newsgroup(s).