From nobody@FreeBSD.org  Fri Aug 14 17:15:31 2009
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 7738210656A5
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Aug 2009 17:15:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CFC88FC52
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Aug 2009 17:15:31 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7EHFVwI093142
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Aug 2009 17:15:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7EHFUWS093141;
	Fri, 14 Aug 2009 17:15:30 GMT
	(envelope-from nobody)
Message-Id: <200908141715.n7EHFUWS093141@www.freebsd.org>
Date: Fri, 14 Aug 2009 17:15:30 GMT
From: Maxim Ignatenko <gelraen.ua@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Add XMIT_FAILOVER to ng_one2many
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         137775
>Category:       kern
>Synopsis:       [netgraph] [patch] Add XMIT_FAILOVER to ng_one2many
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-net
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 14 17:20:08 UTC 2009
>Closed-Date:    Tue Mar 15 07:17:34 UTC 2011
>Last-Modified:  Tue Mar 15 07:20:13 UTC 2011
>Originator:     Maxim Ignatenko
>Release:        8-CURRENT
>Organization:
Kiev National Taras Shevchenko University
>Environment:
FreeBSD imax 8.0-CURRENT FreeBSD 8.0-CURRENT #82 r195339M: Sat Jul  4 17:53:30 EEST 2009     root@imax:/usr/obj/usr/src/sys/HEAD  i386
>Description:
Sending packets to first active "many" hook is more adequate for simulating lagg(4) with "laggproto failover".
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sys/netgraph/ng_one2many.c
===================================================================
--- sys/netgraph/ng_one2many.c	(revision 195339)
+++ sys/netgraph/ng_one2many.c	(working copy)
@@ -278,6 +278,7 @@
 			switch (conf->xmitAlg) {
 			case NG_ONE2MANY_XMIT_ROUNDROBIN:
 			case NG_ONE2MANY_XMIT_ALL:
+			case NG_ONE2MANY_XMIT_FAILOVER:
 				break;
 			default:
 				error = EINVAL;
@@ -473,6 +474,9 @@
 				NG_SEND_DATA_ONLY(error, mdst->hook, m2);
 			}
 			break;
+		case NG_ONE2MANY_XMIT_FAILOVER:
+			dst = &priv->many[priv->activeMany[0]];
+			break;
 #ifdef INVARIANTS
 		default:
 			panic("%s: invalid xmitAlg", __func__);
@@ -583,6 +587,7 @@
 			priv->nextMany %= priv->numActiveMany;
 		break;
 	case NG_ONE2MANY_XMIT_ALL:
+	case NG_ONE2MANY_XMIT_FAILOVER:
 		break;
 #ifdef INVARIANTS
 	default:
Index: sys/netgraph/ng_one2many.h
===================================================================
--- sys/netgraph/ng_one2many.h	(revision 195339)
+++ sys/netgraph/ng_one2many.h	(working copy)
@@ -61,6 +61,7 @@
 /* Algorithms for outgoing packet distribution (XXX only one so far) */
 #define NG_ONE2MANY_XMIT_ROUNDROBIN	1	/* round-robin delivery */
 #define NG_ONE2MANY_XMIT_ALL		2	/* send packets to all many hooks */
+#define NG_ONE2MANY_XMIT_FAILOVER	3	/* send packets to first active "many" */
 
 /* Algorithms for detecting link failure (XXX only one so far) */
 #define NG_ONE2MANY_FAIL_MANUAL		1	/* use enabledLinks[] array */
Index: share/man/man4/ng_one2many.4
===================================================================
--- share/man/man4/ng_one2many.4	(revision 195339)
+++ share/man/man4/ng_one2many.4	(working copy)
@@ -96,6 +96,10 @@
 Each packet goes out each
 .Dv many
 hook.
+.It Dv NG_ONE2MANY_XMIT_FAILOVER
+Packets are delivered out the first active
+.Dv many
+hook.
 .El
 .Pp
 In the future other algorithms may be added as well.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Aug 14 20:20:55 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137775 
State-Changed-From-To: open->patched 
State-Changed-By: ae 
State-Changed-When: Tue Mar 1 13:14:56 UTC 2011 
State-Changed-Why:  
Commited to head/. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=137775 
State-Changed-From-To: patched->closed 
State-Changed-By: ae 
State-Changed-When: Tue Mar 15 07:16:53 UTC 2011 
State-Changed-Why:  
Merged to stable/8 and stable/7. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/137775: commit references a PR
Date: Tue, 15 Mar 2011 07:15:23 +0000 (UTC)

 Author: ae
 Date: Tue Mar 15 07:15:04 2011
 New Revision: 219660
 URL: http://svn.freebsd.org/changeset/base/219660
 
 Log:
   MFC r219127:
     Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are
     delivered out the first active "many" hook.
   
     PR:		kern/137775
     Submitted by:	Maxim Ignatenko
 
 Modified:
   stable/8/share/man/man4/ng_one2many.4
   stable/8/sys/netgraph/ng_one2many.c
   stable/8/sys/netgraph/ng_one2many.h
 Directory Properties:
   stable/8/share/man/man4/   (props changed)
   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/share/man/man4/ng_one2many.4
 ==============================================================================
 --- stable/8/share/man/man4/ng_one2many.4	Tue Mar 15 06:53:33 2011	(r219659)
 +++ stable/8/share/man/man4/ng_one2many.4	Tue Mar 15 07:15:04 2011	(r219660)
 @@ -34,7 +34,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd February 19, 2006
 +.Dd March 1, 2011
  .Dt NG_ONE2MANY 4
  .Os
  .Sh NAME
 @@ -96,6 +96,10 @@ hooks.
  Each packet goes out each
  .Dv many
  hook.
 +.It Dv NG_ONE2MANY_XMIT_FAILOVER
 +Packets are delivered out the first active
 +.Dv many
 +hook.
  .El
  .Pp
  In the future other algorithms may be added as well.
 
 Modified: stable/8/sys/netgraph/ng_one2many.c
 ==============================================================================
 --- stable/8/sys/netgraph/ng_one2many.c	Tue Mar 15 06:53:33 2011	(r219659)
 +++ stable/8/sys/netgraph/ng_one2many.c	Tue Mar 15 07:15:04 2011	(r219660)
 @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i
  			switch (conf->xmitAlg) {
  			case NG_ONE2MANY_XMIT_ROUNDROBIN:
  			case NG_ONE2MANY_XMIT_ALL:
 +			case NG_ONE2MANY_XMIT_FAILOVER:
  				break;
  			default:
  				error = EINVAL;
 @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p 
  				NG_SEND_DATA_ONLY(error, mdst->hook, m2);
  			}
  			break;
 +		case NG_ONE2MANY_XMIT_FAILOVER:
 +			dst = &priv->many[priv->activeMany[0]];
 +			break;
  #ifdef INVARIANTS
  		default:
  			panic("%s: invalid xmitAlg", __func__);
 @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv)
  			priv->nextMany %= priv->numActiveMany;
  		break;
  	case NG_ONE2MANY_XMIT_ALL:
 +	case NG_ONE2MANY_XMIT_FAILOVER:
  		break;
  #ifdef INVARIANTS
  	default:
 
 Modified: stable/8/sys/netgraph/ng_one2many.h
 ==============================================================================
 --- stable/8/sys/netgraph/ng_one2many.h	Tue Mar 15 06:53:33 2011	(r219659)
 +++ stable/8/sys/netgraph/ng_one2many.h	Tue Mar 15 07:15:04 2011	(r219660)
 @@ -61,6 +61,7 @@
  /* Algorithms for outgoing packet distribution (XXX only one so far) */
  #define NG_ONE2MANY_XMIT_ROUNDROBIN	1	/* round-robin delivery */
  #define NG_ONE2MANY_XMIT_ALL		2	/* send packets to all many hooks */
 +#define	NG_ONE2MANY_XMIT_FAILOVER	3	/* send packets to first active "many" */
  
  /* Algorithms for detecting link failure (XXX only one so far) */
  #define NG_ONE2MANY_FAIL_MANUAL		1	/* use enabledLinks[] array */
 _______________________________________________
 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/137775: commit references a PR
Date: Tue, 15 Mar 2011 07:16:00 +0000 (UTC)

 Author: ae
 Date: Tue Mar 15 07:15:46 2011
 New Revision: 219661
 URL: http://svn.freebsd.org/changeset/base/219661
 
 Log:
   MFC r219127:
     Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are
     delivered out the first active "many" hook.
   
     PR:           kern/137775
     Submitted by: Maxim Ignatenko
 
 Modified:
   stable/7/share/man/man4/ng_one2many.4
   stable/7/sys/netgraph/ng_one2many.c
   stable/7/sys/netgraph/ng_one2many.h
 Directory Properties:
   stable/7/share/man/man4/   (props changed)
   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/share/man/man4/ng_one2many.4
 ==============================================================================
 --- stable/7/share/man/man4/ng_one2many.4	Tue Mar 15 07:15:04 2011	(r219660)
 +++ stable/7/share/man/man4/ng_one2many.4	Tue Mar 15 07:15:46 2011	(r219661)
 @@ -34,7 +34,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd February 19, 2006
 +.Dd March 1, 2011
  .Dt NG_ONE2MANY 4
  .Os
  .Sh NAME
 @@ -96,6 +96,10 @@ hooks.
  Each packet goes out each
  .Dv many
  hook.
 +.It Dv NG_ONE2MANY_XMIT_FAILOVER
 +Packets are delivered out the first active
 +.Dv many
 +hook.
  .El
  .Pp
  In the future other algorithms may be added as well.
 
 Modified: stable/7/sys/netgraph/ng_one2many.c
 ==============================================================================
 --- stable/7/sys/netgraph/ng_one2many.c	Tue Mar 15 07:15:04 2011	(r219660)
 +++ stable/7/sys/netgraph/ng_one2many.c	Tue Mar 15 07:15:46 2011	(r219661)
 @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i
  			switch (conf->xmitAlg) {
  			case NG_ONE2MANY_XMIT_ROUNDROBIN:
  			case NG_ONE2MANY_XMIT_ALL:
 +			case NG_ONE2MANY_XMIT_FAILOVER:
  				break;
  			default:
  				error = EINVAL;
 @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p 
  				NG_SEND_DATA_ONLY(error, mdst->hook, m2);
  			}
  			break;
 +		case NG_ONE2MANY_XMIT_FAILOVER:
 +			dst = &priv->many[priv->activeMany[0]];
 +			break;
  #ifdef INVARIANTS
  		default:
  			panic("%s: invalid xmitAlg", __func__);
 @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv)
  			priv->nextMany %= priv->numActiveMany;
  		break;
  	case NG_ONE2MANY_XMIT_ALL:
 +	case NG_ONE2MANY_XMIT_FAILOVER:
  		break;
  #ifdef INVARIANTS
  	default:
 
 Modified: stable/7/sys/netgraph/ng_one2many.h
 ==============================================================================
 --- stable/7/sys/netgraph/ng_one2many.h	Tue Mar 15 07:15:04 2011	(r219660)
 +++ stable/7/sys/netgraph/ng_one2many.h	Tue Mar 15 07:15:46 2011	(r219661)
 @@ -61,6 +61,7 @@
  /* Algorithms for outgoing packet distribution (XXX only one so far) */
  #define NG_ONE2MANY_XMIT_ROUNDROBIN	1	/* round-robin delivery */
  #define NG_ONE2MANY_XMIT_ALL		2	/* send packets to all many hooks */
 +#define	NG_ONE2MANY_XMIT_FAILOVER	3	/* send packets to first active "many" */
  
  /* Algorithms for detecting link failure (XXX only one so far) */
  #define NG_ONE2MANY_FAIL_MANUAL		1	/* use enabledLinks[] array */
 _______________________________________________
 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"
 
>Unformatted:
