Date: Sat, 17 Mar 2012 15:58:58 -0700 From: YongHyeon PYUN <pyunyh@gmail.com> To: Mike Tancsa <mike@sentex.net> Cc: FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org> Subject: Re: fxp entering promiscuous mode causing link to bounce Message-ID: <20120317225858.GA1660@michelle.cdnetworks.com> In-Reply-To: <4F63A772.30406@sentex.net> References: <4F63A772.30406@sentex.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120317225858.GA1660>