From nobody@FreeBSD.org  Fri Feb 11 02:10:42 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 56530106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 02:10:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 4626D8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 02:10:42 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p1B2Af8C047512
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 11 Feb 2011 02:10:41 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p1B2Af8J047511;
	Fri, 11 Feb 2011 02:10:41 GMT
	(envelope-from nobody)
Message-Id: <201102110210.p1B2Af8J047511@red.freebsd.org>
Date: Fri, 11 Feb 2011 02:10:41 GMT
From: Michiel Boland <michiel@boland.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: link stage change on multicast join/leave (fxp)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         154667
>Category:       kern
>Synopsis:       [fxp] link stage change on multicast join/leave
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 11 02:20:09 UTC 2011
>Closed-Date:    Mon Apr 18 23:34:10 UTC 2011
>Last-Modified:  Mon Apr 18 23:34:10 UTC 2011
>Originator:     Michiel Boland
>Release:        -CURRENT
>Organization:
>Environment:
FreeBSD charlemagne.boland.org 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Fri Feb 11 02:27:17 CET 2011     root@charlemagne.boland.org:/usr/obj/usr/src/sys/CHARLEMAGNE  amd64

>Description:
Joining or leaving a multicast group causes a link flap on an fxp interface,
leaving the interface down for about two seconds after the join/leave.

Other network interfaces (only tested with re so far) don't appear
to have this problem.

As a result, multicast applications stop working (mplayer cannot play UDP
multicast streams for example.)

This appears to broken in -CURRENT somewhere between July 2010 and today.
>How-To-Repeat:
$ mtest
j 239.0.0.1 fxp0
l 239.0.0.1 fxp0

/var/log/messages displays

Feb 11 03:08:18 charlemagne kernel: fxp0: link state changed to DOWN
Feb 11 03:08:20 charlemagne kernel: fxp0: link state changed to UP
Feb 11 03:08:59 charlemagne kernel: fxp0: link state changed to DOWN
Feb 11 03:09:01 charlemagne kernel: fxp0: link state changed to UP

corresponding to the join/leave operations
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Feb 11 03:15:17 UTC 2011 
Responsible-Changed-Why:  
reclassify and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154667 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Sat Feb 12 23:10:20 UTC 2011 
State-Changed-Why:  
Would you try patch at the following URL? 
http://people.freebsd.org/~yongari/fxp/fxp.mcast.diff 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Sat Feb 12 23:10:20 UTC 2011 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154667 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/154667: commit references a PR
Date: Tue, 15 Feb 2011 18:16:12 +0000 (UTC)

 Author: yongari
 Date: Tue Feb 15 18:16:04 2011
 New Revision: 218710
 URL: http://svn.freebsd.org/changeset/base/218710
 
 Log:
   Fix a regression introduced in r215906. The change made in r215906
   caused link re-negotiation whenever application joins or leaves a
   multicast group.  If driver is running, it would have established a
   link so there is no need to start re-negotiation. The re-negotiation
   broke established link which in turn stopped multicast application
   working while re-negotiation is in progress.
   
   PR:	kern/154667
   MFC after:	1 week
 
 Modified:
   head/sys/dev/fxp/if_fxp.c
 
 Modified: head/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- head/sys/dev/fxp/if_fxp.c	Tue Feb 15 16:09:08 2011	(r218709)
 +++ head/sys/dev/fxp/if_fxp.c	Tue Feb 15 18:16:04 2011	(r218710)
 @@ -2823,8 +2823,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
  
  	case SIOCADDMULTI:
  	case SIOCDELMULTI:
 +		FXP_LOCK(sc);
  		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 -			fxp_init(sc);
 +			fxp_init_body(sc, 0);
 +		FXP_UNLOCK(sc);
  		break;
  
  	case SIOCSIFMEDIA:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->patched 
State-Changed-By: yongari 
State-Changed-When: Tue Feb 15 18:24:20 UTC 2011 
State-Changed-Why:  
Patch committed to HEAD(r218710). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154667 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/154667: commit references a PR
Date: Tue, 22 Feb 2011 21:24:41 +0000 (UTC)

 Author: yongari
 Date: Tue Feb 22 21:24:36 2011
 New Revision: 218962
 URL: http://svn.freebsd.org/changeset/base/218962
 
 Log:
   MFC r218710:
     Fix a regression introduced in r215906. The change made in r215906
     caused link re-negotiation whenever application joins or leaves a
     multicast group.  If driver is running, it would have established a
     link so there is no need to start re-negotiation. The re-negotiation
     broke established link which in turn stopped multicast application
     working while re-negotiation is in progress.
   
     PR:	kern/154667
 
 Modified:
   stable/8/sys/dev/fxp/if_fxp.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
 
 Modified: stable/8/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- stable/8/sys/dev/fxp/if_fxp.c	Tue Feb 22 21:13:40 2011	(r218961)
 +++ stable/8/sys/dev/fxp/if_fxp.c	Tue Feb 22 21:24:36 2011	(r218962)
 @@ -2823,8 +2823,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
  
  	case SIOCADDMULTI:
  	case SIOCDELMULTI:
 +		FXP_LOCK(sc);
  		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 -			fxp_init(sc);
 +			fxp_init_body(sc, 0);
 +		FXP_UNLOCK(sc);
  		break;
  
  	case SIOCSIFMEDIA:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/154667: commit references a PR
Date: Tue, 22 Feb 2011 21:27:51 +0000 (UTC)

 Author: yongari
 Date: Tue Feb 22 21:27:46 2011
 New Revision: 218963
 URL: http://svn.freebsd.org/changeset/base/218963
 
 Log:
   MFC r218710:
     Fix a regression introduced in r215906. The change made in r215906
     caused link re-negotiation whenever application joins or leaves a
     multicast group.  If driver is running, it would have established a
     link so there is no need to start re-negotiation. The re-negotiation
     broke established link which in turn stopped multicast application
     working while re-negotiation is in progress.
   
     PR:	kern/154667
 
 Modified:
   stable/7/sys/dev/fxp/if_fxp.c
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/cddl/contrib/opensolaris/   (props changed)
   stable/7/sys/contrib/dev/acpica/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- stable/7/sys/dev/fxp/if_fxp.c	Tue Feb 22 21:24:36 2011	(r218962)
 +++ stable/7/sys/dev/fxp/if_fxp.c	Tue Feb 22 21:27:46 2011	(r218963)
 @@ -2816,8 +2816,10 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
  
  	case SIOCADDMULTI:
  	case SIOCDELMULTI:
 +		FXP_LOCK(sc);
  		if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
 -			fxp_init(sc);
 +			fxp_init_body(sc, 0);
 +		FXP_UNLOCK(sc);
  		break;
  
  	case SIOCSIFMEDIA:
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Mon Apr 18 23:33:50 UTC 2011 
State-Changed-Why:  
Close(feedback timeout). The patch is already MFCed to both stable/8 
and stable/7. If you still see the issue, please let me know. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154667 
>Unformatted:
