aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 17:07:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 17:07:15 -0400
commitd2aa4550379f92e929af7ed1dd4f55e6a1e331f8 (patch)
tree5ef0fc69a507f0d701fd157b6652427eabd5efdd /net/ipv4
parent9e3e4b1d2d13bead8d52703c82a02b55f108b491 (diff)
parentcb2107be43d2fc5eadec58b92b54bf32c00bfff3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (55 commits) netxen: fix tx ring accounting netxen: fix detection of cut-thru firmware mode forcedeth: fix dma api mismatches atm: sk_wmem_alloc initial value is one net: correct off-by-one write allocations reports via-velocity : fix no link detection on boot Net / e100: Fix suspend of devices that cannot be power managed TI DaVinci EMAC : Fix rmmod error net: group address list and its count ipv4: Fix fib_trie rebalancing, part 2 pkt_sched: Update drops stats in act_police sky2: version 1.23 sky2: add GRO support sky2: skb recycling sky2: reduce default transmit ring sky2: receive counter update sky2: fix shutdown synchronization sky2: PCI irq issues sky2: more receive shutdown sky2: turn off pause during shutdown ... Manually fix trivial conflict in net/core/skbuff.c due to kmemcheck
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_trie.c24
-rw-r--r--net/ipv4/inet_diag.c4
-rw-r--r--net/ipv4/raw.c7
-rw-r--r--net/ipv4/udp.c7
4 files changed, 20 insertions, 22 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index d1a39b1277d6..012cf5a68581 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -391,13 +391,8 @@ static inline void tnode_free(struct tnode *tn)
391static void tnode_free_safe(struct tnode *tn) 391static void tnode_free_safe(struct tnode *tn)
392{ 392{
393 BUG_ON(IS_LEAF(tn)); 393 BUG_ON(IS_LEAF(tn));
394 394 tn->tnode_free = tnode_free_head;
395 if (node_parent((struct node *) tn)) { 395 tnode_free_head = tn;
396 tn->tnode_free = tnode_free_head;
397 tnode_free_head = tn;
398 } else {
399 tnode_free(tn);
400 }
401} 396}
402 397
403static void tnode_free_flush(void) 398static void tnode_free_flush(void)
@@ -1009,7 +1004,7 @@ fib_find_node(struct trie *t, u32 key)
1009 return NULL; 1004 return NULL;
1010} 1005}
1011 1006
1012static struct node *trie_rebalance(struct trie *t, struct tnode *tn) 1007static void trie_rebalance(struct trie *t, struct tnode *tn)
1013{ 1008{
1014 int wasfull; 1009 int wasfull;
1015 t_key cindex, key; 1010 t_key cindex, key;
@@ -1033,12 +1028,13 @@ static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
1033 } 1028 }
1034 1029
1035 /* Handle last (top) tnode */ 1030 /* Handle last (top) tnode */
1036 if (IS_TNODE(tn)) { 1031 if (IS_TNODE(tn))
1037 tn = (struct tnode *)resize(t, (struct tnode *)tn); 1032 tn = (struct tnode *)resize(t, (struct tnode *)tn);
1038 tnode_free_flush();
1039 }
1040 1033
1041 return (struct node *)tn; 1034 rcu_assign_pointer(t->trie, (struct node *)tn);
1035 tnode_free_flush();
1036
1037 return;
1042} 1038}
1043 1039
1044/* only used from updater-side */ 1040/* only used from updater-side */
@@ -1186,7 +1182,7 @@ static struct list_head *fib_insert_node(struct trie *t, u32 key, int plen)
1186 1182
1187 /* Rebalance the trie */ 1183 /* Rebalance the trie */
1188 1184
1189 rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); 1185 trie_rebalance(t, tp);
1190done: 1186done:
1191 return fa_head; 1187 return fa_head;
1192} 1188}
@@ -1605,7 +1601,7 @@ static void trie_leaf_remove(struct trie *t, struct leaf *l)
1605 if (tp) { 1601 if (tp) {
1606 t_key cindex = tkey_extract_bits(l->key, tp->pos, tp->bits); 1602 t_key cindex = tkey_extract_bits(l->key, tp->pos, tp->bits);
1607 put_child(t, (struct tnode *)tp, cindex, NULL); 1603 put_child(t, (struct tnode *)tp, cindex, NULL);
1608 rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); 1604 trie_rebalance(t, tp);
1609 } else 1605 } else
1610 rcu_assign_pointer(t->trie, NULL); 1606 rcu_assign_pointer(t->trie, NULL);
1611 1607
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index b0b273503e2a..a706a47f4dbb 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -156,10 +156,10 @@ static int inet_csk_diag_fill(struct sock *sk,
156 r->idiag_inode = sock_i_ino(sk); 156 r->idiag_inode = sock_i_ino(sk);
157 157
158 if (minfo) { 158 if (minfo) {
159 minfo->idiag_rmem = atomic_read(&sk->sk_rmem_alloc); 159 minfo->idiag_rmem = sk_rmem_alloc_get(sk);
160 minfo->idiag_wmem = sk->sk_wmem_queued; 160 minfo->idiag_wmem = sk->sk_wmem_queued;
161 minfo->idiag_fmem = sk->sk_forward_alloc; 161 minfo->idiag_fmem = sk->sk_forward_alloc;
162 minfo->idiag_tmem = atomic_read(&sk->sk_wmem_alloc); 162 minfo->idiag_tmem = sk_wmem_alloc_get(sk);
163 } 163 }
164 164
165 handler->idiag_get_info(sk, r, info); 165 handler->idiag_get_info(sk, r, info);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 3dc9171a272f..2979f14bb188 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -799,7 +799,8 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
799{ 799{
800 switch (cmd) { 800 switch (cmd) {
801 case SIOCOUTQ: { 801 case SIOCOUTQ: {
802 int amount = atomic_read(&sk->sk_wmem_alloc); 802 int amount = sk_wmem_alloc_get(sk);
803
803 return put_user(amount, (int __user *)arg); 804 return put_user(amount, (int __user *)arg);
804 } 805 }
805 case SIOCINQ: { 806 case SIOCINQ: {
@@ -935,8 +936,8 @@ static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
935 seq_printf(seq, "%4d: %08X:%04X %08X:%04X" 936 seq_printf(seq, "%4d: %08X:%04X %08X:%04X"
936 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n", 937 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n",
937 i, src, srcp, dest, destp, sp->sk_state, 938 i, src, srcp, dest, destp, sp->sk_state,
938 atomic_read(&sp->sk_wmem_alloc), 939 sk_wmem_alloc_get(sp),
939 atomic_read(&sp->sk_rmem_alloc), 940 sk_rmem_alloc_get(sp),
940 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), 941 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
941 atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); 942 atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops));
942} 943}
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 8f4158d7c9a6..80e3812837ad 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -840,7 +840,8 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg)
840 switch (cmd) { 840 switch (cmd) {
841 case SIOCOUTQ: 841 case SIOCOUTQ:
842 { 842 {
843 int amount = atomic_read(&sk->sk_wmem_alloc); 843 int amount = sk_wmem_alloc_get(sk);
844
844 return put_user(amount, (int __user *)arg); 845 return put_user(amount, (int __user *)arg);
845 } 846 }
846 847
@@ -1721,8 +1722,8 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
1721 seq_printf(f, "%4d: %08X:%04X %08X:%04X" 1722 seq_printf(f, "%4d: %08X:%04X %08X:%04X"
1722 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n", 1723 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n",
1723 bucket, src, srcp, dest, destp, sp->sk_state, 1724 bucket, src, srcp, dest, destp, sp->sk_state,
1724 atomic_read(&sp->sk_wmem_alloc), 1725 sk_wmem_alloc_get(sp),
1725 atomic_read(&sp->sk_rmem_alloc), 1726 sk_rmem_alloc_get(sp),
1726 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), 1727 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
1727 atomic_read(&sp->sk_refcnt), sp, 1728 atomic_read(&sp->sk_refcnt), sp,
1728 atomic_read(&sp->sk_drops), len); 1729 atomic_read(&sp->sk_drops), len);