LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH] ipvs: use pkts for SCTP too

To: Julian Anastasov <ja@xxxxxx>
Subject: Re: [PATCH] ipvs: use pkts for SCTP too
Cc: lvs-devel@xxxxxxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 2 Sep 2010 17:13:26 +0900
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@xxxxxx>
> > > ---
> > > 
> > >   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@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>