From owner-svn-src-head@FreeBSD.ORG Fri Mar 12 08:30:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FF58106566B; Fri, 12 Mar 2010 08:30:02 +0000 (UTC) (envelope-from tomelite82@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.221.175]) by mx1.freebsd.org (Postfix) with ESMTP id 6F07F8FC1E; Fri, 12 Mar 2010 08:30:01 +0000 (UTC) Received: by qyk5 with SMTP id 5so1080777qyk.13 for ; Fri, 12 Mar 2010 00:30:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=wfis95glzt45iBBmbt8u6PY1aai4p8/avm1itvsZe1U=; b=k0/0+tKnYN8shP6DMhfdqNFyq3SdD8qKMfhUMLLi0QRN9clurAqILwlwMO6HYM0O8e 6l3AbyBwwpfxRd6mwpOGjgpdvgBxYpUTQTI9UPCnT2GY/2vzZ6bW1hNF6WYqHlk67OQB E4Sii136VIJCT9frztTbJPVxofr4rIbJKgtz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=RVz0bOTaEzCMEPE9y04/zc6G8HcyJLHSSbFWa2/hdRJ1HHtZM1Y7m7j3nwBjI8CsAx zvsOcL/u7WewSlzqCqHrrbq2mYV7HqJlcy+Vtj0MTsYOzcXRayYGinvUr3vLTVt2qGyj 5t7r2ZmGpUIUNSWHYWraMkhDBG6vpdSnRQkfg= MIME-Version: 1.0 Sender: tomelite82@gmail.com Received: by 10.220.89.83 with SMTP id d19mr868307vcm.209.1268382600545; Fri, 12 Mar 2010 00:30:00 -0800 (PST) In-Reply-To: <8726950E-5110-4FE1-90BB-B4205D637764@freebsd.org> References: <201003111756.o2BHukJu042449@svn.freebsd.org> <9ace436c1003111530s3bd0de9cq451671909fb6aa64@mail.gmail.com> <5ADB6F0D-11F1-4F9F-87A0-64F57063981E@freebsd.org> <9ace436c1003112352l3b2505ceq63d9c78954520497@mail.gmail.com> <9ace436c1003120011v3c627aadka2e57615ae01fe6f@mail.gmail.com> <8726950E-5110-4FE1-90BB-B4205D637764@freebsd.org> Date: Fri, 12 Mar 2010 00:30:00 -0800 X-Google-Sender-Auth: dcfbdb5f0faa8995 Message-ID: <9ace436c1003120030m39f518basc77c7cff40299008@mail.gmail.com> From: Qing Li To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r205024 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 08:30:02 -0000 I believe what Julian means is the following: 1. in the driver, I do this ifp->if_flags |=3D IFF_KNOWS_LINK_STATE; 2. In route.h, I do this if (ifp->flags & IFF_KNOWS_LINK_STATE) && (ifp->if_link_state =3D=3D LINK_STATE_UP) return 1; -- Qing On Fri, Mar 12, 2010 at 12:26 AM, Robert N. M. Watson wrote: > > On Mar 12, 2010, at 8:11 AM, Qing Li wrote: > >> I like Julian's suggestion because it is simple and very low risk. >> And there isn't a need to check for interface type any more. >> Here is why: >> >> 1. The interfaces that are popular and modern are already supporting >> =A0 =A0link_state. So for these drivers, and there are just a few, I wil= l go set >> =A0 =A0its if_flags to include "can change link_state". >> >> 2. For the existing dated drivers, because that flag bit is never set, >> =A0 =A0no check is done. >> >> 3. In the mean time, we try to convert the drivers progressively. >> >> 4. If one wants to do ECMP and not having packets go into a black >> =A0 =A0hole when the physical link is down, that person can ping the ML >> =A0 =A0and ask for driver compatibility list. If we haven't converted th= at >> =A0 =A0particular driver by then, we will update the driver if it's capa= ble >> =A0 =A0at that time. > > > Today, we support three link state values: > > 170 /* > 171 =A0* Values for if_link_state. > 172 =A0*/ > 173 #define LINK_STATE_UNKNOWN =A0 =A0 =A00 =A0 =A0 =A0 /* link invalid/u= nknown */ > 174 #define LINK_STATE_DOWN =A0 =A0 =A0 =A0 1 =A0 =A0 =A0 /* link is down= */ > 175 #define LINK_STATE_UP =A0 =A0 =A0 =A0 =A0 2 =A0 =A0 =A0 /* link is up= */ > > I'm confused about Julian's proposal because it seems to me that we alrea= dy know when a driver hasn't set or is unable to determine the link state: = it will (should) be set to LINK_STATE_UNKNOWN by default. > > So the only question we don't know the answer to, at run-time, is whether= a driver may *ever* set the link state (i.e., it thinks it knows how to), = and hence whether or not tools like dhclient should try to wait for that to= happen. That is the problem that an interface capability would solve. > > For the purposes of ECMP, you just need to decide on your policy: map UNK= NOWN to either UP or DOWN for your purposes. > > Robert