ipvs: use pkts for SCTP too
Subsystems (4)
Julian Anastasov
maintainerPATCH 1/1 ipvs: use pkts for SCTP too
Use correctly the in_pkts packet counter also for SCTP
---
This patch is for net-next
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +1 -2
@@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct skif (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; } }
Simon Horman
maintainerQuoted 7 lines · Julian Anastasov
Use correctly the
in_pktspacket counter also for SCTPSigned-off-by Julian Anastasov <[email protected]>---
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 ?
Quoted 14 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +1
-2@@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct skif (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) ||
net/netfilter/ipvs/ip_vs_core.c ip_vs_in(unsigned int hooknum, struct sk · line 1397
Quoted 9 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +2
-1@@ -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) &&
Julian Anastasov
maintainerHello,
Quoted 7 lines · Simon Horman
Quoted 6 lines · Julian Anastasov
Use correctly the
in_pktspacket counter also for SCTPSigned-off-by Julian Anastasov <[email protected]>---
Quoted 6 lines
Quoted 1 line
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.
Quoted 16 lines
Quoted 16 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +1
-2@@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct skif (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; } }
Quoted 8 lines
net/netfilter/ipvs/ip_vs_core.c ip_vs_in(unsigned int hooknum, struct sk · line 1397
Quoted 6 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +2
-1- +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!
Review ip_vs_in(unsigned int hooknum, struct sk · line 1401
Quoted 12 lines
(quoted diff) +2
-1@@ -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 <[email protected]>
Simon Horman
maintainerQuoted 14 lines · Julian Anastasov
Hello,
Quoted 9 lines · Simon Horman
Quoted 7 lines · Julian Anastasov
Use correctly the
in_pktspacket counter also for SCTPSigned-off-by Julian Anastasov <[email protected]>---
This patch is for net-next
Quoted 8 lines
Quoted 4 lines
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.
Quoted 44 lines
Quoted 16 lines
Quoted 16 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +1
-2@@ -1380,8 +1380,7 @@ ip_vs_in(unsigned int hooknum, struct skif (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; } }Quoted 8 lines
net/netfilter/ipvs/ip_vs_core.c ip_vs_in(unsigned int hooknum, struct sk · line 1397
Quoted 6 lines
net/netfilter/ipvs/ip_vs_core.c renamed from linux/net/netfilter/ipvs/ip_vs_core.c +2
-1- +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!
Review ip_vs_in(unsigned int hooknum, struct sk · line 1401
Quoted 12 lines
(quoted diff) +2
-1@@ -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 <[email protected]>
Simon Horman
maintainerPATCH 1/1 ipvs: use pkts for SCTP too
In reply to Simon HormanFrom: Julian Anastasov <[email protected]>
Use correctly the in_pkts packet counter also for SCTP
---
Dave, can you take this into net-next?
net/netfilter/ipvs/ip_vs_core.c +3 -3
@@ -1383,8 +1383,7 @@ ip_vs_in(unsigned int hooknum, struct skif (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) &&
From: Simon Horman <[email protected]>
Date: Thu, 2 Sep 2010 17:19:14 +0900
Quoted 6 lines
From: Julian Anastasov <[email protected]>
Use correctly the
in_pktspacket counter also for SCTPSigned-off-by Julian Anastasov <[email protected]>Signed-off-by Simon Horman <[email protected]>
Applied.