summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-30 10:53:20 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-30 10:53:20 -0800
commita14a8d93169a8f2b0b000891571659ddbfa3a169 (patch)
tree36efa74c6f8c635079a8c3e057d25622282f4578 /net/ipv4
parentb527a2331b873b8bf0549a45fc1ff635dd230d15 (diff)
parent6f01fd6e6f6809061b56e78f1e8d143099716d70 (diff)
downloadop-kernel-dev-a14a8d93169a8f2b0b000891571659ddbfa3a169.zip
op-kernel-dev-a14a8d93169a8f2b0b000891571659ddbfa3a169.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
1) Setting link attributes can modify the size of the attributes that would be reported on a subsequent getlink netlink operation, therefore min_ifinfo_dump_size needs to be adjusted. From Stefan Gula. 2) Resegmentation of TSO frames while trimming can violate invariants expected by callers, namely that the number of segments can only stay the same or decrease, never increase. If MSS changes, however, we can trim data but then end up with more segments. Fix this by only segmenting to the MSS already recorded in the SKB. That's the simplest fix for now and if we want to get more fancy in the future that's a more involved change. This probably explains some retransmit counter inaccuracies. From Neal Cardwell. 3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet. 4) Fix CAIF crashes wrt. namespace handling. From Eric Dumazet and Eric W. Biederman. 5) TCP port selection fixes from Flavio Leitner. 6) More socket memory cgroup build fixes in certain randonfig situations. From Glauber Costa. 7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from Glauber Costa. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: af_unix: fix EPOLLET regression for stream sockets tcp: fix tcp_trim_head() to adjust segment count with skb MSS net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL net caif: Register properly as a pernet subsystem. netns: Fail conspicously if someone uses net_generic at an inappropriate time. net: explicitly add jump_label.h header to sock.h net: RTNETLINK adjusting values of min_ifinfo_dump_size ipv6: Fix ip_gre lockless xmits. xen-netfront: correct MAX_TX_TARGET calculation. netns: fix net_alloc_generic() tcp: bind() optimize port allocation tcp: bind() fix autoselection to share ports l2tp: l2tp_ip - fix possible oops on packet receive iwlwifi: fix PCI-E transport "inta" race mac80211: set bss_conf.idle when vif is connected mac80211: update oper_channel on ibss join
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/inet_connection_sock.c7
-rw-r--r--net/ipv4/ip_gre.c4
-rw-r--r--net/ipv4/sysctl_net_ipv4.c1
-rw-r--r--net/ipv4/tcp.c16
-rw-r--r--net/ipv4/tcp_output.c6
5 files changed, 25 insertions, 9 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 2e4e244..19d66ce 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -123,11 +123,14 @@ again:
smallest_size = tb->num_owners;
smallest_rover = rover;
if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) {
- spin_unlock(&head->lock);
snum = smallest_rover;
- goto have_snum;
+ goto tb_found;
}
}
+ if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
+ snum = rover;
+ goto tb_found;
+ }
goto next;
}
break;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 2b53a1f..6b3ca5b 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -422,6 +422,10 @@ static struct ip_tunnel *ipgre_tunnel_locate(struct net *net,
if (register_netdevice(dev) < 0)
goto failed_free;
+ /* Can use a lockless transmit, unless we generate output sequences */
+ if (!(nt->parms.o_flags & GRE_SEQ))
+ dev->features |= NETIF_F_LLTX;
+
dev_hold(dev);
ipgre_tunnel_link(ign, nt);
return nt;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 4aa7e9d..4cb9cd2 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -814,6 +814,7 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
net->ipv4.sysctl_rt_cache_rebuild_count = 4;
+ tcp_init_mem(net);
limit = nr_free_buffer_pages() / 8;
limit = max(limit, 128UL);
net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 9bcdec3..06373b4 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3216,6 +3216,16 @@ static int __init set_thash_entries(char *str)
}
__setup("thash_entries=", set_thash_entries);
+void tcp_init_mem(struct net *net)
+{
+ /* Set per-socket limits to no more than 1/128 the pressure threshold */
+ unsigned long limit = nr_free_buffer_pages() / 8;
+ limit = max(limit, 128UL);
+ net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3;
+ net->ipv4.sysctl_tcp_mem[1] = limit;
+ net->ipv4.sysctl_tcp_mem[2] = net->ipv4.sysctl_tcp_mem[0] * 2;
+}
+
void __init tcp_init(void)
{
struct sk_buff *skb = NULL;
@@ -3276,9 +3286,9 @@ void __init tcp_init(void)
sysctl_tcp_max_orphans = cnt / 2;
sysctl_max_syn_backlog = max(128, cnt / 256);
- /* Set per-socket limits to no more than 1/128 the pressure threshold */
- limit = ((unsigned long)init_net.ipv4.sysctl_tcp_mem[1])
- << (PAGE_SHIFT - 7);
+ tcp_init_mem(&init_net);
+ limit = nr_free_buffer_pages() / 8;
+ limit = max(limit, 128UL);
max_share = min(4UL*1024*1024, limit);
sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 8c8de27..4ff3b6d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1141,11 +1141,9 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
sk_mem_uncharge(sk, len);
sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
- /* Any change of skb->len requires recalculation of tso
- * factor and mss.
- */
+ /* Any change of skb->len requires recalculation of tso factor. */
if (tcp_skb_pcount(skb) > 1)
- tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk));
+ tcp_set_skb_tso_segs(sk, skb, tcp_skb_mss(skb));
return 0;
}
OpenPOWER on IntegriCloud