Commit 4a9eebce authored by Zijian Zhang's avatar Zijian Zhang Committed by Greg Kroah-Hartman
Browse files

selftests/bpf: Fix total_bytes in msg_loop_rx in test_sockmap



[ Upstream commit 523dffcc ]

total_bytes in msg_loop_rx should also take push into account, otherwise
total_bytes will be a smaller value, which makes the msg_loop_rx end early.

Besides, total_bytes has already taken pop into account, so we don't need
to subtract some bytes from iov_buf in sendmsg_test. The additional
subtraction may make total_bytes a negative number, and msg_loop_rx will
just end without checking anything.

Fixes: 18d4e900 ("bpf: Selftests, improve test_sockmap total bytes counter")
Fixes: d6967214 ("selftests, bpf: Add one test for sockmap with strparser")
Signed-off-by: default avatarZijian Zhang <zijianzhang@bytedance.com>
Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20241106222520.527076-4-zijianzhang@bytedance.com


Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0bff469c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment