Skip to content

Commit 3ee72ca

Browse files
committed
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
2 parents 29cf7a3 + 186c6bb commit 3ee72ca

7 files changed

Lines changed: 20 additions & 20 deletions

File tree

‎Documentation/networking/scaling.txt‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ applying a filter to each packet that assigns it to one of a small number
2727
of logical flows. Packets for each flow are steered to a separate receive
2828
queue, which in turn can be processed by separate CPUs. This mechanism is
2929
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.
3131
Multi-queue distribution can also be used for traffic prioritization, but
3232
that is not the focus of these techniques.
3333

@@ -186,10 +186,10 @@ are steered using plain RPS. Multiple table entries may point to the
186186
same CPU. Indeed, with many flows and few CPUs, it is very likely that
187187
a single application thread handles flows with many different flow hashes.
188188

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()
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()
193193
and tcp_splice_read()).
194194

195195
When the scheduler moves a thread to a new CPU while it has outstanding

‎drivers/net/macvlan.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
239239
dest = macvlan_hash_lookup(port, eth->h_dest);
240240
if (dest && dest->mode == MACVLAN_MODE_BRIDGE) {
241241
/* send to lowerdev first for its network taps */
242-
vlan->forward(vlan->lowerdev, skb);
242+
dev_forward_skb(vlan->lowerdev, skb);
243243

244244
return NET_XMIT_SUCCESS;
245245
}

‎net/bridge/br_device.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ static int br_dev_open(struct net_device *dev)
9191
{
9292
struct net_bridge *br = netdev_priv(dev);
9393

94-
netif_carrier_off(dev);
9594
netdev_update_features(dev);
9695
netif_start_queue(dev);
9796
br_stp_enable_bridge(br);
@@ -108,8 +107,6 @@ static int br_dev_stop(struct net_device *dev)
108107
{
109108
struct net_bridge *br = netdev_priv(dev);
110109

111-
netif_carrier_off(dev);
112-
113110
br_stp_disable_bridge(br);
114111
br_multicast_stop(br);
115112

‎net/ipv4/tcp_input.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,9 +1389,7 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
13891389

13901390
BUG_ON(!pcount);
13911391

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))
1392+
if (skb == tp->lost_skb_hint)
13951393
tp->lost_cnt_hint += pcount;
13961394

13971395
TCP_SKB_CB(prev)->end_seq += shifted;

‎net/ipv4/tcp_ipv4.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -927,18 +927,21 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
927927
}
928928
sk_nocaps_add(sk, NETIF_F_GSO_MASK);
929929
}
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) {
931934
kfree(newkey);
932935
return -ENOMEM;
933936
}
934-
md5sig = tp->md5sig_info;
935937

936938
if (md5sig->alloced4 == md5sig->entries4) {
937939
keys = kmalloc((sizeof(*keys) *
938940
(md5sig->entries4 + 1)), GFP_ATOMIC);
939941
if (!keys) {
940942
kfree(newkey);
941-
tcp_free_md5sig_pool();
943+
if (md5sig->entries4 == 0)
944+
tcp_free_md5sig_pool();
942945
return -ENOMEM;
943946
}
944947

@@ -982,14 +985,14 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
982985
kfree(tp->md5sig_info->keys4);
983986
tp->md5sig_info->keys4 = NULL;
984987
tp->md5sig_info->alloced4 = 0;
988+
tcp_free_md5sig_pool();
985989
} else if (tp->md5sig_info->entries4 != i) {
986990
/* Need to do some manipulation */
987991
memmove(&tp->md5sig_info->keys4[i],
988992
&tp->md5sig_info->keys4[i+1],
989993
(tp->md5sig_info->entries4 - i) *
990994
sizeof(struct tcp4_md5sig_key));
991995
}
992-
tcp_free_md5sig_pool();
993996
return 0;
994997
}
995998
}

‎net/ipv6/tcp_ipv6.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer,
591591
}
592592
sk_nocaps_add(sk, NETIF_F_GSO_MASK);
593593
}
594-
if (tcp_alloc_md5sig_pool(sk) == NULL) {
594+
if (tp->md5sig_info->entries6 == 0 &&
595+
tcp_alloc_md5sig_pool(sk) == NULL) {
595596
kfree(newkey);
596597
return -ENOMEM;
597598
}
@@ -600,8 +601,9 @@ static int tcp_v6_md5_do_add(struct sock *sk, const struct in6_addr *peer,
600601
(tp->md5sig_info->entries6 + 1)), GFP_ATOMIC);
601602

602603
if (!keys) {
603-
tcp_free_md5sig_pool();
604604
kfree(newkey);
605+
if (tp->md5sig_info->entries6 == 0)
606+
tcp_free_md5sig_pool();
605607
return -ENOMEM;
606608
}
607609

@@ -647,6 +649,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, const struct in6_addr *peer)
647649
kfree(tp->md5sig_info->keys6);
648650
tp->md5sig_info->keys6 = NULL;
649651
tp->md5sig_info->alloced6 = 0;
652+
tcp_free_md5sig_pool();
650653
} else {
651654
/* shrink the database */
652655
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)
655658
(tp->md5sig_info->entries6 - i)
656659
* sizeof (tp->md5sig_info->keys6[0]));
657660
}
658-
tcp_free_md5sig_pool();
659661
return 0;
660662
}
661663
}

‎net/netfilter/ipvs/ip_vs_ctl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3679,7 +3679,7 @@ int __net_init ip_vs_control_net_init(struct net *net)
36793679
int idx;
36803680
struct netns_ipvs *ipvs = net_ipvs(net);
36813681

3682-
ipvs->rs_lock = __RW_LOCK_UNLOCKED(ipvs->rs_lock);
3682+
rwlock_init(&ipvs->rs_lock);
36833683

36843684
/* Initialize rs_table */
36853685
for (idx = 0; idx < IP_VS_RTAB_SIZE; idx++)

0 commit comments

Comments
 (0)