All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipvs: use pkts for SCTP too
@ 2010-09-01 23:47 Julian Anastasov
  2010-09-02  2:03 ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Julian Anastasov @ 2010-09-01 23:47 UTC (permalink / raw)
  To: Simon Horman; +Cc: lvs-devel


	Use correctly the in_pkts packet counter also for SCTP

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	This patch is for net-next

--- v2.6.36-rc2/linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:47:47.000000000 +0300
+++ linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:55:30.000000000 +0300
@@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct sk
 	if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
 	    cp->protocol == IPPROTO_SCTP) {
 		if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
-			(atomic_read(&cp->in_pkts) %
-			 sysctl_ip_vs_sync_threshold[1]
+			(pkts % sysctl_ip_vs_sync_threshold[1]
 			 == sysctl_ip_vs_sync_threshold[0])) ||
 				(cp->old_state != cp->state &&
 				 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
@@ -1391,7 +1390,8 @@ ip_vs_in(unsigned int hooknum, struct sk
 			goto out;
 		}
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ipvs: use pkts for SCTP too
  2010-09-01 23:47 [PATCH] ipvs: use pkts for SCTP too Julian Anastasov
@ 2010-09-02  2:03 ` Simon Horman
  2010-09-02  7:58   ` Julian Anastasov
  2010-09-02  8:19   ` [patch net-next] " Simon Horman
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Horman @ 2010-09-02  2:03 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: lvs-devel

On Thu, Sep 02, 2010 at 02:47:26AM +0300, Julian Anastasov wrote:
> 
> 	Use correctly the in_pkts packet counter also for SCTP
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> ---
> 
> 	This patch is for net-next

Thanks,

apart from the minor nit below, this looks good to me.
Should I submit it to net-next ?

> 
> --- v2.6.36-rc2/linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:47:47.000000000 +0300
> +++ linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:55:30.000000000 +0300
> @@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct sk
>  	if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
>  	    cp->protocol == IPPROTO_SCTP) {
>  		if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
> -			(atomic_read(&cp->in_pkts) %
> -			 sysctl_ip_vs_sync_threshold[1]
> +			(pkts % sysctl_ip_vs_sync_threshold[1]
>  			 == sysctl_ip_vs_sync_threshold[0])) ||
>  				(cp->old_state != cp->state &&
>  				 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
> @@ -1391,7 +1390,8 @@ ip_vs_in(unsigned int hooknum, struct sk
>  			goto out;
>  		}
>  	}
> -
> +	else
> +	/* Keep this block last: TCP and others with pp->num_states <= 1 */
>  	if (af == AF_INET &&
>  	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
>  	    (((cp->protocol != IPPROTO_TCP ||

The else and the if really ought to be on the same line:

@@ -1395,7 +1394,8 @@ ip_vs_in(unsigned int hooknum, struct sk
 		}
 	}
 
-	if (af == AF_INET &&
+	/* Keep this block last: TCP and others with pp->num_states <= 1 */
+	else if (af == AF_INET &&
 	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
 	    (((cp->protocol != IPPROTO_TCP ||
 	       cp->state == IP_VS_TCP_S_ESTABLISHED) &&

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ipvs: use pkts for SCTP too
  2010-09-02  2:03 ` Simon Horman
@ 2010-09-02  7:58   ` Julian Anastasov
  2010-09-02  8:13     ` Simon Horman
  2010-09-02  8:19   ` [patch net-next] " Simon Horman
  1 sibling, 1 reply; 6+ messages in thread
From: Julian Anastasov @ 2010-09-02  7:58 UTC (permalink / raw)
  To: Simon Horman; +Cc: lvs-devel


	Hello,

On Thu, 2 Sep 2010, Simon Horman wrote:

> On Thu, Sep 02, 2010 at 02:47:26AM +0300, Julian Anastasov wrote:
> > 
> > 	Use correctly the in_pkts packet counter also for SCTP
> > 
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > ---
> > 
> > 	This patch is for net-next
> 
> Thanks,
> 
> apart from the minor nit below, this looks good to me.
> Should I submit it to net-next ?

	Yes, please submit the fixed version. Sometimes
I forget that my style for 'else' does not match the kernel's
one.

> > --- v2.6.36-rc2/linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:47:47.000000000 +0300
> > +++ linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:55:30.000000000 +0300
> > @@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct sk
> >  	if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
> >  	    cp->protocol == IPPROTO_SCTP) {
> >  		if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
> > -			(atomic_read(&cp->in_pkts) %
> > -			 sysctl_ip_vs_sync_threshold[1]
> > +			(pkts % sysctl_ip_vs_sync_threshold[1]
> >  			 == sysctl_ip_vs_sync_threshold[0])) ||
> >  				(cp->old_state != cp->state &&
> >  				 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
> > @@ -1391,7 +1390,8 @@ ip_vs_in(unsigned int hooknum, struct sk
> >  			goto out;
> >  		}
> >  	}
> > -
> > +	else
> > +	/* Keep this block last: TCP and others with pp->num_states <= 1 */
> >  	if (af == AF_INET &&
> >  	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
> >  	    (((cp->protocol != IPPROTO_TCP ||
> 
> The else and the if really ought to be on the same line:

	Yes, thanks!

> 
> @@ -1395,7 +1394,8 @@ ip_vs_in(unsigned int hooknum, struct sk
>  		}
>  	}
>  
> -	if (af == AF_INET &&
> +	/* Keep this block last: TCP and others with pp->num_states <= 1 */
> +	else if (af == AF_INET &&
>  	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
>  	    (((cp->protocol != IPPROTO_TCP ||
>  	       cp->state == IP_VS_TCP_S_ESTABLISHED) &&
> 

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ipvs: use pkts for SCTP too
  2010-09-02  7:58   ` Julian Anastasov
@ 2010-09-02  8:13     ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2010-09-02  8:13 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: lvs-devel

On Thu, Sep 02, 2010 at 10:58:24AM +0300, Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Thu, 2 Sep 2010, Simon Horman wrote:
> 
> > On Thu, Sep 02, 2010 at 02:47:26AM +0300, Julian Anastasov wrote:
> > > 
> > > 	Use correctly the in_pkts packet counter also for SCTP
> > > 
> > > Signed-off-by: Julian Anastasov <ja@ssi.bg>
> > > ---
> > > 
> > > 	This patch is for net-next
> > 
> > Thanks,
> > 
> > apart from the minor nit below, this looks good to me.
> > Should I submit it to net-next ?
> 
> 	Yes, please submit the fixed version. Sometimes
> I forget that my style for 'else' does not match the kernel's
> one.

No problem, will do.

> > > --- v2.6.36-rc2/linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:47:47.000000000 +0300
> > > +++ linux/net/netfilter/ipvs/ip_vs_core.c	2010-09-01 23:55:30.000000000 +0300
> > > @@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct sk
> > >  	if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
> > >  	    cp->protocol == IPPROTO_SCTP) {
> > >  		if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
> > > -			(atomic_read(&cp->in_pkts) %
> > > -			 sysctl_ip_vs_sync_threshold[1]
> > > +			(pkts % sysctl_ip_vs_sync_threshold[1]
> > >  			 == sysctl_ip_vs_sync_threshold[0])) ||
> > >  				(cp->old_state != cp->state &&
> > >  				 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
> > > @@ -1391,7 +1390,8 @@ ip_vs_in(unsigned int hooknum, struct sk
> > >  			goto out;
> > >  		}
> > >  	}
> > > -
> > > +	else
> > > +	/* Keep this block last: TCP and others with pp->num_states <= 1 */
> > >  	if (af == AF_INET &&
> > >  	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
> > >  	    (((cp->protocol != IPPROTO_TCP ||
> > 
> > The else and the if really ought to be on the same line:
> 
> 	Yes, thanks!
> 
> > 
> > @@ -1395,7 +1394,8 @@ ip_vs_in(unsigned int hooknum, struct sk
> >  		}
> >  	}
> >  
> > -	if (af == AF_INET &&
> > +	/* Keep this block last: TCP and others with pp->num_states <= 1 */
> > +	else if (af == AF_INET &&
> >  	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
> >  	    (((cp->protocol != IPPROTO_TCP ||
> >  	       cp->state == IP_VS_TCP_S_ESTABLISHED) &&
> > 
> 
> Regards
> 
> --
> Julian Anastasov <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch net-next] ipvs: use pkts for SCTP too
  2010-09-02  2:03 ` Simon Horman
  2010-09-02  7:58   ` Julian Anastasov
@ 2010-09-02  8:19   ` Simon Horman
  2010-09-02 17:05     ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Horman @ 2010-09-02  8:19 UTC (permalink / raw)
  To: lvs-devel, netdev
  Cc: David S. Miller, Patrick McHardy, Wensong Zhang, Julian Anastasov

From: Julian Anastasov <ja@ssi.bg>

Use correctly the in_pkts packet counter also for SCTP

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

Dave, can you take this into net-next?

Index: net-next-2.6/net/netfilter/ipvs/ip_vs_core.c
===================================================================
--- net-next-2.6.orig/net/netfilter/ipvs/ip_vs_core.c	2010-09-02 10:59:53.000000000 +0900
+++ net-next-2.6/net/netfilter/ipvs/ip_vs_core.c	2010-09-02 11:02:11.000000000 +0900
@@ -1383,8 +1383,7 @@ ip_vs_in(unsigned int hooknum, struct sk
 	if (af == AF_INET && (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
 	    cp->protocol == IPPROTO_SCTP) {
 		if ((cp->state == IP_VS_SCTP_S_ESTABLISHED &&
-			(atomic_read(&cp->in_pkts) %
-			 sysctl_ip_vs_sync_threshold[1]
+			(pkts % sysctl_ip_vs_sync_threshold[1]
 			 == sysctl_ip_vs_sync_threshold[0])) ||
 				(cp->old_state != cp->state &&
 				 ((cp->state == IP_VS_SCTP_S_CLOSED) ||
@@ -1395,7 +1394,8 @@ ip_vs_in(unsigned int hooknum, struct sk
 		}
 	}
 
-	if (af == AF_INET &&
+	/* Keep this block last: TCP and others with pp->num_states <= 1 */
+	else if (af == AF_INET &&
 	    (ip_vs_sync_state & IP_VS_STATE_MASTER) &&
 	    (((cp->protocol != IPPROTO_TCP ||
 	       cp->state == IP_VS_TCP_S_ESTABLISHED) &&

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch net-next] ipvs: use pkts for SCTP too
  2010-09-02  8:19   ` [patch net-next] " Simon Horman
@ 2010-09-02 17:05     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-09-02 17:05 UTC (permalink / raw)
  To: horms; +Cc: lvs-devel, netdev, kaber, wensong, ja

From: Simon Horman <horms@verge.net.au>
Date: Thu, 2 Sep 2010 17:19:14 +0900

> From: Julian Anastasov <ja@ssi.bg>
> 
> Use correctly the in_pkts packet counter also for SCTP
> 
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-02 17:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 23:47 [PATCH] ipvs: use pkts for SCTP too Julian Anastasov
2010-09-02  2:03 ` Simon Horman
2010-09-02  7:58   ` Julian Anastasov
2010-09-02  8:13     ` Simon Horman
2010-09-02  8:19   ` [patch net-next] " Simon Horman
2010-09-02 17:05     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.