[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200426163125.rnxwntthcrx5qejf@ast-mbp>
Date: Sun, 26 Apr 2020 09:31:25 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Maciej Żenczykowski <zenczykowski@...il.com>
Cc: Maciej Żenczykowski <maze@...gle.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Linux Network Development Mailing List
<netdev@...r.kernel.org>, linux-kernel@...r.kernel.org,
"David S . Miller" <davem@...emloft.net>, bpf@...r.kernel.org
Subject: Re: [PATCH] net: bpf: add bpf_ktime_get_boot_ns()
On Mon, Apr 20, 2020 at 01:26:43PM -0700, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@...gle.com>
>
> On a device like a cellphone which is constantly suspending
> and resuming CLOCK_MONOTONIC is not particularly useful for
> keeping track of or reacting to external network events.
> Instead you want to use CLOCK_BOOTTIME.
>
> Hence add bpf_ktime_get_boot_ns() as a mirror of bpf_ktime_get_ns()
> based around CLOCK_BOOTTIME instead of CLOCK_MONOTONIC.
>
> Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
...
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 755867867e57..ec567d1e6fb9 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -6009,6 +6009,8 @@ bpf_base_func_proto(enum bpf_func_id func_id)
> return &bpf_tail_call_proto;
> case BPF_FUNC_ktime_get_ns:
> return &bpf_ktime_get_ns_proto;
> + case BPF_FUNC_ktime_get_boot_ns:
> + return &bpf_ktime_get_boot_ns_proto;
> default:
> break;
> }
That part got moved into kernel/bpf/helpers.c in the mean time.
I fixed it up and applied. Thanks
In the future please cc bpf@...r for all bpf related patches.
Powered by blists - more mailing lists