samples/bpf: Reduce the sampling interval in xdp1_user
authorZhengchao Shao <shaozhengchao@huawei.com>
Tue, 19 Apr 2022 11:47:46 +0000 (19:47 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 20 Apr 2022 21:58:29 +0000 (14:58 -0700)
If interval is 2, and sum - prev[key] = 1, the result = 0. This will
mislead the tester that the port has no traffic right now. So reduce the
sampling interval to 1.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220419114746.291613-1-shaozhengchao@huawei.com
samples/bpf/xdp1_user.c

index 288db3d..ac370e6 100644 (file)
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
        }
        prog_id = info.id;
 
-       poll_stats(map_fd, 2);
+       poll_stats(map_fd, 1);
 
        return 0;
 }