From owner-freebsd-net@FreeBSD.ORG Fri Aug 29 03:18:30 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 504C51065678 for ; Fri, 29 Aug 2008 03:18:30 +0000 (UTC) (envelope-from jacoblowens@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id CAA288FC1A for ; Fri, 29 Aug 2008 03:18:29 +0000 (UTC) (envelope-from jacoblowens@gmail.com) Received: by ey-out-2122.google.com with SMTP id 6so191671eyi.7 for ; Thu, 28 Aug 2008 20:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=lEF6lMtwAwVkh+E9IS85u4GMOWpHjdipRtM+Og3g2sE=; b=QckgbFnaTh9RZiut49p5AEbg414VVaD6Q6V3X242VrQZjncyEwLjXB7eAE5lLHq49U b6WhMUSPRB/GAsaAczgxE1WmnMJZ1W+WekuX4VWta7lGTu0BR65er5Wm+ODBlFV192Ca hUszCr5y6ZIcGEmRKJEfp7pit4U7wUI9C86I0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=ajPO+VbpV7R0zH61aX3EDLnKvTtdycctAonA6wRXi9EL3RoCiexSrebmP4DH2oq6RQ BbjemUlXAclwOYcjz1KpCzYkCbMPCdh/pQnz+AnAKPiKRfzIr/FhWZ2BPQXknrExfk8t jCCf1wREVaCk3B8vYHocLZF5TiANb0MLa1p0g= Received: by 10.210.71.12 with SMTP id t12mr887388eba.36.1219979908147; Thu, 28 Aug 2008 20:18:28 -0700 (PDT) Received: by 10.210.116.9 with HTTP; Thu, 28 Aug 2008 20:18:28 -0700 (PDT) Message-ID: Date: Thu, 28 Aug 2008 22:18:28 -0500 From: "Jacob Owens" To: freebsd-net@freebsd.org In-Reply-To: <20080813044809.GD58659@cdnetworks.co.kr> MIME-Version: 1.0 References: <20080809082539.GC42339@cdnetworks.co.kr> <20080812013739.GB54362@cdnetworks.co.kr> <20080813044809.GD58659@cdnetworks.co.kr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: lagg failover not automatic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2008 03:18:30 -0000 To resolve the issue, Pyun first had my patch amphy.c , then the dc driver. The DC patch fixed my issue. Here is what i had to do: 1. save attached patch to /tmp 2. #cd /usr/src 3. #patch -p0 < /tmp/dc.patch 4. rebuild/install kernel and reboot. i used instructions from here: http://www.freebsdmadeeasy.com/tutorials/freebsd/recompiling-the-kernel-in-freebsd.php THANK YOU to Pyun YongHyeon and the freebsd-net group for helping me with this issue!!! Save the text below and save as dc.patch. (The first line is 'index: sys/dev/dc......' ,Last line is ' * When the init.....' Index: sys/dev/dc/if_dc.c =================================================================== --- sys/dev/dc/if_dc.c (revision 181654) +++ sys/dev/dc/if_dc.c (working copy) @@ -2868,6 +2868,12 @@ ifp = sc->dc_ifp; mii = device_get_softc(sc->dc_miibus); + /* + * XXX Can cause autonegotiation failure on certain models + * as DC21143 overdrive mii_ticks. + */ + mii_tick(mii); + if (sc->dc_flags & DC_REDUCED_MII_POLL) { if (sc->dc_flags & DC_21143_NWAY) { r = CSR_READ_4(sc, DC_10BTSTAT); @@ -2881,19 +2887,15 @@ sc->dc_link = 0; mii_mediachg(mii); } - if (sc->dc_link == 0) - mii_tick(mii); } else { r = CSR_READ_4(sc, DC_ISR); if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT && sc->dc_cdata.dc_tx_cnt == 0) { - mii_tick(mii); if (!(mii->mii_media_status & IFM_ACTIVE)) sc->dc_link = 0; } } - } else - mii_tick(mii); + } /* * When the init routine completes, we expect to be able to send On Tue, Aug 12, 2008 at 11:48 PM, Pyun YongHyeon wrote: > > On Tue, Aug 12, 2008 at 08:49:20AM -0500, Jacob Owens wrote: > > pyun, > > > > Thank you! I am not familiar with patching freebsd. i tried: > > > > # patch < amphy.diff > > > > then it asked me to pick a file.i entered: /sys/dev/mii/amphy.c > > > > then i recompiled my kernel. I don't know if the patch was applied > > correctly. either way, it didn't change anything. > > > > Thanks for testing! I've checked dc(4) and link state checking code > in the driver looks questionable. So I made a patch but I don't > know whether it helps or not. The patch can even break establishing > link so you should be very careful before applying the patch and > should not apply the patch if you have no physical acesss to the > hardware. Would you give it a try? > > Note, I'm not familiar with dc(4) and dc(4) supports too many > variants. It seems that each controller needs different workaround > to overcome its hardware limitation. Link state handling seems to > be one of reason why dc(4) didn't periodically invoke link state > check clock. I would be on vacation from Aug 14 for a week so don't > expect quick reply. > > # You can apply the patch with the following command. > 1. save attached patch to /tmp > 2. #cd /usr/src > 3. #patch -p0 < /tmp/dc.patch > 4. rebuild/install kernel and reboot. > > -- > Regards, > Pyun YongHyeon