public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* Issue with Micrel PCI Network Driver.
@ 2013-02-08 23:17 Joseph Lutz
  2013-02-11 17:46 ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Lutz @ 2013-02-08 23:17 UTC (permalink / raw)
  To: netdev

I am having an issue with one of the network interface drivers. The 
driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
driver for the Micrel-Kendin device 8841.
I am trying to get systemd to rename the three network interfaces in my 
embedded atom system. I have one of the interfaces being renamed (an 
Intel Corporation 82574L), but the two Micrel interfaces are not being 
renamed. I traced this down to the driver not populating the 
/sys/devices/pci* information. Instead it places the driver into 
/sys/devices/virtual/net/.

Here are the details of the setup I am having the problem on:

     # uname -a ; lspci ; lspci -t ; ls -l /sys/class/net/
     Linux orionlx 3.2.28-rt42-0.1-default+ #1 SMP PREEMPT RT Fri Feb 8 
12:01:13 CST 2013 i686 GNU/Linux
     00:00.0 Host bridge: Intel Corporation System Controller Hub (SCH 
Poulsbo) (rev 07)
     00:02.0 VGA compatible controller: Intel Corporation System 
Controller Hub (SCH Poulsbo) Graphics Controller (rev 07)
     00:1a.0 USB Controller: Intel Corporation System Controller Hub 
(SCH Poulsbo) USB Client Controller (rev 07)
     00:1b.0 Audio device: Intel Corporation System Controller Hub (SCH 
Poulsbo) HD Audio Controller (rev 07)
     00:1c.0 PCI bridge: Intel Corporation System Controller Hub (SCH 
Poulsbo) PCI Express Port 1 (rev 07)
     00:1c.1 PCI bridge: Intel Corporation System Controller Hub (SCH 
Poulsbo) PCI Express Port 2 (rev 07)
     00:1d.0 USB Controller: Intel Corporation System Controller Hub 
(SCH Poulsbo) USB UHCI #1 (rev 07)
     00:1d.1 USB Controller: Intel Corporation System Controller Hub 
(SCH Poulsbo) USB UHCI #2 (rev 07)
     00:1d.2 USB Controller: Intel Corporation System Controller Hub 
(SCH Poulsbo) USB UHCI #3 (rev 07)
     00:1d.7 USB Controller: Intel Corporation System Controller Hub 
(SCH Poulsbo) USB EHCI #1 (rev 07)
     00:1f.0 ISA bridge: Intel Corporation System Controller Hub (SCH 
Poulsbo) LPC Bridge (rev 07)
     00:1f.1 IDE interface: Intel Corporation System Controller Hub (SCH 
Poulsbo) IDE Controller (rev 07)
     01:00.0 PCI bridge: Pericom Semiconductor Device e111 (rev 02)
     02:01.0 PCI bridge: Pericom Semiconductor 
PI7C8152A/PI7C8152B/PI7C8152BI PCI-to-PCI Bridge (rev 01)
     03:00.0 Ethernet controller: Micrel-Kendin Device 8841 (rev 10)
     03:01.0 Ethernet controller: Micrel-Kendin Device 8841 (rev 10)
     04:00.0 Ethernet controller: Intel Corporation 82574L Gigabit 
Network Connection
     -[0000:00]-+-00.0
                +-02.0
                +-1a.0
                +-1b.0
+-1c.0-[0000:01-03]----00.0-[0000:02-03]----01.0-[0000:03]--+-00.0
|                                                           \-01.0
                +-1c.1-[0000:04]----00.0
                +-1d.0
                +-1d.1
                +-1d.2
                +-1d.7
                +-1f.0
                \-1f.1
     lrwxrwxrwx    1 root     root             0 Mar 27 02:04 enp4s0 -> 
../../devices/pci0000:00/0000:00:1c.1/0000:04:00.0/net/enp4s0
     lrwxrwxrwx    1 root     root             0 Mar 27 02:04 eth1 -> 
../../devices/virtual/net/eth1
     lrwxrwxrwx    1 root     root             0 Mar 27 02:04 eth2 -> 
../../devices/virtual/net/eth2
     lrwxrwxrwx    1 root     root             0 Mar 27 02:04 lo -> 
../../devices/virtual/net/lo

This kernel is version 3.2.28 with the real-time patches applied.

If there isn't anyone available to resolve this issue I would be willing 
to assist. I just do not have any experience writing Network Drivers or 
PCI drivers. I have only written simple device drivers.

-- 
..............................................
Joseph Lutz
Software Developer
NovaTech, LLC
13555 W. 107th Street
Lenexa, KS 66215
(913) 451-1880 (main)
(913) 742-4531 (direct)
Joseph.Lutz@novatechweb•com

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

* Re: Issue with Micrel PCI Network Driver.
  2013-02-08 23:17 Issue with Micrel PCI Network Driver Joseph Lutz
@ 2013-02-11 17:46 ` Ben Hutchings
  2013-02-11 17:47   ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2013-02-11 17:46 UTC (permalink / raw)
  To: joseph.lutz; +Cc: netdev

On Fri, 2013-02-08 at 17:17 -0600, Joseph Lutz wrote:
> I am having an issue with one of the network interface drivers. The 
> driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
> driver for the Micrel-Kendin device 8841.
> I am trying to get systemd to rename the three network interfaces in my 
> embedded atom system. I have one of the interfaces being renamed (an 
> Intel Corporation 82574L), but the two Micrel interfaces are not being 
> renamed. I traced this down to the driver not populating the 
> /sys/devices/pci* information. Instead it places the driver into 
> /sys/devices/virtual/net/.
[...]

Right, this driver doesn't specify the parent device (PCI device) for
the net devices it creates.

All you should need to is add:
	SET_NETDEV_DEV(dev, pdev);
underneath the call to alloc_etherdev().

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: Issue with Micrel PCI Network Driver.
  2013-02-11 17:46 ` Ben Hutchings
@ 2013-02-11 17:47   ` Ben Hutchings
  2013-02-12 10:10     ` Bjørn Mork
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2013-02-11 17:47 UTC (permalink / raw)
  To: joseph.lutz; +Cc: netdev

On Mon, 2013-02-11 at 17:46 +0000, Ben Hutchings wrote:
> On Fri, 2013-02-08 at 17:17 -0600, Joseph Lutz wrote:
> > I am having an issue with one of the network interface drivers. The 
> > driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
> > driver for the Micrel-Kendin device 8841.
> > I am trying to get systemd to rename the three network interfaces in my 
> > embedded atom system. I have one of the interfaces being renamed (an 
> > Intel Corporation 82574L), but the two Micrel interfaces are not being 
> > renamed. I traced this down to the driver not populating the 
> > /sys/devices/pci* information. Instead it places the driver into 
> > /sys/devices/virtual/net/.
> [...]
> 
> Right, this driver doesn't specify the parent device (PCI device) for
> the net devices it creates.
> 
> All you should need to is add:
> 	SET_NETDEV_DEV(dev, pdev);
> underneath the call to alloc_etherdev().

Or rather:
	SET_NETDEV_DEV(dev, &pdev->dev);

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: Issue with Micrel PCI Network Driver.
  2013-02-11 17:47   ` Ben Hutchings
@ 2013-02-12 10:10     ` Bjørn Mork
  2013-02-12 12:07       ` Ben Hutchings
  0 siblings, 1 reply; 6+ messages in thread
From: Bjørn Mork @ 2013-02-12 10:10 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: joseph.lutz, netdev

Ben Hutchings <bhutchings@solarflare•com> writes:
> On Mon, 2013-02-11 at 17:46 +0000, Ben Hutchings wrote:
>> On Fri, 2013-02-08 at 17:17 -0600, Joseph Lutz wrote:
>> > I am having an issue with one of the network interface drivers. The 
>> > driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
>> > driver for the Micrel-Kendin device 8841.
>> > I am trying to get systemd to rename the three network interfaces in my 
>> > embedded atom system. I have one of the interfaces being renamed (an 
>> > Intel Corporation 82574L), but the two Micrel interfaces are not being 
>> > renamed. I traced this down to the driver not populating the 
>> > /sys/devices/pci* information. Instead it places the driver into 
>> > /sys/devices/virtual/net/.
>> [...]
>> 
>> Right, this driver doesn't specify the parent device (PCI device) for
>> the net devices it creates.
>> 
>> All you should need to is add:
>> 	SET_NETDEV_DEV(dev, pdev);
>> underneath the call to alloc_etherdev().
>
> Or rather:
> 	SET_NETDEV_DEV(dev, &pdev->dev);


That should of course be fixed.  But this bug should not prevent
userspace from renaming the device, should it? Sounds like a userspace
application making too many stupid assumptions to me.  Does it work for
network devices attached to other buses?


Bjørn

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

* Re: Issue with Micrel PCI Network Driver.
  2013-02-12 10:10     ` Bjørn Mork
@ 2013-02-12 12:07       ` Ben Hutchings
  2013-02-12 12:40         ` Bjørn Mork
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2013-02-12 12:07 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: joseph.lutz, netdev

On Tue, 2013-02-12 at 11:10 +0100, Bjørn Mork wrote:
> Ben Hutchings <bhutchings@solarflare•com> writes:
> > On Mon, 2013-02-11 at 17:46 +0000, Ben Hutchings wrote:
> >> On Fri, 2013-02-08 at 17:17 -0600, Joseph Lutz wrote:
> >> > I am having an issue with one of the network interface drivers. The 
> >> > driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
> >> > driver for the Micrel-Kendin device 8841.
> >> > I am trying to get systemd to rename the three network interfaces in my 
> >> > embedded atom system. I have one of the interfaces being renamed (an 
> >> > Intel Corporation 82574L), but the two Micrel interfaces are not being 
> >> > renamed. I traced this down to the driver not populating the 
> >> > /sys/devices/pci* information. Instead it places the driver into 
> >> > /sys/devices/virtual/net/.
> >> [...]
> >> 
> >> Right, this driver doesn't specify the parent device (PCI device) for
> >> the net devices it creates.
> >> 
> >> All you should need to is add:
> >> 	SET_NETDEV_DEV(dev, pdev);
> >> underneath the call to alloc_etherdev().
> >
> > Or rather:
> > 	SET_NETDEV_DEV(dev, &pdev->dev);
> 
> 
> That should of course be fixed.  But this bug should not prevent
> userspace from renaming the device, should it? Sounds like a userspace
> application making too many stupid assumptions to me.  Does it work for
> network devices attached to other buses?

It prevents userspace from applying a naming policy that incorporates
the PCI slot number.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: Issue with Micrel PCI Network Driver.
  2013-02-12 12:07       ` Ben Hutchings
@ 2013-02-12 12:40         ` Bjørn Mork
  0 siblings, 0 replies; 6+ messages in thread
From: Bjørn Mork @ 2013-02-12 12:40 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: joseph.lutz, netdev

Ben Hutchings <bhutchings@solarflare•com> writes:
> On Tue, 2013-02-12 at 11:10 +0100, Bjørn Mork wrote:
>
>> That should of course be fixed.  But this bug should not prevent
>> userspace from renaming the device, should it? Sounds like a userspace
>> application making too many stupid assumptions to me.  Does it work for
>> network devices attached to other buses?
>
> It prevents userspace from applying a naming policy that incorporates
> the PCI slot number.

Ah, right.  Thanks for explaining.  That makes more sense.


Bjørn

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

end of thread, other threads:[~2013-02-12 12:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-08 23:17 Issue with Micrel PCI Network Driver Joseph Lutz
2013-02-11 17:46 ` Ben Hutchings
2013-02-11 17:47   ` Ben Hutchings
2013-02-12 10:10     ` Bjørn Mork
2013-02-12 12:07       ` Ben Hutchings
2013-02-12 12:40         ` Bjørn Mork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox