From owner-freebsd-stable@FreeBSD.ORG Wed Jul 10 01:44:44 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 717AC27A for ; Wed, 10 Jul 2013 01:44:44 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pd0-x236.google.com (mail-pd0-x236.google.com [IPv6:2607:f8b0:400e:c02::236]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9261B2B for ; Wed, 10 Jul 2013 01:44:44 +0000 (UTC) Received: by mail-pd0-f182.google.com with SMTP id r10so5868519pdi.27 for ; Tue, 09 Jul 2013 18:44:43 -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:content-transfer-encoding :in-reply-to:user-agent; bh=rf66J0jEmWOw8Nh/CTPW/3hN/1EpFLxU+TqY2IbOIGo=; b=W6/SO3Qc6mrYSS9uI0r+Qk+htauFw3875lO9+thTnsaKt4L2DChPfJMB7UwQUqby8b 1EqgHHIlBi3F6gzIMbdQFCaoJL/LqOdHgZLlaV/FsXUzRop+rXVRdNN8Z0AqRi57cT16 4adl9Rt8u+4QvieI6Cup+vPdYz1TwMIXBJnZhNLZmVQD1IClun6Qzrg/sfFGSNxqAxj8 XdXPLnqhVNhI/EW44X962T+iLYAHZFlAUxEM75VvLZtIgaXMD90or5T3P6jUlNPi7PwQ eb79IeMhdbZJItVvaKyEekdlwHjE1D3IC4nXyC4iuezuSfhTG60Q8YwWu+qlCtgjclVl +/hw== X-Received: by 10.66.224.237 with SMTP id rf13mr31027704pac.26.1373420683792; Tue, 09 Jul 2013 18:44:43 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPSA id we2sm33035774pab.0.2013.07.09.18.44.40 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 09 Jul 2013 18:44:42 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 10 Jul 2013 10:44:36 +0900 From: Yonghyeon PYUN Date: Wed, 10 Jul 2013 10:44:36 +0900 To: dcx dcy Subject: Re: hme0 interface going up/down (dhclient ?) Message-ID: <20130710014436.GA2753@michelle.cdnetworks.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: "freebsd-stable@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: Wed, 10 Jul 2013 01:44:44 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Jul 09, 2013 at 02:05:30PM +0000, dcx dcy wrote: > Hi all, > > I am having an issue where my hme0 interface is always turning up and down with dhclient requesting a lease. > > > > I am thinking this could be the same issue described by Jeremy Chadwick on June 9th: > > http://lists.freebsd.org/pipermail/freebsd-stable/2013-June/073711.html > > > > Everything was fine on 8.2-STABLE and older versions. > > > > It was then upgraded directly to 9.0-STABLE and this is where I started having issues­. > > > > I am currently running 9.1-STABLE (July 7th) and issue persists. > > > > This is a Sun Netra T1 acting as my home gateway, hme0 is connected to a Cisco switch. > > I am normally using DHCP to get an ip from my ISP. > > > > For now, the only way it works is to set a static ip (I tried different dhclient options ... sync, etc). > > > > hme1 and ath0 (AR5413) is serving internal network. > Try attached patch and let me know whether it makes any difference for you. --/04w6evG8XlLl3ft Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="hme.diff" Index: sys/dev/hme/if_hme.c =================================================================== --- sys/dev/hme/if_hme.c (revision 253125) +++ sys/dev/hme/if_hme.c (working copy) @@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc) u_int32_t n, v; HME_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Initialization sequence. The numbered steps below correspond * to the sequence outlined in section 6.3.5.1 in the Ethernet @@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int status) /* check for fatal errors that needs reset to unfreeze DMA engine */ if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) { HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status); + sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING; hme_init_locked(sc); } } @@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc) device_printf(sc->sc_dev, "device timeout (no link)\n"); ++ifp->if_oerrors; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; hme_init_locked(sc); hme_start_locked(ifp); return (EJUSTRETURN); --/04w6evG8XlLl3ft--