skmsg: Increase sk->sk_drops when dropping packets
authorCong Wang <cong.wang@bytedance.com>
Tue, 15 Jun 2021 02:13:42 +0000 (19:13 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 21 Jun 2021 14:48:44 +0000 (16:48 +0200)
commit781dd0431eb549f9cb1fdddf91a50d985febe884
tree0eac83278a9d358acc3faf5e274c10aa1ee94eb0
parent42830571f1fd9751b3fbf38084bbb253320e185f
skmsg: Increase sk->sk_drops when dropping packets

It is hard to observe packet drops without increasing relevant
drop counters, here we should increase sk->sk_drops which is
a protocol-independent counter. Fortunately psock is always
associated with a struct sock, we can just use psock->sk.

Suggested-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20210615021342.7416-9-xiyou.wangcong@gmail.com
net/core/skmsg.c