dev/em: Link is not up until 2 seconds after "ifconfig up"

Jacques A. Vidrine nectar at FreeBSD.org
Mon Dec 8 09:23:26 PST 2003


On Sun, Dec 07, 2003 at 04:41:39PM +0900, Jun Kuriyama wrote:
> 
> My experimental 1U box which has em0 and em1 shows following result.
> Doing "ifconfig em1 up" after "ifconfig em1 down", link is down 1 or
> more seconds.  

A co-worker of mine noticed this same issue, but when adding alias IP
addresses, e.g. `ifconfig em0 ... alias' causes a 1-2 second delay
each time it is invoked.  The workaround he used here was to make the
code match the comment in in_ifinit():

     671         /*                                                            
     672          * Give the interface a chance to initialize                  
     673          * if this is its first address,                              
     674          * and to validate the address if necessary.                  
     675          */                                                           
     676         if (ifp->if_ioctl &&                                          
     677             (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {

(e.g. add a IFF_RUNNING check to this condition.)  Ultimately this
just avoids calling the driver's if_init routine every time `ifconfig
... alias' is run.  But, I don't think this workaround will work for
you, since you actually *are* bringing the interface up and down.

I suspect there is something amiss in the driver, but I haven't been
able to figure out the real issue myself, and I haven't gotten a
response from pdeuskar@ (I reported the issue several months back).

Cheers,
-- 
Jacques Vidrine   NTT/Verio SME      FreeBSD UNIX       Heimdal
nectar at celabo.org jvidrine at verio.net nectar at freebsd.org nectar at kth.se


More information about the freebsd-current mailing list