aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-16 22:28:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-16 22:28:52 -0400
commit24c4ac070adffe4a21f3a8daf4aee7c98fa6c4f9 (patch)
tree7c9c4aaccb58cdde8e50634b74a41041001b624f
parentc334ba9e11849f0f23254d82a3305f6174cfbd95 (diff)
parentd35690beda1429544d46c8eb34b2e3a8c37ab299 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [IPV6]: ipv6_fl_socklist is inadvertently shared. [TCP]: Fix tcp_mem[] initialization. [NET]: Copy mac_len in skb_clone() as well [IPV4]: Do not disable preemption in trie_leaf_remove().
-rw-r--r--net/core/skbuff.c1
-rw-r--r--net/ipv4/fib_trie.c2
-rw-r--r--net/ipv4/tcp.c13
-rw-r--r--net/ipv6/tcp_ipv6.c1
4 files changed, 12 insertions, 5 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 820761f9eeef..702fa8f08747 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -463,6 +463,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
463 memcpy(n->cb, skb->cb, sizeof(skb->cb)); 463 memcpy(n->cb, skb->cb, sizeof(skb->cb));
464 C(len); 464 C(len);
465 C(data_len); 465 C(data_len);
466 C(mac_len);
466 C(csum); 467 C(csum);
467 C(local_df); 468 C(local_df);
468 n->cloned = 1; 469 n->cloned = 1;
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 72b3036bbc09..ada9b3db507d 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1527,7 +1527,6 @@ static int trie_leaf_remove(struct trie *t, t_key key)
1527 t->revision++; 1527 t->revision++;
1528 t->size--; 1528 t->size--;
1529 1529
1530 preempt_disable();
1531 tp = NODE_PARENT(n); 1530 tp = NODE_PARENT(n);
1532 tnode_free((struct tnode *) n); 1531 tnode_free((struct tnode *) n);
1533 1532
@@ -1537,7 +1536,6 @@ static int trie_leaf_remove(struct trie *t, t_key key)
1537 rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); 1536 rcu_assign_pointer(t->trie, trie_rebalance(t, tp));
1538 } else 1537 } else
1539 rcu_assign_pointer(t->trie, NULL); 1538 rcu_assign_pointer(t->trie, NULL);
1540 preempt_enable();
1541 1539
1542 return 1; 1540 return 1;
1543} 1541}
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 74c4d103ebc2..3834b10b5115 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2458,11 +2458,18 @@ void __init tcp_init(void)
2458 sysctl_max_syn_backlog = 128; 2458 sysctl_max_syn_backlog = 128;
2459 } 2459 }
2460 2460
2461 /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */ 2461 /* Set the pressure threshold to be a fraction of global memory that
2462 sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order; 2462 * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
2463 sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3; 2463 * memory, with a floor of 128 pages.
2464 */
2465 limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
2466 limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
2467 limit = max(limit, 128UL);
2468 sysctl_tcp_mem[0] = limit / 4 * 3;
2469 sysctl_tcp_mem[1] = limit;
2464 sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; 2470 sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2;
2465 2471
2472 /* Set per-socket limits to no more than 1/128 the pressure threshold */
2466 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); 2473 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
2467 max_share = min(4UL*1024*1024, limit); 2474 max_share = min(4UL*1024*1024, limit);
2468 2475
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f57a9baa6b27..92f99927d12d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1453,6 +1453,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1453 First: no IPv4 options. 1453 First: no IPv4 options.
1454 */ 1454 */
1455 newinet->opt = NULL; 1455 newinet->opt = NULL;
1456 newnp->ipv6_fl_list = NULL;
1456 1457
1457 /* Clone RX bits */ 1458 /* Clone RX bits */
1458 newnp->rxopt.all = np->rxopt.all; 1459 newnp->rxopt.all = np->rxopt.all;