[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <160522364023.135009.13166901167357981092.stgit@john-XPS-13-9370>
Date: Thu, 12 Nov 2020 15:27:20 -0800
From: John Fastabend <john.fastabend@...il.com>
To: ast@...nel.org, daniel@...earbox.net, jakub@...udflare.com
Cc: john.fastabend@...il.com, bpf@...r.kernel.org,
netdev@...r.kernel.org
Subject: [bpf PATCH v2 3/6] bpf, sockmap: Use truesize with sk_rmem_schedule()
We use skb->size with sk_rmem_scheduled() which is not correct. Instead
use truesize to align with socket and tcp stack usage of sk_rmem_schedule.
Suggested-by: Daniel Borkman <daniel@...earbox.net>
Signed-off-by: John Fastabend <john.fastabend@...il.com>
---
net/core/skmsg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index fe44280c033e..d09426ce4af3 100644
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
@@ -411,7 +411,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)
msg = kzalloc(sizeof(*msg), __GFP_NOWARN | GFP_ATOMIC);
if (unlikely(!msg))
return -EAGAIN;
- if (!sk_rmem_schedule(sk, skb, skb->len)) {
+ if (!sk_rmem_schedule(sk, skb, skb->truesize)) {
kfree(msg);
return -EAGAIN;
}
Powered by blists - more mailing lists