All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/sunhme.c patch
@ 2007-10-29 14:54 Tom Southerland
  2007-10-29 15:11 ` Jan Engelhardt
  2007-10-29 22:07 ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Tom Southerland @ 2007-10-29 14:54 UTC (permalink / raw)
  To: linux-kernel

This patch provides a unique mac address for all interfaces
for the Sun QFE card (non-sparc).  It takes the base mac from
the first interface and increments the mac address for the
other interfaces.

It still preserves the 'macaddr' parameter so if desired, it
can still be used.

Before patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB

After patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Cheers,

Tom



--- linux-2.6.23.1/drivers/net/sunhme.c.orig    2007-10-29 07:58:25.000000000 -0600
+++ linux-2.6.23.1/drivers/net/sunhme.c 2007-10-29 08:53:03.000000000 -0600
@@ -3083,6 +3083,11 @@ static int __devinit happy_meal_pci_prob
                 }
  #else
                 get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]);
+                if(macaddr[5] == 0){
+                 for (i = 0; i < 6; i++)
+                       macaddr[i] = dev->dev_addr[i];
+                 macaddr[5]++;
+                }
  #endif
         }


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

* Re: drivers/net/sunhme.c patch
  2007-10-29 14:54 drivers/net/sunhme.c patch Tom Southerland
@ 2007-10-29 15:11 ` Jan Engelhardt
  2007-10-29 22:10   ` David Miller
  2007-10-29 22:07 ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Engelhardt @ 2007-10-29 15:11 UTC (permalink / raw)
  To: Tom Southerland; +Cc: linux-kernel


On Oct 29 2007 08:54, Tom Southerland wrote:
>
> This patch provides a unique mac address for all interfaces
> for the Sun QFE card (non-sparc).  It takes the base mac from
> the first interface and increments the mac address for the
> other interfaces.

Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

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

* Re: drivers/net/sunhme.c patch
  2007-10-29 14:54 drivers/net/sunhme.c patch Tom Southerland
  2007-10-29 15:11 ` Jan Engelhardt
@ 2007-10-29 22:07 ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2007-10-29 22:07 UTC (permalink / raw)
  To: toms; +Cc: linux-kernel

From: Tom Southerland <toms@wonderland.us.com>
Date: Mon, 29 Oct 2007 08:54:14 -0600

> This patch provides a unique mac address for all interfaces
> for the Sun QFE card (non-sparc).  It takes the base mac from
> the first interface and increments the mac address for the
> other interfaces.
> 
> It still preserves the 'macaddr' parameter so if desired, it
> can still be used.
> 
> Before patching:
> 
> eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> 
> After patching:
> 
> eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
> eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
> eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Could you please post this to netdev@vger.kernel.org which is
where networking patches should go?

Thank you.

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

* Re: drivers/net/sunhme.c patch
  2007-10-29 15:11 ` Jan Engelhardt
@ 2007-10-29 22:10   ` David Miller
  2007-10-29 22:12     ` Jan Engelhardt
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2007-10-29 22:10 UTC (permalink / raw)
  To: jengelh; +Cc: toms, linux-kernel, netdev

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Mon, 29 Oct 2007 16:11:18 +0100 (CET)

> 
> On Oct 29 2007 08:54, Tom Southerland wrote:
> >
> > This patch provides a unique mac address for all interfaces
> > for the Sun QFE card (non-sparc).  It takes the base mac from
> > the first interface and increments the mac address for the
> > other interfaces.
> 
> Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?

This is exactly why I wish this patch had been posted to
netdev@vger.kernel.org, now we have a dialogue going and even if I add
netdev to the CC: now, you can't follow it completely as a netdev
subscriber without going to the lkml archives.

To answer the question, yes it is just a normal PCI device, they put 4
HME chips behind a PCI bridge.  However, the OpenFirmware on the cards
usually creates device node properties for these PCI devices for the
local ethernet addresses.  That's what he's trying to duplicate here.

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

* Re: drivers/net/sunhme.c patch
  2007-10-29 22:10   ` David Miller
@ 2007-10-29 22:12     ` Jan Engelhardt
  2007-10-29 22:41       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Engelhardt @ 2007-10-29 22:12 UTC (permalink / raw)
  To: David Miller; +Cc: toms, linux-kernel, netdev


On Oct 29 2007 15:10, David Miller wrote:
>> On Oct 29 2007 08:54, Tom Southerland wrote:
>> >
>> > This patch provides a unique mac address for all interfaces
>> > for the Sun QFE card (non-sparc).  It takes the base mac from
>> > the first interface and increments the mac address for the
>> > other interfaces.
>> 
>> Where is the difference to a SPARC QFE? PCI is PCI after all, is not it?
>
>To answer the question, yes it is just a normal PCI device, they put 4
>HME chips behind a PCI bridge.  However, the OpenFirmware on the cards
>usually creates device node properties for these PCI devices for the
>local ethernet addresses.  That's what he's trying to duplicate here.
>
The question was more like: if I put in a QFE (that was acquired together
with a SUN E250) into x86, would I get duplicate MACs? (Would be strange -
I would have supposed the OF on the card is independent.)


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

* Re: drivers/net/sunhme.c patch
  2007-10-29 22:12     ` Jan Engelhardt
@ 2007-10-29 22:41       ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2007-10-29 22:41 UTC (permalink / raw)
  To: jengelh; +Cc: toms, linux-kernel, netdev

From: Jan Engelhardt <jengelh@computergmbh.de>
Date: Mon, 29 Oct 2007 23:12:25 +0100 (CET)

> The question was more like: if I put in a QFE (that was acquired together
> with a SUN E250) into x86, would I get duplicate MACs? (Would be strange -
> I would have supposed the OF on the card is independent.)

You are not supposed to.  Each HME instance should get a unique
MAC.

Normally OF would propagate this information around to the independant
device nodes, and we should try to preserve this behavior for non-OF
systems.

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

* drivers/net/sunhme.c patch
@ 2007-10-30  1:53 Tom Southerland
  2007-10-30  3:12 ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Southerland @ 2007-10-30  1:53 UTC (permalink / raw)
  To: netdev

This patch provides a unique mac address for all interfaces
for the Sun QFE card (non-sparc).  It takes the base mac from
the first interface and increments the mac address for the
other interfaces.

It still preserves the 'macaddr' parameter so if desired, it
can still be used.

Before patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB

After patching:

eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Cheers,

Tom



--- linux-2.6.23.1/drivers/net/sunhme.c.orig    2007-10-29 07:58:25.000000000 -0600
+++ linux-2.6.23.1/drivers/net/sunhme.c 2007-10-29 08:53:03.000000000 -0600
@@ -3083,6 +3083,11 @@ static int __devinit happy_meal_pci_prob
                 }
  #else
                 get_hme_mac_nonsparc(pdev, &dev->dev_addr[0]);
+                if(macaddr[5] == 0){
+                 for (i = 0; i < 6; i++)
+                       macaddr[i] = dev->dev_addr[i];
+                 macaddr[5]++;
+                }
  #endif
         }



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

* Re: drivers/net/sunhme.c patch
  2007-10-30  1:53 Tom Southerland
@ 2007-10-30  3:12 ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2007-10-30  3:12 UTC (permalink / raw)
  To: toms; +Cc: netdev

From: Tom Southerland <toms@wonderland.us.com>
Date: Mon, 29 Oct 2007 19:53:52 -0600

> This patch provides a unique mac address for all interfaces
> for the Sun QFE card (non-sparc).  It takes the base mac from
> the first interface and increments the mac address for the
> other interfaces.
> 
> It still preserves the 'macaddr' parameter so if desired, it
> can still be used.
> 
> Before patching:
> 
> eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> 
> After patching:
> 
> eth0      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BB
> eth1      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BC
> eth2      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BD
> eth3      Link encap:Ethernet  HWaddr 00:03:BA:17:4C:BE

Unfortunately, although I understand what you're trying to do,
this change is not correct.

We obtain properly the local-mac-address property stored in
the PCI ROM of each interface, and if you look at the code
we look the MACs up by interface index.

So we are (or should be) obtaining the per-interface MAC
address programmed into the onboard firmware.

Perhaps in get_hme_mac_nonsparc(), is_quattro_p() is evaluating
false and therefore we mistakedly always use index 0?

Could you please check this?  That's probably what the problem
is.

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

end of thread, other threads:[~2007-10-30  3:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 14:54 drivers/net/sunhme.c patch Tom Southerland
2007-10-29 15:11 ` Jan Engelhardt
2007-10-29 22:10   ` David Miller
2007-10-29 22:12     ` Jan Engelhardt
2007-10-29 22:41       ` David Miller
2007-10-29 22:07 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-10-30  1:53 Tom Southerland
2007-10-30  3:12 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.