summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch135
1 files changed, 135 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch
new file mode 100644
index 00000000..60728039
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0090-net-remove-skb_orphan_try.patch
@@ -0,0 +1,135 @@
1From 401354ebe4d79d6edf536ad7b69e59afeec81308 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <edumazet@google.com>
3Date: Thu, 14 Jun 2012 06:42:44 +0000
4Subject: [PATCH 090/109] net: remove skb_orphan_try()
5
6commit 62b1a8ab9b3660bb820d8dfe23148ed6cda38574 upstream.
7
8Orphaning skb in dev_hard_start_xmit() makes bonding behavior
9unfriendly for applications sending big UDP bursts : Once packets
10pass the bonding device and come to real device, they might hit a full
11qdisc and be dropped. Without orphaning, the sender is automatically
12throttled because sk->sk_wmemalloc reaches sk->sk_sndbuf (assuming
13sk_sndbuf is not too big)
14
15We could try to defer the orphaning adding another test in
16dev_hard_start_xmit(), but all this seems of little gain,
17now that BQL tends to make packets more likely to be parked
18in Qdisc queues instead of NIC TX ring, in cases where performance
19matters.
20
21Reverts commits :
22fc6055a5ba31 net: Introduce skb_orphan_try()
2387fd308cfc6b net: skb_tx_hash() fix relative to skb_orphan_try()
24and removes SKBTX_DRV_NEEDS_SK_REF flag
25
26Reported-and-bisected-by: Jean-Michel Hautbois <jhautbois@gmail.com>
27Signed-off-by: Eric Dumazet <edumazet@google.com>
28Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
29Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
30Signed-off-by: David S. Miller <davem@davemloft.net>
31[bwh: Backported to 3.2:
32 - Adjust context
33 - SKBTX_WIFI_STATUS is not defined]
34Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
35---
36 include/linux/skbuff.h | 5 +----
37 net/can/raw.c | 3 ---
38 net/core/dev.c | 23 +----------------------
39 net/iucv/af_iucv.c | 1 -
40 4 files changed, 2 insertions(+), 30 deletions(-)
41
42diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
43index bdb4590..53dc7e7 100644
44--- a/include/linux/skbuff.h
45+++ b/include/linux/skbuff.h
46@@ -213,11 +213,8 @@ enum {
47 /* device driver is going to provide hardware time stamp */
48 SKBTX_IN_PROGRESS = 1 << 2,
49
50- /* ensure the originating sk reference is available on driver level */
51- SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
52-
53 /* device driver supports TX zero-copy buffers */
54- SKBTX_DEV_ZEROCOPY = 1 << 4,
55+ SKBTX_DEV_ZEROCOPY = 1 << 3,
56 };
57
58 /*
59diff --git a/net/can/raw.c b/net/can/raw.c
60index cde1b4a..46cca3a 100644
61--- a/net/can/raw.c
62+++ b/net/can/raw.c
63@@ -681,9 +681,6 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
64 if (err < 0)
65 goto free_skb;
66
67- /* to be able to check the received tx sock reference in raw_rcv() */
68- skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
69-
70 skb->dev = dev;
71 skb->sk = sk;
72
73diff --git a/net/core/dev.c b/net/core/dev.c
74index 1cbddc9..5738654 100644
75--- a/net/core/dev.c
76+++ b/net/core/dev.c
77@@ -2079,25 +2079,6 @@ static int dev_gso_segment(struct sk_buff *skb, int features)
78 return 0;
79 }
80
81-/*
82- * Try to orphan skb early, right before transmission by the device.
83- * We cannot orphan skb if tx timestamp is requested or the sk-reference
84- * is needed on driver level for other reasons, e.g. see net/can/raw.c
85- */
86-static inline void skb_orphan_try(struct sk_buff *skb)
87-{
88- struct sock *sk = skb->sk;
89-
90- if (sk && !skb_shinfo(skb)->tx_flags) {
91- /* skb_tx_hash() wont be able to get sk.
92- * We copy sk_hash into skb->rxhash
93- */
94- if (!skb->rxhash)
95- skb->rxhash = sk->sk_hash;
96- skb_orphan(skb);
97- }
98-}
99-
100 static bool can_checksum_protocol(unsigned long features, __be16 protocol)
101 {
102 return ((features & NETIF_F_GEN_CSUM) ||
103@@ -2182,8 +2163,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
104 if (!list_empty(&ptype_all))
105 dev_queue_xmit_nit(skb, dev);
106
107- skb_orphan_try(skb);
108-
109 features = netif_skb_features(skb);
110
111 if (vlan_tx_tag_present(skb) &&
112@@ -2293,7 +2272,7 @@ u16 __skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb,
113 if (skb->sk && skb->sk->sk_hash)
114 hash = skb->sk->sk_hash;
115 else
116- hash = (__force u16) skb->protocol ^ skb->rxhash;
117+ hash = (__force u16) skb->protocol;
118 hash = jhash_1word(hash, hashrnd);
119
120 return (u16) (((u64) hash * qcount) >> 32) + qoffset;
121diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
122index 274d150..cf98d62 100644
123--- a/net/iucv/af_iucv.c
124+++ b/net/iucv/af_iucv.c
125@@ -380,7 +380,6 @@ static int afiucv_hs_send(struct iucv_message *imsg, struct sock *sock,
126 skb_trim(skb, skb->dev->mtu);
127 }
128 skb->protocol = ETH_P_AF_IUCV;
129- skb_shinfo(skb)->tx_flags |= SKBTX_DRV_NEEDS_SK_REF;
130 nskb = skb_clone(skb, GFP_ATOMIC);
131 if (!nskb)
132 return -ENOMEM;
133--
1341.7.7.6
135