aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-01-11 23:55:43 -0500
committerDavid S. Miller <davem@davemloft.net>2016-01-11 23:55:43 -0500
commit9d367eddf363553c7668ba92c3b9d187ec4f71f7 (patch)
tree4f06d334d316390cc9a869ce3e74ec48d32ed0f8 /net/ipv4
parentb6a0e72ad3cffabaf30b856deb58fbe64a0f36a8 (diff)
parent03d84a5f83a67e692af00a3d3901e7820e3e84d5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/bonding/bond_main.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c The bond_main.c and mellanox switch conflicts were cases of overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fou.c2
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/tcp_yeah.c2
-rw-r--r--net/ipv4/udp_offload.c10
4 files changed, 10 insertions, 6 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index bd903fe0f750..976f0dcf6991 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -498,7 +498,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg,
498 sk->sk_allocation = GFP_ATOMIC; 498 sk->sk_allocation = GFP_ATOMIC;
499 499
500 if (cfg->udp_config.family == AF_INET) { 500 if (cfg->udp_config.family == AF_INET) {
501 err = udp_add_offload(&fou->udp_offloads); 501 err = udp_add_offload(net, &fou->udp_offloads);
502 if (err) 502 if (err)
503 goto error; 503 goto error;
504 } 504 }
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 568e2bc0d93d..512a44778cf2 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -920,7 +920,7 @@ static int __ip_append_data(struct sock *sk,
920 if (((length > mtu) || (skb && skb_is_gso(skb))) && 920 if (((length > mtu) || (skb && skb_is_gso(skb))) &&
921 (sk->sk_protocol == IPPROTO_UDP) && 921 (sk->sk_protocol == IPPROTO_UDP) &&
922 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len && 922 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
923 (sk->sk_type == SOCK_DGRAM)) { 923 (sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
924 err = ip_ufo_append_data(sk, queue, getfrag, from, length, 924 err = ip_ufo_append_data(sk, queue, getfrag, from, length,
925 hh_len, fragheaderlen, transhdrlen, 925 hh_len, fragheaderlen, transhdrlen,
926 maxfraglen, flags); 926 maxfraglen, flags);
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c
index 17d35662930d..3e6a472e6b88 100644
--- a/net/ipv4/tcp_yeah.c
+++ b/net/ipv4/tcp_yeah.c
@@ -219,7 +219,7 @@ static u32 tcp_yeah_ssthresh(struct sock *sk)
219 yeah->fast_count = 0; 219 yeah->fast_count = 0;
220 yeah->reno_count = max(yeah->reno_count>>1, 2U); 220 yeah->reno_count = max(yeah->reno_count>>1, 2U);
221 221
222 return tp->snd_cwnd - reduction; 222 return max_t(int, tp->snd_cwnd - reduction, 2);
223} 223}
224 224
225static struct tcp_congestion_ops tcp_yeah __read_mostly = { 225static struct tcp_congestion_ops tcp_yeah __read_mostly = {
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 130042660181..4c519c1dc161 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -21,6 +21,7 @@ static struct udp_offload_priv __rcu *udp_offload_base __read_mostly;
21 21
22struct udp_offload_priv { 22struct udp_offload_priv {
23 struct udp_offload *offload; 23 struct udp_offload *offload;
24 possible_net_t net;
24 struct rcu_head rcu; 25 struct rcu_head rcu;
25 struct udp_offload_priv __rcu *next; 26 struct udp_offload_priv __rcu *next;
26}; 27};
@@ -242,13 +243,14 @@ out:
242 return segs; 243 return segs;
243} 244}
244 245
245int udp_add_offload(struct udp_offload *uo) 246int udp_add_offload(struct net *net, struct udp_offload *uo)
246{ 247{
247 struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_ATOMIC); 248 struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_ATOMIC);
248 249
249 if (!new_offload) 250 if (!new_offload)
250 return -ENOMEM; 251 return -ENOMEM;
251 252
253 write_pnet(&new_offload->net, net);
252 new_offload->offload = uo; 254 new_offload->offload = uo;
253 255
254 spin_lock(&udp_offload_lock); 256 spin_lock(&udp_offload_lock);
@@ -312,7 +314,8 @@ struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb,
312 rcu_read_lock(); 314 rcu_read_lock();
313 uo_priv = rcu_dereference(udp_offload_base); 315 uo_priv = rcu_dereference(udp_offload_base);
314 for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) { 316 for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) {
315 if (uo_priv->offload->port == uh->dest && 317 if (net_eq(read_pnet(&uo_priv->net), dev_net(skb->dev)) &&
318 uo_priv->offload->port == uh->dest &&
316 uo_priv->offload->callbacks.gro_receive) 319 uo_priv->offload->callbacks.gro_receive)
317 goto unflush; 320 goto unflush;
318 } 321 }
@@ -390,7 +393,8 @@ int udp_gro_complete(struct sk_buff *skb, int nhoff)
390 393
391 uo_priv = rcu_dereference(udp_offload_base); 394 uo_priv = rcu_dereference(udp_offload_base);
392 for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) { 395 for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) {
393 if (uo_priv->offload->port == uh->dest && 396 if (net_eq(read_pnet(&uo_priv->net), dev_net(skb->dev)) &&
397 uo_priv->offload->port == uh->dest &&
394 uo_priv->offload->callbacks.gro_complete) 398 uo_priv->offload->callbacks.gro_complete)
395 break; 399 break;
396 } 400 }