From owner-freebsd-arch Sat Dec 12 13:00:02 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA25757 for freebsd-arch-outgoing; Sat, 12 Dec 1998 13:00:02 -0800 (PST) (envelope-from owner-freebsd-arch@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA25728 for ; Sat, 12 Dec 1998 13:00:00 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id VAA23928 for ; Sat, 12 Dec 1998 21:59:58 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id VAA25462 for freebsd-arch@freebsd.org; Sat, 12 Dec 1998 21:59:58 +0100 (MET) Received: from octopus.originative.co.uk (originat.demon.co.uk [158.152.220.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA25630; Sat, 12 Dec 1998 12:57:22 -0800 (PST) (envelope-from paul@originative.co.uk) Received: by OCTOPUS with Internet Mail Service (5.5.1960.3) id ; Sat, 12 Dec 1998 20:56:01 -0000 Message-ID: From: Paul Richards To: "'Poul-Henning Kamp'" , arch@FreeBSD.ORG Subject: RE: IFF_UP, IFF_RUNNING semantics... Date: Sat, 12 Dec 1998 20:55:58 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > -----Original Message----- > From: Poul-Henning Kamp [mailto:phk@FreeBSD.ORG] > Sent: Saturday, December 12, 1998 7:44 PM > To: arch@FreeBSD.ORG > Subject: IFF_UP, IFF_RUNNING semantics... > > > > I'm trying to unravel how IFF_UP and IFF_RUNNING is supposed to work. > > I would expect one of them (IFF_RUNNING ?) to mean "should be > running" as in "root configured this one to be running" and the > other (IFF_UP ?) to mean "is running" as in "hardware/protocols > are ready to pass packets". I think that's more or less it. Stevens says IFF_RUNNING is "resources are allocated" and IFF_UP is "interface is running". > In this model, IFF_UP would control the routes. Either by yanking > the route when IFF_UP disappears, or by not selecting routes where > the interface doesn't have IFF_UP set. > > Looking over the sources, it is obvious that very few people if any > have any idea about the semantics about IFF_UP and IFF_RUNNING either. > > For an example why this is important imagine an UTP ethernet which > doesn't receive a heartbeat. In that case the hardware knows the > interface is down and the route should be disabled so the packets > could attempt to flow another way. In this case I'd say the driver should drop IFF_UP but not IFF_RUNNING since while resources are allocated for it to run the hardware isn't allowing it to. In my lnc driver (which is the same as most drivers I think including the example in Stevens Illustrated Vol2) it's closely tied to the hardware. If the lance initialises ok and the chip is running then IFF_RUNNING is set. This either happens at boot or when IFF_UP is set and IFF_RUNNING isn't, in which case lnc_start is called. If IFF_UP is cleared i.e. the interface is going down, then the lance chip is stopped and IFF_RUNNING is cleared. Therefore, IFF_RUNNING is basically an indication of whether the lance chip is running or not. The driver doesn't do anything for things like heartbeat failures other than report them. I guess it might make sense to clear IFF_UP. I'm not sure how you'd restart the interface if a transient hardware problem went away though. It's not clear from Stevens exactly what he means by "resources allocated" and he only mentions IFF_RUNNING once and that's in a table on p.67 Vol2. From a quick grep of the networking sources (sys/net*) IFF_RUNNING seems to be virtually unused, it only appears in a handful of files, mainly pseudo drivers and even then it's just or'd with IFF_UP. Paul Richards Ph.D. Originative Solutions Ltd To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message