lkml.org 
[lkml]   [2020]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net: bpf: make bpf_ktime_get_ns() available to non GPL programs
On Mon, Apr 20, 2020 at 11:47 AM Maciej Żenczykowski
<zenczykowski@gmail.com> wrote:
>
> From: Maciej Żenczykowski <maze@google.com>
>
> The entire implementation is in kernel/bpf/helpers.c:
>
> BPF_CALL_0(bpf_ktime_get_ns) {
> /* NMI safe access to clock monotonic */
> return ktime_get_mono_fast_ns();
> }
>
> const struct bpf_func_proto bpf_ktime_get_ns_proto = {
> .func = bpf_ktime_get_ns,
> .gpl_only = false,
> .ret_type = RET_INTEGER,
> };
>
> and this was presumably marked GPL due to kernel/time/timekeeping.c:
> EXPORT_SYMBOL_GPL(ktime_get_mono_fast_ns);
>
> and while that may make sense for kernel modules (although even that
> is doubtful), there is currently AFAICT no other source of time
> available to ebpf.
>
> Furthermore this is really just equivalent to clock_gettime(CLOCK_MONOTONIC)
> which is exposed to userspace (via vdso even to make it performant)...
>
> As such, I see no reason to keep the GPL restriction.
> (In the future I'd like to have access to time from Apache licensed ebpf code)
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>

The issue of compatibility with apache licensed bpf progs was
brought up few times in the past.
The patch indeed will clear this hurdle.
Applied.

\
 
 \ /
  Last update: 2020-04-26 18:08    [W:0.037 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site