]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, devmap: Remove drops variable from bq_xmit_all()
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 28 May 2021 02:43:56 +0000 (22:43 -0400)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 28 May 2021 20:14:18 +0000 (22:14 +0200)
commit6848d612ac8cf6fa6faf5ddfac566d0c727811a9
tree6c5c94ea17f63ff9a1b5738d042b0103ec34d19a
parente0052df8d08aa8748cf4a11d18d832918f2471ff
bpf, devmap: Remove drops variable from bq_xmit_all()

As Colin pointed out, the first drops assignment after declaration will
be overwritten by the second drops assignment before using, which makes
it useless.

Since the drops variable will be used only once. Just remove it and
use "cnt - sent" in trace_xdp_devmap_xmit().

Fixes: a154b753eb77 ("bpf: Run devmap xdp_prog on flush instead of bulk enqueue")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210528024356.24333-1-liuhangbin@gmail.com
kernel/bpf/devmap.c