]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, sockmap: Zap ingress queues after stopping strparser
authorJohn Fastabend <john.fastabend@gmail.com>
Tue, 27 Jul 2021 16:04:58 +0000 (09:04 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 27 Jul 2021 21:55:10 +0000 (14:55 -0700)
commite36bc66e4697986e013efa32073dc696e7de04c2
tree9be3342dfefbd6f63c068e83232f03931fe32b55
parent7fc8eec956fa3e183fb2221b6fb59067eb34627c
bpf, sockmap: Zap ingress queues after stopping strparser

We don't want strparser to run and pass skbs into skmsg handlers when
the psock is null. We just sk_drop them in this case. When removing
a live socket from map it means extra drops that we do not need to
incur. Move the zap below strparser close to avoid this condition.

This way we stop the stream parser first stopping it from processing
packets and then delete the psock.

Fixes: 0fdd75f68fc89 ("bpf: sk_msg, zap ingress queue on psock down")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20210727160500.1713554-2-john.fastabend@gmail.com
net/core/skmsg.c