aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2012-06-14 02:42:44 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-15 18:30:15 -0400
commit62b1a8ab9b3660bb820d8dfe23148ed6cda38574 (patch)
tree7e6e6702da0e7ec0afe5c4dc6b337e8870b45fae /net
parentbc14786a100cc6a81cd060e8031ec481241b418c (diff)
net: remove skb_orphan_try()
Orphaning skb in dev_hard_start_xmit() makes bonding behavior unfriendly for applications sending big UDP bursts : Once packets pass the bonding device and come to real device, they might hit a full qdisc and be dropped. Without orphaning, the sender is automatically throttled because sk->sk_wmemalloc reaches sk->sk_sndbuf (assuming sk_sndbuf is not too big) We could try to defer the orphaning adding another test in dev_hard_start_xmit(), but all this seems of little gain, now that BQL tends to make packets more likely to be parked in Qdisc queues instead of NIC TX ring, in cases where performance matters. Reverts commits : fc6055a5ba31 net: Introduce skb_orphan_try() 87fd308cfc6b net: skb_tx_hash() fix relative to skb_orphan_try() and removes SKBTX_DRV_NEEDS_SK_REF flag Reported-and-bisected-by: Jean-Michel Hautbois <jhautbois@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Tested-by: Oliver Hartkopp <socketcan@hartkopp.net> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/can/raw.c3
-rw-r--r--net/core/dev.c23
-rw-r--r--net/iucv/af_iucv.c1
3 files changed, 1 insertions, 26 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index cde1b4a20f75..46cca3a91d19 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
681 if (err < 0) 681 if (err < 0)
682 goto free_skb; 682 goto free_skb;
683 683
684 /* to be able to check the received tx sock reference in raw_rcv() */
685 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
686
687 skb->dev = dev; 684 skb->dev = dev;
688 skb->sk = sk; 685 skb->sk = sk;
689 686
diff --git a/net/core/dev.c b/net/core/dev.c
index cd0981977f5c..6df214041a5e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2089,25 +2089,6 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)
2089 return 0; 2089 return 0;
2090} 2090}
2091 2091
2092/*
2093 * Try to orphan skb early, right before transmission by the device.
2094 * We cannot orphan skb if tx timestamp is requested or the sk-reference
2095 * is needed on driver level for other reasons, e.g. see net/can/raw.c
2096 */
2097static inline void skb_orphan_try(struct sk_buff *skb)
2098{
2099 struct sock *sk = skb->sk;
2100
2101 if (sk && !skb_shinfo(skb)->tx_flags) {
2102 /* skb_tx_hash() wont be able to get sk.
2103 * We copy sk_hash into skb->rxhash
2104 */
2105 if (!skb->rxhash)
2106 skb->rxhash = sk->sk_hash;
2107 skb_orphan(skb);
2108 }
2109}
2110
2111static bool can_checksum_protocol(netdev_features_t features, __be16 protocol) 2092static bool can_checksum_protocol(netdev_features_t features, __be16 protocol)
2112{ 2093{
2113 return ((features & NETIF_F_GEN_CSUM) || 2094 return ((features & NETIF_F_GEN_CSUM) ||
@@ -2193,8 +2174,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2193 if (!list_empty(&ptype_all)) 2174 if (!list_empty(&ptype_all))
2194 dev_queue_xmit_nit(skb, dev); 2175 dev_queue_xmit_nit(skb, dev);
2195 2176
2196 skb_orphan_try(skb);
2197
2198 features = netif_skb_features(skb); 2177 features = netif_skb_features(skb);
2199 2178
2200 if (vlan_tx_tag_present(skb) && 2179 if (vlan_tx_tag_present(skb) &&
@@ -2304,7 +2283,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,
2304 if (skb->sk && skb->sk->sk_hash) 2283 if (skb->sk && skb->sk->sk_hash)
2305 hash = skb->sk->sk_hash; 2284 hash = skb->sk->sk_hash;
2306 else 2285 else
2307 hash = (__force u16) skb->protocol ^ skb->rxhash; 2286 hash = (__force u16) skb->protocol;
2308 hash = jhash_1word(hash, hashrnd); 2287 hash = jhash_1word(hash, hashrnd);
2309 2288
2310 return (u16) (((u64) hash * qcount) >> 32) + qoffset; 2289 return (u16) (((u64) hash * qcount) >> 32) + qoffset;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 07d7d55a1b93..cd6f7a991d80 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -372,7 +372,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
372 skb_trim(skb, skb->dev->mtu); 372 skb_trim(skb, skb->dev->mtu);
373 } 373 }
374 skb->protocol = ETH_P_AF_IUCV; 374 skb->protocol = ETH_P_AF_IUCV;
375 skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
376 nskb = skb_clone(skb, GFP_ATOMIC); 375 nskb = skb_clone(skb, GFP_ATOMIC);
377 if (!nskb) 376 if (!nskb)
378 return -ENOMEM; 377 return -ENOMEM;