bpf, sockmap: Call skb_linearize only when required in sk_psock_skb_ingress_enqueue
authorLiu Jian <liujian56@huawei.com>
Wed, 27 Apr 2022 11:51:50 +0000 (19:51 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 28 Apr 2022 21:40:01 +0000 (23:40 +0200)
commit3527bfe6a92d940abfca87929207e734039f496b
treee476bb3fbfef579a4a060fc3d34a51db9f52d447
parent9a9a90ca1327024f669b670b02f61021306033dc
bpf, sockmap: Call skb_linearize only when required in sk_psock_skb_ingress_enqueue

The skb_to_sgvec fails only when the number of frag_list and frags
exceeds MAX_MSG_FRAGS. Therefore, we can call skb_linearize only
when the conversion fails.

Signed-off-by: Liu Jian <liujian56@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20220427115150.210213-1-liujian56@huawei.com
net/core/skmsg.c