Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2013 10:44:36 +0900
From:      Yonghyeon PYUN <pyunyh@gmail.com>
To:        dcx dcy <dcbsdx@hotmail.com>
Cc:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   Re: hme0 interface going up/down (dhclient ?)
Message-ID:  <20130710014436.GA2753@michelle.cdnetworks.com>
In-Reply-To: <BAY169-W1351ED468D1E1F35EBF1A69C5790@phx.gbl>
References:  <BAY169-W1351ED468D1E1F35EBF1A69C5790@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help

--/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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130710014436.GA2753>