Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - io-pkt native driver device names: (6 Items)
   
io-pkt native driver device names  
Everyone is away right now, so I'm going to use this
opportunity to slip in a somewhat contentious change:

See PR54549.

There are three different kinds of network drivers
that can be used with io-pkt:

1) io-net binary drivers, that are run with the
shim, and get the device name enX

2) ported bsd drivers, which use their bsd device
names, such as fxpX for speedo, and wmX for i82544

3) native io-pkt drivers, which currently use the bsd 
names, which creates confusion as to which driver is 
actually running.

Given that we currently allow different device
names for the same hardware (eg #1 vs #2) it
would seem to be reasonable to extend this 
naming difference convention to #2 vs #3.

So a few commits later ...

Native speedo driver now has device name spX which
means that a simple ifconfig tells you which of 3 
possible drivers is running on 82557/82558/82559 nic:

en0:  io-net binary
sp0:  io-pkt native
fxp0: bsd ported


And native i82544 driver now has device name prX
which means that a simple ifconfig tells you
which of 3 possible drivers is running:

en0:   io-net binary
pr0:    io-pkt native
wm0:  bsd ported
Re: io-pkt native driver device names  
On Fri, Jan 04, 2008 at 01:32:58PM -0500, Andrew Boyd wrote:
> Everyone is away right now, so I'm going to use this
> opportunity to slip in a somewhat contentious change:
> 
> See PR54549.
> 
> There are three different kinds of network drivers
> that can be used with io-pkt:
> 
> 1) io-net binary drivers, that are run with the
> shim, and get the device name enX
> 
> 2) ported bsd drivers, which use their bsd device
> names, such as fxpX for speedo, and wmX for i82544
> 
> 3) native io-pkt drivers, which currently use the bsd 
> names, which creates confusion as to which driver is 
> actually running.
> 
> Given that we currently allow different device
> names for the same hardware (eg #1 vs #2) it
> would seem to be reasonable to extend this 
> naming difference convention to #2 vs #3.
> 
> So a few commits later ...
> 
> Native speedo driver now has device name spX which
> means that a simple ifconfig tells you which of 3 
> possible drivers is running on 82557/82558/82559 nic:
> 
> en0:  io-net binary
> sp0:  io-pkt native
> fxp0: bsd ported
> 
> 
> And native i82544 driver now has device name prX
> which means that a simple ifconfig tells you
> which of 3 possible drivers is running:
> 
> en0:   io-net binary
> pr0:    io-pkt native
> wm0:  bsd ported

I'd like to discuss this further.  I thought this was more
or less resolved with the devnp vs devn naming scheme and
also by the fact that we shouldn't be supporting both a
NetBSD and native version (if we have a native version there
should be a Makefile.dnm in the NetBSD version).

I'd prefer not inventing new per device names.  Maybe
"devnb-" for NetBSD or a nicinfo flag to denote such?

-seanb
Re: io-pkt native driver device names  
I agree with Sean on this one.  If the goal is to be able to determine what kind of driver is running, I think using a 
flag or some other form of queryable metadata is probably a better choice than adding even more unique device names.  To
 me, it seems most natural that the name assigned to a particular hardware device should remain constant no matter what 
driver I load for it; the fact that the shim for legacy io-net drivers doesn't support that is a bit of a wart (although
 one that makes particular sense in supporting backwards compatibility with scripts that may depend on the legacy naming
 scheme).
Re: io-pkt native driver device names  
> we shouldn't be supporting both a
> NetBSD and native version 

I suspect that both will end up
in use, for various reasons.

> if we have a native version there
> should be a Makefile.dnm in the 
> NetBSD version

That probably will not present an
insurmountable obstacle for most  :-)

Personally, I don't particularly like
the BSD convention of changing the 
ethernet device name based on the 
underlying hardware.  Most people 
really don't know and honestly don't 
care about the digital hardware 
implementation details of their 
ethernet nic.

Anyways, if we're going to allow different
device names for the same hardware
(enX for io-net vs something different
for every nic for io-pkt) we might as well
try to use it to our advantage in the future
to reduce confusion, which will surely
result with three entirely different drivers 
for the same hardware.
Re: io-pkt native driver device names  
On Sun, Jan 06, 2008 at 05:22:22PM -0500, Andrew Boyd wrote:
> > we shouldn't be supporting both a
> > NetBSD and native version 
> 
> I suspect that both will end up
> in use, for various reasons.
> 
> > if we have a native version there
> > should be a Makefile.dnm in the 
> > NetBSD version
> 
> That probably will not present an
> insurmountable obstacle for most  :-)

With the source available nothing is bullet proof.

> 
> Personally, I don't particularly like
> the BSD convention of changing the 
> ethernet device name based on the 
> underlying hardware.  Most people 
> really don't know and honestly don't 
> care about the digital hardware 
> implementation details of their 
> ethernet nic.
> 
> Anyways, if we're going to allow different
> device names for the same hardware
> (enX for io-net vs something different
> for every nic for io-pkt) we might as well
> try to use it to our advantage in the future
> to reduce confusion, which will surely
> result with three entirely different drivers 
> for the same hardware.

The device name is meant to disambiguate the chipset, not
the driver lineage.  Different device names for the same
hardware may also be confusing.  The enX convention is
historic and should go away over time.

What about the flag idea?

-seanb
RE: io-pkt native driver device names  
My turn on things...

The ifconfig naming convention gives us:
1) Hardware present in the system
2) Adherence to NetBSD conventions
3) Potentially the driver being used
(Other?)

So, by my reckoning, at a minimum, all NetBSD-based io-pkt drivers should
provide the NetBSD name, if only because we can point people at NetBSD docs
with a certain amount of comfort....

As soon as we have a naming convention that varies based on driver, this
means that the "en"X designation is no longer valid and must eventually go
away.  That being said, I mostly like the way that ifconfig works now in
that you can say enx and it will essentially pick the "x"'th driver that was
loaded in to work with (display order for numbering). Of course, this gets
quite confusing if you really DO have an enx device in the mix with multiple
cards, since it will properly select that one regardless of ordering, but
nothing's perfect.

So...  We have a naming convention that varies with driver and has "some"
sort of meaning.  Should this meaning be "hardware" or "software"?

Given a particular software driver, you can have different revs of the
driver and those won't be reflected in the ifconfig output, so it seems to
me that having the convention reflect software doesn't really work.  

From a debugging point of view, we'll always have to ask "what driver are
you running" given that it could be customized and we'll likely need to ask
what command line options are being passed anyway.

As a side note, we will indeed be shipping one and only one version of a
driver with product.  The fact that we have multiple drivers for some cards
now is an artifact of the driver research we were doing.  We don't intend to
duplicate existing work and what we will very likely do in the future is use
the NetBSD driver if it exists and fully port it.

We just had a quick over the wall conversation and that brought up the fact
that we also have to think about the io-net legacy drivers.  Ideally, if
we've decided that the naming convention refers to hardware then those
drivers should also register the same name to be completely consistent.
However, these drivers don't use the same ioctl interface that the others
do.  They register /dev/io-net/en? for devctls and if we change the name,
this will result in /dev/io-net/wm0 being registered instead.

On the one hand, these are legacy drivers and therefore should be wholly
consistent with their legacy operation.  If we change the names being
registered we will likely break existing code that users have in place
(they'll have to modify it to handle names other than enx).  If we don't,
then we've lost our consistent view.

Ideally, we'd like ifconfig to report the hardware name while the driver
still registers /dev/io-net/enx for compatibility, but that also strikes me
as confusing.  I'm thinking that legacy drivers are different and that as
little as possible should be done in terms of changing how they operate so
we live with what's there today.

So I'll stop there and see what the community has to say.  Any feedback on
how this should play out?  Any preferences?

One thing that we did talk about is adding a command line option that would
allow a user to register whatever name that they want for a driver.  Let us
know if that would be useful as well.


	Robert.






-----Original Message-----
From: Sean Boudreau [mailto:seanb@qnx.com] 
Sent: Sunday, January 06, 2008 9:49 PM
To: drivers-networking
Subject: Re: io-pkt native driver device names

On Sun, Jan 06, 2008 at 05:22:22PM -0500, Andrew Boyd wrote:
> > we shouldn't be supporting both a
> > NetBSD and native version 
> 
> I suspect that both will end up
> in use, for various reasons.
> 
> > if we have a native version there
> > should be a Makefile.dnm in the 
> > NetBSD version
> 
> That probably will not present an
> insurmountable obstacle for...
View Full Message