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

+20 -20
+5 -5
Documentation/networking/scaling.txt
··· 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 29 generally known as “Receive-side Scaling” (RSS). The goal of RSS and 30 - the other scaling techniques to increase performance uniformly. 31 Multi-queue distribution can also be used for traffic prioritization, but 32 that is not the focus of these techniques. 33 ··· 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. 188 189 - rps_sock_table is a global flow table that contains the *desired* CPU for 190 - flows: the CPU that is currently processing the flow in userspace. Each 191 - table value is a CPU index that is updated during calls to recvmsg and 192 - sendmsg (specifically, inet_recvmsg(), inet_sendmsg(), inet_sendpage() 193 and tcp_splice_read()). 194 195 When the scheduler moves a thread to a new CPU while it has outstanding
··· 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 29 generally known as “Receive-side Scaling” (RSS). The goal of RSS and 30 + the other scaling techniques is to increase performance uniformly. 31 Multi-queue distribution can also be used for traffic prioritization, but 32 that is not the focus of these techniques. 33 ··· 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. 188 189 + rps_sock_flow_table is a global flow table that contains the *desired* CPU 190 + for flows: the CPU that is currently processing the flow in userspace. 191 + Each table value is a CPU index that is updated during calls to recvmsg 192 + and sendmsg (specifically, inet_recvmsg(), inet_sendmsg(), inet_sendpage() 193 and tcp_splice_read()). 194 195 When the scheduler moves a thread to a new CPU while it has outstanding
+1 -1
drivers/net/macvlan.c
··· 239 dest = macvlan_hash_lookup(port, eth->h_dest); 240 if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { 241 /* send to lowerdev first for its network taps */ 242 - vlan->forward(vlan->lowerdev, skb); 243 244 return NET_XMIT_SUCCESS; 245 }
··· 239 dest = macvlan_hash_lookup(port, eth->h_dest); 240 if (dest && dest->mode == MACVLAN_MODE_BRIDGE) { 241 /* send to lowerdev first for its network taps */ 242 + dev_forward_skb(vlan->lowerdev, skb); 243 244 return NET_XMIT_SUCCESS; 245 }
-3
net/bridge/br_device.c
··· 91 { 92 struct net_bridge *br = netdev_priv(dev); 93 94 - netif_carrier_off(dev); 95 netdev_update_features(dev); 96 netif_start_queue(dev); 97 br_stp_enable_bridge(br); ··· 106 static int br_dev_stop(struct net_device *dev) 107 { 108 struct net_bridge *br = netdev_priv(dev); 109 - 110 - netif_carrier_off(dev); 111 112 br_stp_disable_bridge(br); 113 br_multicast_stop(br);
··· 91 { 92 struct net_bridge *br = netdev_priv(dev); 93 94 netdev_update_features(dev); 95 netif_start_queue(dev); 96 br_stp_enable_bridge(br); ··· 107 static int br_dev_stop(struct net_device *dev) 108 { 109 struct net_bridge *br = netdev_priv(dev); 110 111 br_stp_disable_bridge(br); 112 br_multicast_stop(br);
+1 -3
net/ipv4/tcp_input.c
··· 1389 1390 BUG_ON(!pcount); 1391 1392 - /* Tweak before seqno plays */ 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; 1396 1397 TCP_SKB_CB(prev)->end_seq += shifted;
··· 1389 1390 BUG_ON(!pcount); 1391 1392 + if (skb == tp->lost_skb_hint) 1393 tp->lost_cnt_hint += pcount; 1394 1395 TCP_SKB_CB(prev)->end_seq += shifted;
+7 -4
net/ipv4/tcp_ipv4.c
··· 927 } 928 sk_nocaps_add(sk, NETIF_F_GSO_MASK); 929 } 930 - if (tcp_alloc_md5sig_pool(sk) == NULL) { 931 kfree(newkey); 932 return -ENOMEM; 933 } 934 - md5sig = tp->md5sig_info; 935 936 if (md5sig->alloced4 == md5sig->entries4) { 937 keys = kmalloc((sizeof(*keys) * 938 (md5sig->entries4 + 1)), GFP_ATOMIC); 939 if (!keys) { 940 kfree(newkey); 941 - tcp_free_md5sig_pool(); 942 return -ENOMEM; 943 } 944 ··· 985 kfree(tp->md5sig_info->keys4); 986 tp->md5sig_info->keys4 = NULL; 987 tp->md5sig_info->alloced4 = 0; 988 } else if (tp->md5sig_info->entries4 != i) { 989 /* Need to do some manipulation */ 990 memmove(&tp->md5sig_info->keys4[i], ··· 993 (tp->md5sig_info->entries4 - i) * 994 sizeof(struct tcp4_md5sig_key)); 995 } 996 - tcp_free_md5sig_pool(); 997 return 0; 998 } 999 }
··· 927 } 928 sk_nocaps_add(sk, NETIF_F_GSO_MASK); 929 } 930 + 931 + md5sig = tp->md5sig_info; 932 + if (md5sig->entries4 == 0 && 933 + tcp_alloc_md5sig_pool(sk) == NULL) { 934 kfree(newkey); 935 return -ENOMEM; 936 } 937 938 if (md5sig->alloced4 == md5sig->entries4) { 939 keys = kmalloc((sizeof(*keys) * 940 (md5sig->entries4 + 1)), GFP_ATOMIC); 941 if (!keys) { 942 kfree(newkey); 943 + if (md5sig->entries4 == 0) 944 + tcp_free_md5sig_pool(); 945 return -ENOMEM; 946 } 947 ··· 982 kfree(tp->md5sig_info->keys4); 983 tp->md5sig_info->keys4 = NULL; 984 tp->md5sig_info->alloced4 = 0; 985 + tcp_free_md5sig_pool(); 986 } else if (tp->md5sig_info->entries4 != i) { 987 /* Need to do some manipulation */ 988 memmove(&tp->md5sig_info->keys4[i], ··· 989 (tp->md5sig_info->entries4 - i) * 990 sizeof(struct tcp4_md5sig_key)); 991 } 992 return 0; 993 } 994 }
+5 -3
net/ipv6/tcp_ipv6.c
··· 591 } 592 sk_nocaps_add(sk, NETIF_F_GSO_MASK); 593 } 594 - if (tcp_alloc_md5sig_pool(sk) == NULL) { 595 kfree(newkey); 596 return -ENOMEM; 597 } ··· 601 (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); 602 603 if (!keys) { 604 - tcp_free_md5sig_pool(); 605 kfree(newkey); 606 return -ENOMEM; 607 } 608 ··· 649 kfree(tp->md5sig_info->keys6); 650 tp->md5sig_info->keys6 = NULL; 651 tp->md5sig_info->alloced6 = 0; 652 } else { 653 /* shrink the database */ 654 if (tp->md5sig_info->entries6 != i) ··· 658 (tp->md5sig_info->entries6 - i) 659 * sizeof (tp->md5sig_info->keys6[0])); 660 } 661 - tcp_free_md5sig_pool(); 662 return 0; 663 } 664 }
··· 591 } 592 sk_nocaps_add(sk, NETIF_F_GSO_MASK); 593 } 594 + if (tp->md5sig_info->entries6 == 0 && 595 + tcp_alloc_md5sig_pool(sk) == NULL) { 596 kfree(newkey); 597 return -ENOMEM; 598 } ··· 600 (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); 601 602 if (!keys) { 603 kfree(newkey); 604 + if (tp->md5sig_info->entries6 == 0) 605 + tcp_free_md5sig_pool(); 606 return -ENOMEM; 607 } 608 ··· 647 kfree(tp->md5sig_info->keys6); 648 tp->md5sig_info->keys6 = NULL; 649 tp->md5sig_info->alloced6 = 0; 650 + tcp_free_md5sig_pool(); 651 } else { 652 /* shrink the database */ 653 if (tp->md5sig_info->entries6 != i) ··· 655 (tp->md5sig_info->entries6 - i) 656 * sizeof (tp->md5sig_info->keys6[0])); 657 } 658 return 0; 659 } 660 }
+1 -1
net/netfilter/ipvs/ip_vs_ctl.c
··· 3679 int idx; 3680 struct netns_ipvs *ipvs = net_ipvs(net); 3681 3682 - ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock); 3683 3684 /* Initialize rs_table */ 3685 for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)
··· 3679 int idx; 3680 struct netns_ipvs *ipvs = net_ipvs(net); 3681 3682 + rwlock_init(&ipvs->rs_lock); 3683 3684 /* Initialize rs_table */ 3685 for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)