netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ipvs: ipvs update for nf-next-2.6
@ 2010-11-16  6:34 Simon Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n

Hi Patrick,

the following patches contain updates to IPVS since 2.6.37-rc1
and are targeted at nf-next-2.6.

- Static and shadow variable clean-ups from Eric

- Preparation for persistence engine syncrhonisation

- Correctness fix for persistence engine match.
  I do not consider this a bug as it can only manifest in a problem
  if there is more than one persistence engine loaded and
  currently only one exists.

- Code cleanps for ip_vs_sync_conn(), ip_vs_process_message()
  and ip_vs_process_message()

- Handle GRO aggregated skbs
  The previous behaviour was to send a needs frag ICMP.
  This is probably stable material.

Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick

I expect more activity before 2.6.37-rc1. In particular Hans is working
heavily with Julian and myself on the new synchronisation code.

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

* [PATCH 1/6] IPVS: Only match pe_data created by the same pe
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  6:34 ` [PATCH 2/6] IPVS: Make the cp argument to ip_vs_sync_conn() static Simon Horman
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Simon Horman

Only match persistence engine data if it was
created by the same persistence engine.

Reported-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_conn.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 64a9ca3..261db1a 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -354,7 +354,7 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p)
 
 	list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
 		if (p->pe_data && p->pe->ct_match) {
-			if (p->pe->ct_match(p, cp))
+			if (p->pe == cp->pe && p->pe->ct_match(p, cp))
 				goto out;
 			continue;
 		}
-- 
1.7.2.3


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

* [PATCH 2/6] IPVS: Make the cp argument to ip_vs_sync_conn() static
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
  2010-11-16  6:34 ` [PATCH 1/6] IPVS: Only match pe_data created by the same pe Simon Horman
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  6:34 ` [PATCH 3/6] IPVS: Remove useless { } block from ip_vs_process_message() Simon Horman
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Simon Horman

Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 include/net/ip_vs.h             |    2 +-
 net/netfilter/ipvs/ip_vs_sync.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index be2b569..d5a32e4 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -916,7 +916,7 @@ extern char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN];
 extern char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
 extern int start_sync_thread(int state, char *mcast_ifn, __u8 syncid);
 extern int stop_sync_thread(int state);
-extern void ip_vs_sync_conn(struct ip_vs_conn *cp);
+extern void ip_vs_sync_conn(const struct ip_vs_conn *cp);
 
 
 /*
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index ab85aed..a4dccbc 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -236,7 +236,7 @@ get_curr_sync_buff(unsigned long time)
  *      Add an ip_vs_conn information into the current sync_buff.
  *      Called by ip_vs_in.
  */
-void ip_vs_sync_conn(struct ip_vs_conn *cp)
+void ip_vs_sync_conn(const struct ip_vs_conn *cp)
 {
 	struct ip_vs_sync_mesg *m;
 	struct ip_vs_sync_conn *s;
-- 
1.7.2.3


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

* [PATCH 3/6] IPVS: Remove useless { } block from ip_vs_process_message()
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
  2010-11-16  6:34 ` [PATCH 1/6] IPVS: Only match pe_data created by the same pe Simon Horman
  2010-11-16  6:34 ` [PATCH 2/6] IPVS: Make the cp argument to ip_vs_sync_conn() static Simon Horman
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  6:34 ` [PATCH 4/6] IPVS: buffer argument to ip_vs_process_message() should not be const Simon Horman
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Simon Horman

Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_sync.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index a4dccbc..72b3d88 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -381,20 +381,18 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen)
 			}
 		}
 
-		{
-			if (ip_vs_conn_fill_param_sync(AF_INET, s->protocol,
-					      (union nf_inet_addr *)&s->caddr,
-					      s->cport,
-					      (union nf_inet_addr *)&s->vaddr,
-					      s->vport, &param)) {
-				pr_err("ip_vs_conn_fill_param_sync failed");
-				return;
-			}
-			if (!(flags & IP_VS_CONN_F_TEMPLATE))
-				cp = ip_vs_conn_in_get(&param);
-			else
-				cp = ip_vs_ct_in_get(&param);
+		if (ip_vs_conn_fill_param_sync(AF_INET, s->protocol,
+					       (union nf_inet_addr *)&s->caddr,
+					       s->cport,
+					       (union nf_inet_addr *)&s->vaddr,
+					       s->vport, &param)) {
+			pr_err("ip_vs_conn_fill_param_sync failed");
+			return;
 		}
+		if (!(flags & IP_VS_CONN_F_TEMPLATE))
+			cp = ip_vs_conn_in_get(&param);
+		else
+			cp = ip_vs_ct_in_get(&param);
 		if (!cp) {
 			/*
 			 * Find the appropriate destination for the connection.
-- 
1.7.2.3


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

* [PATCH 4/6] IPVS: buffer argument to ip_vs_process_message() should not be const
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
                   ` (2 preceding siblings ...)
  2010-11-16  6:34 ` [PATCH 3/6] IPVS: Remove useless { } block from ip_vs_process_message() Simon Horman
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  6:34 ` [PATCH 5/6] ipvs: add static and read_mostly attributes Simon Horman
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Simon Horman

It is assigned to a non-const variable and its contents are modified.

Acked-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_sync.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index 72b3d88..3897d6b 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -303,7 +303,7 @@ ip_vs_conn_fill_param_sync(int af, int protocol,
  *      Process received multicast message and create the corresponding
  *      ip_vs_conn entries.
  */
-static void ip_vs_process_message(const char *buffer, const size_t buflen)
+static void ip_vs_process_message(char *buffer, const size_t buflen)
 {
 	struct ip_vs_sync_mesg *m = (struct ip_vs_sync_mesg *)buffer;
 	struct ip_vs_sync_conn *s;
-- 
1.7.2.3


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

* [PATCH 5/6] ipvs: add static and read_mostly attributes
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
                   ` (3 preceding siblings ...)
  2010-11-16  6:34 ` [PATCH 4/6] IPVS: buffer argument to ip_vs_process_message() should not be const Simon Horman
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  6:34 ` [PATCH 6/6] ipvs: remove shadow rt variable Simon Horman
  2010-11-16  9:21 ` ipvs: ipvs update for nf-next-2.6 Patrick McHardy
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Eric Dumazet, Simon Horman

From: Eric Dumazet <eric.dumazet@gmail.com>

ip_vs_conn_tab_bits & ip_vs_conn_tab_mask are static to
ipvs/ip_vs_conn.c

ip_vs_conn_tab_size, ip_vs_conn_tab_mask, ip_vs_conn_tab [the pointer],
ip_vs_conn_rnd are mostly read.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_conn.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 261db1a..7615f9e 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -48,18 +48,18 @@
 /*
  * Connection hash size. Default is what was selected at compile time.
 */
-int ip_vs_conn_tab_bits = CONFIG_IP_VS_TAB_BITS;
+static int ip_vs_conn_tab_bits = CONFIG_IP_VS_TAB_BITS;
 module_param_named(conn_tab_bits, ip_vs_conn_tab_bits, int, 0444);
 MODULE_PARM_DESC(conn_tab_bits, "Set connections' hash size");
 
 /* size and mask values */
-int ip_vs_conn_tab_size;
-int ip_vs_conn_tab_mask;
+int ip_vs_conn_tab_size __read_mostly;
+static int ip_vs_conn_tab_mask __read_mostly;
 
 /*
  *  Connection hash table: for input and output packets lookups of IPVS
  */
-static struct list_head *ip_vs_conn_tab;
+static struct list_head *ip_vs_conn_tab __read_mostly;
 
 /*  SLAB cache for IPVS connections */
 static struct kmem_cache *ip_vs_conn_cachep __read_mostly;
@@ -71,7 +71,7 @@ static atomic_t ip_vs_conn_count = ATOMIC_INIT(0);
 static atomic_t ip_vs_conn_no_cport_cnt = ATOMIC_INIT(0);
 
 /* random value for IPVS connection hash */
-static unsigned int ip_vs_conn_rnd;
+static unsigned int ip_vs_conn_rnd __read_mostly;
 
 /*
  *  Fine locking granularity for big connection hash table
-- 
1.7.2.3


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

* [PATCH 6/6] ipvs: remove shadow rt variable
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
                   ` (4 preceding siblings ...)
  2010-11-16  6:34 ` [PATCH 5/6] ipvs: add static and read_mostly attributes Simon Horman
@ 2010-11-16  6:34 ` Simon Horman
  2010-11-16  9:21 ` ipvs: ipvs update for nf-next-2.6 Patrick McHardy
  6 siblings, 0 replies; 8+ messages in thread
From: Simon Horman @ 2010-11-16  6:34 UTC (permalink / raw)
  To: Eric Dumazet, Hans Schillstrom, Julian Anastasov, Patrick McHardy,
	lvs-devel, n
  Cc: Eric Dumazet, Simon Horman

From: Eric Dumazet <eric.dumazet@gmail.com>

Remove a sparse warning about rt variable.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
 net/netfilter/ipvs/ip_vs_xmit.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 10bd39c..50b131c 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -188,7 +188,6 @@ __ip_vs_reroute_locally(struct sk_buff *skb)
 			},
 			.mark = skb->mark,
 		};
-		struct rtable *rt;
 
 		if (ip_route_output_key(net, &rt, &fl))
 			return 0;
-- 
1.7.2.3


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

* Re: ipvs: ipvs update for nf-next-2.6
       [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
                   ` (5 preceding siblings ...)
  2010-11-16  6:34 ` [PATCH 6/6] ipvs: remove shadow rt variable Simon Horman
@ 2010-11-16  9:21 ` Patrick McHardy
  6 siblings, 0 replies; 8+ messages in thread
From: Patrick McHardy @ 2010-11-16  9:21 UTC (permalink / raw)
  To: Simon Horman
  Cc: Eric Dumazet, Hans Schillstrom, Julian Anastasov, lvs-devel,
	netdev, netfilter, netfilter-devel

On 16.11.2010 07:34, Simon Horman wrote:
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick

Pulled, thanks Simon!

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

end of thread, other threads:[~2010-11-16  9:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1289889298-17287-1-git-send-email-horms@verge.net.au>
2010-11-16  6:34 ` [PATCH 1/6] IPVS: Only match pe_data created by the same pe Simon Horman
2010-11-16  6:34 ` [PATCH 2/6] IPVS: Make the cp argument to ip_vs_sync_conn() static Simon Horman
2010-11-16  6:34 ` [PATCH 3/6] IPVS: Remove useless { } block from ip_vs_process_message() Simon Horman
2010-11-16  6:34 ` [PATCH 4/6] IPVS: buffer argument to ip_vs_process_message() should not be const Simon Horman
2010-11-16  6:34 ` [PATCH 5/6] ipvs: add static and read_mostly attributes Simon Horman
2010-11-16  6:34 ` [PATCH 6/6] ipvs: remove shadow rt variable Simon Horman
2010-11-16  9:21 ` ipvs: ipvs update for nf-next-2.6 Patrick McHardy
2010-11-16  6:34 Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).