Re: [PATCH bpf-next v7 2/2] selftests/bpf: Selftest for real time helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 30, 2020 at 07:05:04PM -0700, bimmy.pujari@xxxxxxxxx wrote:
> +SEC("realtime_helper")
> +int realtime_helper_test(struct __sk_buff *skb)
> +{
> +	unsigned long long *lasttime;
> +	unsigned long long curtime;
> +	int key = 0;
> +	int err = 0;
> +
> +	lasttime = bpf_map_lookup_elem(&time_map, &key);
> +	if (!lasttime)
> +		goto err;
> +
> +	curtime = bpf_ktime_get_real_ns();
> +	if (curtime <= *lasttime) {
> +		err = 1;
> +		goto err;
> +	}
> +	*lasttime = curtime;

so the test is doing exactly what comment in patch 1 is saying not to do.
I'm sorry but Andrii's comments are correct. If the authors of the patch
cannot make it right we should not add this helper to general audience.
Just because POSIX allows it it doesn't mean that it did the good choice.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux