From owner-svn-src-all@FreeBSD.ORG Fri Mar 12 07:27:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF271065680; Fri, 12 Mar 2010 07:27: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 533CA8FC15; Fri, 12 Mar 2010 07:27:01 +0000 (UTC) Received: by qyk5 with SMTP id 5so1038985qyk.13 for ; Thu, 11 Mar 2010 23:27: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=rHQiFu2rIm5f1MoGhgk1D5eveOlklsJpKRfQaNbOMT0=; b=b8VkVf18WcV6iZ8diIOMsEpS2tYtbduWDfGZ0TLOyBlU6DBZ35PGdcitSolM16N1js u5SHc3gUWKDZVguKdhgn77DJP0YRiYZ4kJV8ueEi37googuWUmv8kY8Vb8OG3b9/XrXk y66kHUs+IpUR3xStTUTDRQY8TEI4xg6xJSYx8= 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=Ooxvy4+hJhsGpZqjpj1paWWv1aoJJ1jXJp5Hu0hqz7S475xGjsgPVQb9oXpdZ/njvl 6TlETVZ85jqCIrDQxOHxQSWN9whnpTk7kMhZlLBO4OA3taUGtio0U6GyYDpx875rZzui JMeqfzXDU+0phdjN7kgq7BifPKurTEgWmSyNE= MIME-Version: 1.0 Sender: tomelite82@gmail.com Received: by 10.220.107.213 with SMTP id c21mr824766vcp.104.1268378820450; Thu, 11 Mar 2010 23:27:00 -0800 (PST) In-Reply-To: <4B99EA09.80108@elischer.org> References: <201003111756.o2BHukJu042449@svn.freebsd.org> <9ace436c1003111530s3bd0de9cq451671909fb6aa64@mail.gmail.com> <9ace436c1003111539t2af8439cn315c695d4b90e28d@mail.gmail.com> <4B99EA09.80108@elischer.org> Date: Thu, 11 Mar 2010 23:27:00 -0800 X-Google-Sender-Auth: 64db781cfbb8b09e Message-ID: <9ace436c1003112327i3350a0e8n9f6d5e917e9d1411@mail.gmail.com> From: Qing Li To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Juli Mallett , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r205024 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2010 07:27:02 -0000 That's a good idea. I will take your approach. -- Qing On Thu, Mar 11, 2010 at 11:15 PM, Julian Elischer wro= te: > Juli Mallett wrote: >> >> On Thu, Mar 11, 2010 at 15:39, Qing Li wrote: >>> >>> I guess it's a good time to clean things up. The if_link_state code has >>> been >>> around for quite some time, either it be fully utilized or not be there >>> at all. >>> The inconsistency is the root cause. >> >> Sure. =A0There is an increasing amount of stuff that network drivers are >> expected to do, but they work without doing them. =A0It's easy to think >> you have a functioning network driver and that you can get by without >> adding support for media changes and link status reporting, etc. >> >>> I will try going through these tonight and hopefully the fix all take a >>> common approach. > > probably should add a flag that means "we have media state" > and if it is not set, assume it is always on. > >> >> If you can think of a way to add some invariants (warn the first time >> a driver receives a packet without having ever set the link state, >> make sure the media status callback sets the valid flag in the >> request, etc) that would probably be very helpful for people who are >> writing network drivers. =A0If I hadn't been following the threads about >> your changes, I would have had to spend much longer fixing the Octeon >> port's Ethernet driver, wondering why suddenly it broke and >> instrumenting the routing code. =A0A printf would go a long way. >> >> Juli. > >