From owner-freebsd-embedded@FreeBSD.ORG Tue Mar 23 23:39:09 2010 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B7BD106564A; Tue, 23 Mar 2010 23:39:09 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 704DB8FC16; Tue, 23 Mar 2010 23:39:09 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.241.148] (natint3.juniper.net [66.129.224.36]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KZR00LMDDOH4030@asmtp028.mac.com>; Tue, 23 Mar 2010 16:38:43 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1003230269 From: Marcel Moolenaar In-reply-to: <20100323230351.GI1278@michelle.cdnetworks.com> Date: Tue, 23 Mar 2010 16:38:40 -0700 Message-id: <00BE3C94-8C04-4E00-9617-1DB07C7FAF42@mac.com> References: <4BA8CF0E.50201@freebsd.org> <20100323.094126.787670930724128348.imp@bsdimp.com> <20100323230351.GI1278@michelle.cdnetworks.com> To: pyunyh@gmail.com X-Mailer: Apple Mail (2.1077) Cc: powerpc@freebsd.org, embedded@freebsd.org, nwhitehorn@freebsd.org Subject: Re: Anyone using BOOTP with latest current (Book-E)? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2010 23:39:09 -0000 On Mar 23, 2010, at 4:03 PM, Pyun YongHyeon wrote: >> I looked at whether we restart autoneg if the PHY is in autoneg already because >> I've seen at Juniper how that can contribute to excessive link flaps and even >> excessive autoneg completion times (>40 seconds) depending on the switch and >> did this: >> >> Index: dev/mii/ciphy.c >> =================================================================== >> --- dev/mii/ciphy.c (revision 205451) >> +++ dev/mii/ciphy.c (working copy) >> @@ -176,13 +176,11 @@ >> >> switch (IFM_SUBTYPE(ife->ifm_media)) { >> case IFM_AUTO: >> -#ifdef foo >> /* >> * If we're already in auto mode, just return. >> */ >> if (PHY_READ(sc, CIPHY_MII_BMCR) & CIPHY_BMCR_AUTOEN) >> return (0); >> -#endif >> (void) mii_phy_auto(sc); >> break; >> case IFM_1000_T: >> >> >> Apparently the author already considered the same and it does resolve the issue. >> Anyone see any concerns with my applying this patch? >> > > I'm not sure but I guess the #ifdef foo block could be completely > nuked. The auto-negotiation timeout is set to 17 seconds for > gigabit link and ciphy(4) will reprogram BMCR if auto-negotiation > was not resolved after that timeout. That's besides the point. calling mii_phy_auto() while autoneg is ongoing aborts the autoneg and restarts it. This causes a link flap and makes some switches cranky. What the patch does is to not enable autoneg when autoneg is already enabled so that we don't interfere with the autoneg handshake. -- Marcel Moolenaar xcllnt@mac.com