if_link_state_change() patch for review

Sam Leffler sam at errno.com
Tue Apr 19 08:24:33 PDT 2005


Andre Oppermann wrote:
> Gleb Smirnoff wrote:
> 
>>On Tue, Apr 19, 2005 at 02:08:28PM +0200, Andre Oppermann wrote:
>>A> Gleb Smirnoff wrote:
>>A> > A> You have to be careful here indeed.  If the link is rapidly flapping
>>A> > A> then you only want to report changes in status.  For example when
>>A> > A> it going down, up, down and all these events got queued it doesn't
>>A> > A> make sense to report down->down.  This could indeed confuse some
>>A> > A> tools and isn't very useful.  Either you check the first event vs.
>>A> > A> the last one if there is a change in state or you just take the events
>>A> > A> as trigger to have a look at the interface status when the ithread
>>A> > A> runs.  There however you'd have to track the previous state to detect
>>A> > A> changes.
>>A> >
>>A> > I do not know any applications which would be confused, yet. Also, while
>>A> > event coalescing is possible theoretically, I failed to reproduce it. I've
>>A> > added a debugging printf, so we will see if anyone experiences these
>>A> > coalescing events at all.
>>A>
>>A> It doesn't really make sense, so we better don't do it and document
>>A> that fact.
>>
>>Well, the printf won't hurt anyone. And it is really interesting if this
>>is practically possible.
> 
> 
> I don't care about an printf.

I don't know what this means--do you not want the printf or you do not 
care that it's been included in the change?

 > I just asked Claudio(@openbsd.org) what
> OpenBGPd is assuming.  It doesn't fall over if it gets an up->up or
> down->down event but they assumed it doesn't happen and the linke state
> change message will report either all state changes or those where at
> the time of reporting the state changed relative to the last report.
> The same assumption is true for the OpenIGPd we are working on at the
> moment.

It is possible with the change to defer the messages to have multiple 
changes coalesced.  If an app is written to assume it receives notice of 
every change and it uses this to track internal state then it can get 
confused.  The issue was whether or not to communicate any coalescing to 
applications so they can recognize that it's happened.  In lieu of doing 
that I asked for a console printf so we could see if it ever happened in 
practice.

> 
> From an (routing) application point of view only effective state changes
> are interesting and only those should be provided.
> 

If an inteface does down, moves network, then comes back up and you only 
get the up event then you will likely do the wrong thing unless you have 
some other way of identifying what happened.  I'm not convinced (yet) 
this cannot happen so am being cautious.

	Sam


More information about the freebsd-net mailing list