if_le unit number change?

John Baldwin jhb at freebsd.org
Thu Dec 4 21:25:14 UTC 2008


On Thursday 27 November 2008 02:59:02 pm Marius Strobl wrote:
> On Thu, Nov 27, 2008 at 09:36:48AM +0000, Robert Watson wrote:
> > 
> > On Wed, 26 Nov 2008, Jia-Shiun Li wrote:
> > 
> > >I use vmware to run freebsd.
> > >
> > >recent update of 8-current changed the unit number of the virtual network 
> > >interface, an emulated if_le. usually the unit number should start from 0 
> > >,namely le0. But after updating the source, le0 becomes le1. This makes 
> > >interface name mismatching that in rc.conf. I checked the commit log but 
> > >there seems nothing related in sys/dev/le. So should this be caused by 
> > >something else?
> > >
> > >The kernels dated 11/5 & 11/26.
> > 
> > Just ran into an identical problem with HEAD on VMWare here as well.  It 
> > appears to work fine as le1, which is reassuring, but the unit numbering 
> > change is worrying.  I may get a chance to do some binary searching today, 
> > but we'll see.
> > 
> 
> I think the reason is that since r185059 the isa(4) hints (in this
> case the default one for le0) are now also applied to acpi(4).
> Even previously reserving the device unit number corresponding to
> the hint (i.e. le0 for hint.le.0.at="isa") regardless of whether
> it's actually present and enabled or not was the expected beaviour
> AFAICT, although limited to the presence of a ISA bus.

ISA hints were always applied to ACPI, but in odd ways.  For example, if you 
had 'hint.sio.0.port=0x3f8' and 'hint.sio.0.flags=0x10' but ACPI's sio0 was 
actually at some other I/O port, it would still use the sio0 flags.  The 
change now is that hints always "reserve" a device name/unit.  If a bus 
driver determines that a set of hints matches a device it can self-enumerate 
(e.g. ACPI namespace or PNPBIOS), then it can let the self-enumerated device 
take over the "reserved" device name/unit.  In effect, you can wire device 
name/units based on resources (only acpi(4) and isa(4) support this 
currently).

I tend to trim my /boot/device.hints to remove hints for devices that aren't 
in my machines.  However, with 8.0, if you leave the bogus hints around you 
won't be hurt and the device will stay as 'le1' so long as you don't remove 
the 'le0' hints, so if you never edit your /boot/device.hints it will just be 
called le1 forever.

-- 
John Baldwin


More information about the freebsd-current mailing list