bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>, bimmy.pujari@intel.com
Cc: bpf <bpf@vger.kernel.org>, Linux NetDev <netdev@vger.kernel.org>,
	mchehab@kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, Martin Lau <kafai@fb.com>,
	ashkan.nikravesh@intel.com
Subject: Re: [PATCH bpf-next v2 1/2] bpf: Add bpf_ktime_get_real_ns
Date: Wed, 23 Sep 2020 20:19:10 -0600	[thread overview]
Message-ID: <00f4c72b-37ee-1fbc-21f6-612bbe037036@gmail.com> (raw)
In-Reply-To: <CANP3RGf-rDPkf2=YoLEn=jcHyFEDcrNrQO27RdZRCoa_xi8-4Q@mail.gmail.com>

On 9/23/20 7:19 PM, Maciej Żenczykowski wrote:
>> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
>> index 5cc7425ee476..776ff58f969d 100644
>> --- a/kernel/bpf/helpers.c
>> +++ b/kernel/bpf/helpers.c
>> @@ -155,6 +155,17 @@ const struct bpf_func_proto bpf_ktime_get_ns_proto = {
>>         .ret_type       = RET_INTEGER,
>>  };
>>
>> +BPF_CALL_0(bpf_ktime_get_real_ns)
>> +{
>> +       /* NMI safe access to clock realtime */
>> +       return ktime_get_real_fast_ns();
>> +}
>> +
>> +const struct bpf_func_proto bpf_ktime_get_real_ns_proto = {
>> +       .func           = bpf_ktime_get_real_ns,
>> +       .gpl_only       = true,
> 
> imho should be false, this is normally accessible to userspace code
> via syscall, no reason why it should be gpl only for bpf
> 

agreed, no reason for the bpf hook to be gpl_only.

Glad to see the v2 of this patch; I wondered what happened to this helper.

  reply	other threads:[~2020-09-24  2:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  0:03 [PATCH bpf-next v2 1/2] bpf: Add bpf_ktime_get_real_ns bimmy.pujari
2020-09-24  0:03 ` [PATCH bpf-next v2 2/2] selftests/bpf: Verifying real time helper function bimmy.pujari
2020-09-24  1:19 ` [PATCH bpf-next v2 1/2] bpf: Add bpf_ktime_get_real_ns Maciej Żenczykowski
2020-09-24  2:19   ` David Ahern [this message]
2020-09-24  2:22     ` Pujari, Bimmy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00f4c72b-37ee-1fbc-21f6-612bbe037036@gmail.com \
    --to=dsahern@gmail.com \
    --cc=ashkan.nikravesh@intel.com \
    --cc=ast@kernel.org \
    --cc=bimmy.pujari@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@fb.com \
    --cc=maze@google.com \
    --cc=mchehab@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).