From owner-freebsd-stable@FreeBSD.ORG Sat Mar 17 06:59:02 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3666106564A for ; Sat, 17 Mar 2012 06:59:01 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id C3F038FC15 for ; Sat, 17 Mar 2012 06:59:01 +0000 (UTC) Received: by dald2 with SMTP id d2so7633714dal.13 for ; Fri, 16 Mar 2012 23:59:01 -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=V0EUfasP7c64Yqrv575dRcyFxS2P6tz3d0iY2YbFkKQ=; b=skGc8iwv/m2GBEOXxCNtVDqUpvHYqELBnkO7g2/Ow5pOjmrlm7ArKB4mnwkFF3B+6D vWHS7Y2JswR7HsY7eQlSwb9WsnuEQxQn66dsbNcLqlGx6id7iup8x48yEl9ZGAEnp07R iQPsZ4t2KMFOY9lOwueK+0tq12T2qf1081vn3ZL/xuYEuAoW7v0WPMGYLbgfzzJLbYhk uXKjtSJvfAFj3XKcLXpaYLRcTZOG3XCt5Dx6rzmVnzAjwli4p5Hp9JmwsQVwqzOaFpYF dHGgzOUeDb9vYj4OWDjcsUh43syhY9tKKz4vm/GZdaNCWeoeFtxNNHe2GAWqIPkwcafe XIdg== Received: by 10.68.211.168 with SMTP id nd8mr21490301pbc.25.1331967541330; Fri, 16 Mar 2012 23:59:01 -0700 (PDT) Received: from pyunyh@gmail.com ([114.111.62.249]) by mx.google.com with ESMTPS id w6sm6027599pbf.66.2012.03.16.23.58.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Mar 2012 23:59:00 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sat, 17 Mar 2012 15:58:58 -0700 From: YongHyeon PYUN Date: Sat, 17 Mar 2012 15:58:58 -0700 To: Mike Tancsa Message-ID: <20120317225858.GA1660@michelle.cdnetworks.com> References: <4F63A772.30406@sentex.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <4F63A772.30406@sentex.net> User-Agent: Mutt/1.4.2.3i Cc: FreeBSD-STABLE Mailing List Subject: Re: fxp entering promiscuous mode causing link to bounce X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 17 Mar 2012 06:59:02 -0000 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 16, 2012 at 04:49:54PM -0400, Mike Tancsa wrote: > I dont recall seeing this on RELENG_7, but I dont have a box to test with anymore confirm. On one box I upgraded to RELENG_8 I just noticed the nic will bounce if I enable tcpdump on it. Sure enough, trying on a different RELENG_8 box with an fxp nic shows the same result. > > eg > > tcpdump -ni fxp0 -c 20 > > fxp0: link state changed to DOWN > fxp0: promiscuous mode enabled > fxp0: link state changed to UP > fxp0: link state changed to DOWN > fxp0: promiscuous mode disabled > fxp0: link state changed to UP > > I verified it on 2 different boxes. Is there a way to prevent this from happening ? > It looks like a regression introduced in flow control support. I think stable/7 also has the same code so you will see the same issue on stable/7. However if you don't see the issue on stable/7 I can't explain that. Anyway, try attached patch and let me know how it works. I found other places which will result in link DOWN/UP so changed them to get previous good behavior. --KsGdsel6WgEHnImy Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fxp.media.diff" Index: sys/dev/fxp/if_fxp.c =================================================================== --- sys/dev/fxp/if_fxp.c (revision 233076) +++ sys/dev/fxp/if_fxp.c (working copy) @@ -902,7 +902,7 @@ FXP_LOCK(sc); /* Clear wakeup events. */ CSR_WRITE_1(sc, FXP_CSR_PMDR, CSR_READ_1(sc, FXP_CSR_PMDR)); - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); fxp_stop(sc); FXP_UNLOCK(sc); } @@ -2810,7 +2810,7 @@ if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) && ((ifp->if_flags ^ sc->if_flags) & (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0) - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) fxp_init_body(sc, 1); } else { @@ -2916,7 +2916,7 @@ reinit++; } if (reinit > 0 && ifp->if_flags & IFF_UP) - fxp_init_body(sc, 1); + fxp_init_body(sc, 0); FXP_UNLOCK(sc); VLAN_CAPABILITIES(ifp); break; --KsGdsel6WgEHnImy--