From owner-freebsd-stable@FreeBSD.ORG Tue May 28 02:33:16 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2B930ADF; Tue, 28 May 2013 02:33:16 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx1.freebsd.org (Postfix) with ESMTP id E6349EFA; Tue, 28 May 2013 02:33:15 +0000 (UTC) Received: by mail-pd0-f179.google.com with SMTP id q11so7092211pdj.10 for ; Mon, 27 May 2013 19:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=rgjbAnF0k32dGXoJz+bxrOfeKokwL2I7qgArBrN2b+E=; b=ohGNvJzF+/Zqewv6W2CVj763Lmwi/RzjPs+YMZoRzbE2nf9oBYC7jg3ligURBCpYGp LtWy3CZc6od0tDjCx1EtNVv5m0nZ7W4IJWP9ZC/oAgidnJtGagZxsHlBx9aw1RmwOFks g4Q8HtLCTIkjSBZNNn0tjFjKB7wO7tZLSODxi3PsMrKUxjNVbnJcGTBTh8UTl1fU+NhO +6hXVSaowL3uxWuEm6E88IqNbD9ZFQnzPkajuj8ITjvP4frNFGOuFzl2QqE4GHnm4X+5 ojuF2qIGh7GLXYT60sTlgUN3P0bCMus3f+E4C/UJzffYrUgVuMZWf+PC7P2orsBoef/A B2Rg== X-Received: by 10.66.144.170 with SMTP id sn10mr32121998pab.42.1369708388643; Mon, 27 May 2013 19:33:08 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id l16sm2240953pag.22.2013.05.27.19.33.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 19:33:07 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 28 May 2013 11:33:00 +0900 From: YongHyeon PYUN Date: Tue, 28 May 2013 11:33:00 +0900 To: "Michael L. Squires" Subject: Re: Apparent fxp regression in FreeBSD 8.4-RC3 Message-ID: <20130528023300.GA3077@michelle.cdnetworks.com> References: <20130524044919.GA41292@icarus.home.lan> <20130524054720.GA1496@michelle.cdnetworks.com> <20130524.162926.395058052118975996.hrs@allbsd.org> <20130524.163646.628115045676432731.hrs@allbsd.org> <20130526113841.GA1511@michelle.cdnetworks.com> <20130527043923.GA1480@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: jdc@koitsu.org, gjb@freebsd.org, freebsd-stable@freebsd.org, re@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 02:33:16 -0000 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 27, 2013 at 01:02:14PM -0400, Michael L. Squires wrote: > > On Mon, 27 May 2013, YongHyeon PYUN wrote: > > >On Sun, May 26, 2013 at 08:38:41PM +0900, YongHyeon PYUN wrote: > >>On Fri, May 24, 2013 at 04:36:46PM +0900, Hiroki Sato wrote: > >>>Hiroki Sato wrote > >>> in <20130524.162926.395058052118975996.hrs@allbsd.org>: > >>> > >>>hr> YongHyeon PYUN wrote > >>>hr> in <20130524054720.GA1496@michelle.cdnetworks.com>: > >>>hr> > >>>hr> A workaround is specifying the following line in rc.conf: > >>>hr> > >>>hr> ifconfig_fxp0="DHCP media 100baseTX mediaopt full-duplex" > >>> > > Sorry I've been offline, two trips last week. > > I've installed 8.4-RELEASE on the NAT box with the fxp interface: > > FreeBSD familysquires.net 8.4-RELEASE FreeBSD 8.4-RELEASE #54: Sun May 26 > 22:56:19 EDT 2013 root@familysquires.net:/usr/obj/usr/src/sys/NEWGATE > i386 > > and am using the workaround given above which has stopped the fxp interface > cycling on/off. > > I'll have access to the other box on Wednesday and will try the other test. Here is patch I'm testing and it seems to work with dhclient on CURRENT. Mike, could you try attached patch? > > Mike Squires > mikes@siralan.org --EeQfGwPcQSOJBaQU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fxp.init.diff" Index: sys/dev/fxp/if_fxp.c =================================================================== --- sys/dev/fxp/if_fxp.c (revision 251021) +++ sys/dev/fxp/if_fxp.c (working copy) @@ -1075,7 +1075,8 @@ fxp_suspend(device_t dev) pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; sc->flags |= FXP_FLAG_WOL; /* Reconfigure hardware to accept magic frames. */ - fxp_init_body(sc, 1); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + fxp_init_body(sc, 0); } pci_write_config(sc->dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } @@ -2141,8 +2142,10 @@ fxp_tick(void *xsc) */ if (sc->rx_idle_secs > FXP_MAX_RX_IDLE) { sc->rx_idle_secs = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 1); + } return; } /* @@ -2240,6 +2243,7 @@ fxp_watchdog(struct fxp_softc *sc) device_printf(sc->dev, "device timeout\n"); sc->ifp->if_oerrors++; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 1); } @@ -2274,6 +2278,10 @@ fxp_init_body(struct fxp_softc *sc, int setmedia) int i, prm; FXP_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel any pending I/O */ @@ -2813,6 +2821,7 @@ fxp_miibus_statchg(device_t dev) */ if (sc->revision == FXP_REV_82557) return; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); } @@ -2836,9 +2845,10 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr if (ifp->if_flags & IFF_UP) { if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && ((ifp->if_flags ^ sc->if_flags) & - (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) + (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); - else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) fxp_init_body(sc, 1); } else { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) @@ -2851,8 +2861,10 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr case SIOCADDMULTI: case SIOCDELMULTI: FXP_LOCK(sc); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); + } FXP_UNLOCK(sc); break; @@ -2942,8 +2954,10 @@ fxp_ioctl(struct ifnet *ifp, u_long command, caddr ~(IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM); reinit++; } - if (reinit > 0 && ifp->if_flags & IFF_UP) + if (reinit > 0 && (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; fxp_init_body(sc, 0); + } FXP_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; --EeQfGwPcQSOJBaQU--