diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-06 19:15:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-06 19:15:10 -0400 |
commit | 3ee72ca99288f1de95ec9c570e43f531c8799f06 (patch) | |
tree | 1199d129cb94b128eb6029d5fcc3ff0d4900b067 | |
parent | 29cf7a30f8a0ce4af2406d93d5a332099be26923 (diff) | |
parent | 186c6bbced722cfeff041d2a1264c95f5d042050 (diff) |
Merge git://github.com/davem330/net
* git://github.com/davem330/net:
net: fix typos in Documentation/networking/scaling.txt
bridge: leave carrier on for empty bridge
netfilter: Use proper rwlock init function
tcp: properly update lost_cnt_hint during shifting
tcp: properly handle md5sig_pool references
macvlan/macvtap: Fix unicast between macvtap interfaces in bridge mode
-rw-r--r-- | Documentation/networking/scaling.txt | 10 | ||||
-rw-r--r-- | drivers/net/macvlan.c | 2 | ||||
-rw-r--r-- | net/bridge/br_device.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 11 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 8 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 2 |
7 files changed, 20 insertions, 20 deletions
diff --git a/Documentation/networking/scaling.txt b/Documentation/networking/scaling.txt index 8ce7c30e7230..fe67b5c79f0f 100644 --- a/Documentation/networking/scaling.txt +++ b/Documentation/networking/scaling.txt | |||
@@ -27,7 +27,7 @@ applying a filter to each packet that assigns it to one of a small number | |||
27 | of logical flows. Packets for each flow are steered to a separate receive | 27 | of logical flows. Packets for each flow are steered to a separate receive |
28 | queue, which in turn can be processed by separate CPUs. This mechanism is | 28 | queue, which in turn can be processed by separate CPUs. This mechanism is |
29 | generally known as “Receive-side Scaling” (RSS). The goal of RSS and | 29 | generally known as “Receive-side Scaling” (RSS). The goal of RSS and |
30 | the other scaling techniques to increase performance uniformly. | 30 | the other scaling techniques is to increase performance uniformly. |
31 | Multi-queue distribution can also be used for traffic prioritization, but | 31 | Multi-queue distribution can also be used for traffic prioritization, but |
32 | that is not the focus of these techniques. | 32 | that is not the focus of these techniques. |
33 | 33 | ||
@@ -186,10 +186,10 @@ are steered using plain RPS. Multiple table entries may point to the | |||
186 | same CPU. Indeed, with many flows and few CPUs, it is very likely that | 186 | same CPU. Indeed, with many flows and few CPUs, it is very likely that |
187 | a single application thread handles flows with many different flow hashes. | 187 | a single application thread handles flows with many different flow hashes. |
188 | 188 | ||
189 | rps_sock_table is a global flow table that contains the *desired* CPU for | 189 | rps_sock_flow_table is a global flow table that contains the *desired* CPU |
190 | flows: the CPU that is currently processing the flow in userspace. Each | 190 | for flows: the CPU that is currently processing the flow in userspace. |
191 | table value is a CPU index that is updated during calls to recvmsg and | 191 | Each table value is a CPU index that is updated during calls to recvmsg |
192 | sendmsg (specifically, inet_recvmsg(), inet_sendmsg(), inet_sendpage() | 192 | and sendmsg (specifically, inet_recvmsg(), inet_sendmsg(), inet_sendpage() |
193 | and tcp_splice_read()). | 193 | and tcp_splice_read()). |
194 | 194 | ||
195 | When the scheduler moves a thread to a new CPU while it has outstanding | 195 | When the scheduler moves a thread to a new CPU while it has outstanding |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 05172c39a0ce..376e3e94bae0 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -239,7 +239,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
239 | dest = macvlan_hash_lookup(port, eth->h_dest); | 239 | dest = macvlan_hash_lookup(port, eth->h_dest); |
240 | if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { | 240 | if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { |
241 | /* send to lowerdev first for its network taps */ | 241 | /* send to lowerdev first for its network taps */ |
242 | vlan->forward(vlan->lowerdev, skb); | 242 | dev_forward_skb(vlan->lowerdev, skb); |
243 | 243 | ||
244 | return NET_XMIT_SUCCESS; | 244 | return NET_XMIT_SUCCESS; |
245 | } | 245 | } |
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 32b8f9f7f79e..ff3ed6086ce1 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -91,7 +91,6 @@ static int br_dev_open(struct net_device *dev) | |||
91 | { | 91 | { |
92 | struct net_bridge *br = netdev_priv(dev); | 92 | struct net_bridge *br = netdev_priv(dev); |
93 | 93 | ||
94 | netif_carrier_off(dev); | ||
95 | netdev_update_features(dev); | 94 | netdev_update_features(dev); |
96 | netif_start_queue(dev); | 95 | netif_start_queue(dev); |
97 | br_stp_enable_bridge(br); | 96 | br_stp_enable_bridge(br); |
@@ -108,8 +107,6 @@ static int br_dev_stop(struct net_device *dev) | |||
108 | { | 107 | { |
109 | struct net_bridge *br = netdev_priv(dev); | 108 | struct net_bridge *br = netdev_priv(dev); |
110 | 109 | ||
111 | netif_carrier_off(dev); | ||
112 | |||
113 | br_stp_disable_bridge(br); | 110 | br_stp_disable_bridge(br); |
114 | br_multicast_stop(br); | 111 | br_multicast_stop(br); |
115 | 112 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 21fab3edb92c..d73aab3fbfc0 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1389,9 +1389,7 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, | |||
1389 | 1389 | ||
1390 | BUG_ON(!pcount); | 1390 | BUG_ON(!pcount); |
1391 | 1391 | ||
1392 | /* Tweak before seqno plays */ | 1392 | if (skb == tp->lost_skb_hint) |
1393 | if (!tcp_is_fack(tp) && tcp_is_sack(tp) && tp->lost_skb_hint && | ||
1394 | !before(TCP_SKB_CB(tp->lost_skb_hint)->seq, TCP_SKB_CB(skb)->seq)) | ||
1395 | tp->lost_cnt_hint += pcount; | 1393 | tp->lost_cnt_hint += pcount; |
1396 | 1394 | ||
1397 | TCP_SKB_CB(prev)->end_seq += shifted; | 1395 | TCP_SKB_CB(prev)->end_seq += shifted; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index c34f01513945..7963e03f1068 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -927,18 +927,21 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, | |||
927 | } | 927 | } |
928 | sk_nocaps_add(sk, NETIF_F_GSO_MASK); | 928 | sk_nocaps_add(sk, NETIF_F_GSO_MASK); |
929 | } | 929 | } |
930 | if (tcp_alloc_md5sig_pool(sk) == NULL) { | 930 | |
931 | md5sig = tp->md5sig_info; | ||
932 | if (md5sig->entries4 == 0 && | ||
933 | tcp_alloc_md5sig_pool(sk) == NULL) { | ||
931 | kfree(newkey); | 934 | kfree(newkey); |
932 | return -ENOMEM; | 935 | return -ENOMEM; |
933 | } | 936 | } |
934 | md5sig = tp->md5sig_info; | ||
935 | 937 | ||
936 | if (md5sig->alloced4 == md5sig->entries4) { | 938 | if (md5sig->alloced4 == md5sig->entries4) { |
937 | keys = kmalloc((sizeof(*keys) * | 939 | keys = kmalloc((sizeof(*keys) * |
938 | (md5sig->entries4 + 1)), GFP_ATOMIC); | 940 | (md5sig->entries4 + 1)), GFP_ATOMIC); |
939 | if (!keys) { | 941 | if (!keys) { |
940 | kfree(newkey); | 942 | kfree(newkey); |
941 | tcp_free_md5sig_pool(); | 943 | if (md5sig->entries4 == 0) |
944 | tcp_free_md5sig_pool(); | ||
942 | return -ENOMEM; | 945 | return -ENOMEM; |
943 | } | 946 | } |
944 | 947 | ||
@@ -982,6 +985,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) | |||
982 | kfree(tp->md5sig_info->keys4); | 985 | kfree(tp->md5sig_info->keys4); |
983 | tp->md5sig_info->keys4 = NULL; | 986 | tp->md5sig_info->keys4 = NULL; |
984 | tp->md5sig_info->alloced4 = 0; | 987 | tp->md5sig_info->alloced4 = 0; |
988 | tcp_free_md5sig_pool(); | ||
985 | } else if (tp->md5sig_info->entries4 != i) { | 989 | } else if (tp->md5sig_info->entries4 != i) { |
986 | /* Need to do some manipulation */ | 990 | /* Need to do some manipulation */ |
987 | memmove(&tp->md5sig_info->keys4[i], | 991 | memmove(&tp->md5sig_info->keys4[i], |
@@ -989,7 +993,6 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) | |||
989 | (tp->md5sig_info->entries4 - i) * | 993 | (tp->md5sig_info->entries4 - i) * |
990 | sizeof(struct tcp4_md5sig_key)); | 994 | sizeof(struct tcp4_md5sig_key)); |
991 | } | 995 | } |
992 | tcp_free_md5sig_pool(); | ||
993 | return 0; | 996 | return 0; |
994 | } | 997 | } |
995 | } | 998 | } |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 79cc6469508d..7b8fc5794352 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -591,7 +591,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer, | |||
591 | } | 591 | } |
592 | sk_nocaps_add(sk, NETIF_F_GSO_MASK); | 592 | sk_nocaps_add(sk, NETIF_F_GSO_MASK); |
593 | } | 593 | } |
594 | if (tcp_alloc_md5sig_pool(sk) == NULL) { | 594 | if (tp->md5sig_info->entries6 == 0 && |
595 | tcp_alloc_md5sig_pool(sk) == NULL) { | ||
595 | kfree(newkey); | 596 | kfree(newkey); |
596 | return -ENOMEM; | 597 | return -ENOMEM; |
597 | } | 598 | } |
@@ -600,8 +601,9 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer, | |||
600 | (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); | 601 | (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); |
601 | 602 | ||
602 | if (!keys) { | 603 | if (!keys) { |
603 | tcp_free_md5sig_pool(); | ||
604 | kfree(newkey); | 604 | kfree(newkey); |
605 | if (tp->md5sig_info->entries6 == 0) | ||
606 | tcp_free_md5sig_pool(); | ||
605 | return -ENOMEM; | 607 | return -ENOMEM; |
606 | } | 608 | } |
607 | 609 | ||
@@ -647,6 +649,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, const struct in6_addr *peer) | |||
647 | kfree(tp->md5sig_info->keys6); | 649 | kfree(tp->md5sig_info->keys6); |
648 | tp->md5sig_info->keys6 = NULL; | 650 | tp->md5sig_info->keys6 = NULL; |
649 | tp->md5sig_info->alloced6 = 0; | 651 | tp->md5sig_info->alloced6 = 0; |
652 | tcp_free_md5sig_pool(); | ||
650 | } else { | 653 | } else { |
651 | /* shrink the database */ | 654 | /* shrink the database */ |
652 | if (tp->md5sig_info->entries6 != i) | 655 | if (tp->md5sig_info->entries6 != i) |
@@ -655,7 +658,6 @@ static int tcp_v6_md5_do_del(struct sock *sk, const struct in6_addr *peer) | |||
655 | (tp->md5sig_info->entries6 - i) | 658 | (tp->md5sig_info->entries6 - i) |
656 | * sizeof (tp->md5sig_info->keys6[0])); | 659 | * sizeof (tp->md5sig_info->keys6[0])); |
657 | } | 660 | } |
658 | tcp_free_md5sig_pool(); | ||
659 | return 0; | 661 | return 0; |
660 | } | 662 | } |
661 | } | 663 | } |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 2b771dc708a3..5290ac353a5e 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -3679,7 +3679,7 @@ int __net_init ip_vs_control_net_init(struct net *net) | |||
3679 | int idx; | 3679 | int idx; |
3680 | struct netns_ipvs *ipvs = net_ipvs(net); | 3680 | struct netns_ipvs *ipvs = net_ipvs(net); |
3681 | 3681 | ||
3682 | ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock); | 3682 | rwlock_init(&ipvs->rs_lock); |
3683 | 3683 | ||
3684 | /* Initialize rs_table */ | 3684 | /* Initialize rs_table */ |
3685 | for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++) | 3685 | for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++) |