[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2019 14:59:30 -0800
From: Arjun Roy <arjunroy.kdev@...il.com>
To: davem@...emloft.net, netdev@...r.kernel.org
Cc: arjunroy@...gle.com, soheil@...gle.com, edumazet@...gle.com,
Arjun Roy <arjunroy.kdev@...il.com>
Subject: [PATCH net-next] tcp: Set rcv zerocopy hint correctly if skb last frag is < PAGE_SIZE.
At present, if the last frag of paged data in a skb has < PAGE_SIZE
data, we compute the recv_skip_hint as being equal to the size of that
frag and the entire next skb.
Instead, just return the runt frag size as the hint.
Signed-off-by: Arjun Roy <arjunroy@...gle.com>
Acked-by: Soheil Hassas Yeganeh <soheil@...gle.com>
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
net/ipv4/tcp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 34490d972758..b9623d896469 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1904,6 +1904,8 @@ static int tcp_zerocopy_receive(struct sock *sk,
while (length + PAGE_SIZE <= zc->length) {
if (zc->recv_skip_hint < PAGE_SIZE) {
if (skb) {
+ if (zc->recv_skip_hint > 0)
+ break;
skb = skb->next;
offset = seq - TCP_SKB_CB(skb)->seq;
} else {
--
2.24.1.735.g03f4e72817-goog
Powered by blists - more mailing lists