Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2012330ybz; Sun, 26 Apr 2020 09:10:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLhC71mgOLcUmeG2bU2PkWAlWWcxNHxuq2bEUs0ZBbjDgN8NrlDRLmUaLJ/YF2jGNY+CSxW X-Received: by 2002:aa7:c5cf:: with SMTP id h15mr15914999eds.213.1587917434041; Sun, 26 Apr 2020 09:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587917434; cv=none; d=google.com; s=arc-20160816; b=aC6XMjR2dSK4u/AXXkhl6blJT2Oq2T9K1JJZgfCXt6gjP9A2wD+3TZ90PPL2bMUMyu WIL/O4rmDCphtPo6kqZahfolOMyLJP9/hFp6AsjeJ4I0y1yBhAA+AwfHop+D/T+VOpEQ AOujTUihgPIfzSn2v5UeI0qWNExrsC3ZIPS32cxygyrFAX1zA14arS2xS2AhoxJl1U5B pqogRR4nIXIn7qNG7xaQh5Vrl3oL3rrvA3Enh8ivoQRxtfVeEhdD/qUkOmUkMiokq2EU p7LS+8nQBrQp4zMX3eapCme3AU4lcsJQXe0FbID/DREHNLVirG5e2bq8/M6/JSqrjWOp bV2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=b9kk4vl45+yZfIOFMLozV6PyfATmkyRQJ6xZ8G56ZKQ=; b=iOb5lSGBnY5orYWQL18h/UnIMY8V09+oDI/xJcqCt9RjhHdpgd5GSEs4+GCM6e2FLw FMt8Xls3TBs5j3HJxFmFF5TIsaHN1uLUFvXIq9ses65CLghYzu74MSgT5qxRlj8eb5eB ++627GE5a4wcq7X+cB0SdXnOjDTL4f+JcQEVEjSIbsOn8zfmo49cHzFUS02eKmiA9H6/ b+qi40DuCNfoRQIxpeiJX4soRcYbk/e3dBmOFClwjZK1lhJdghxSL5Wx2Ao/Zcku40Gl 2pGywAL97JgWhqn/LhXLe2UZxcdJUby+tqAmCeu0rgW7u6CWcOd4SoopwY+9shV4jM6M moEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZGfYaozg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si3115887edn.103.2020.04.26.09.10.09; Sun, 26 Apr 2020 09:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZGfYaozg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726176AbgDZQIl (ORCPT + 99 others); Sun, 26 Apr 2020 12:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725778AbgDZQIk (ORCPT ); Sun, 26 Apr 2020 12:08:40 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3E1C061A0F; Sun, 26 Apr 2020 09:08:39 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id b2so14936542ljp.4; Sun, 26 Apr 2020 09:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=b9kk4vl45+yZfIOFMLozV6PyfATmkyRQJ6xZ8G56ZKQ=; b=ZGfYaozgkdnfK55JvLARbIVWkAHmE+BnX1DiWw7pO/OUdvPkivcUUXX34rml3PDerf COC4ZHbfmlXquZla3mRNiKsRj0Gbq4XL9RgJyikfhdd9LUJx9WVhLnLjU+U7vM2QpUJr 4BMSDqO/el4LTSF+8W7wWlm5wlCjfet1sMvt+wZ1HvCNWA8e6LE0tUVC2yOLYMHh5tpj 6Z6q/rP6YjYCz79/6pEtklfRKQaybAEbkgEklM7i1XoRexDF+Pa5zRecyM87wKhc4q+V o+ei78RZqBcpYahe/rxjlpyFgUgBrKq0uZmEHwj+Aj/4zUGWeUgS5StjtMGq44rHYEeB Tn/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=b9kk4vl45+yZfIOFMLozV6PyfATmkyRQJ6xZ8G56ZKQ=; b=KIjYyFuMrvPvz7GOvQybUPwNdGSr/zuZi0/bvwLDTXzJ670urICOkngBE9zBAvEySu tcwf57vPfhAIARosIJz7rSELKdNoWmet0QnLPgEBi4tifxTGP40r8BGDrBh/XTNAIG1z WKbJ/44jX5VwRpz7LvRlZgngsqx8R+kkcDS1py3KZcKM7Og1BJotMULr3Bl0DBvzMeFl HiuWRupNzOLF8LnwR7z5wvrHjT/QjaPEkMai2UAxGzcbX+ut6OVv4dROiQBK+hbq3bNl AgfCUwJtHfyOYuFC4GQfUsdCss5M6BeUWKkPI86nlJ7L1eZcWHt8WfQrXxbFSi8Q4iPR +jhg== X-Gm-Message-State: AGi0PuZcj6Mq1Yj6p/BNOzybpr7uC/fn33RRPpIQ/bKfX2+H7tSH0XJZ 2xWI35IC3ykiShbSprfqulx2NaC0dELgArPnmWc= X-Received: by 2002:a2e:b80b:: with SMTP id u11mr11911427ljo.212.1587917317736; Sun, 26 Apr 2020 09:08:37 -0700 (PDT) MIME-Version: 1.0 References: <20200420184750.218489-1-zenczykowski@gmail.com> In-Reply-To: <20200420184750.218489-1-zenczykowski@gmail.com> From: Alexei Starovoitov Date: Sun, 26 Apr 2020 09:08:26 -0700 Message-ID: Subject: Re: [PATCH] net: bpf: make bpf_ktime_get_ns() available to non GPL programs To: =?UTF-8?Q?Maciej_=C5=BBenczykowski?= Cc: =?UTF-8?Q?Maciej_=C5=BBenczykowski?= , Alexei Starovoitov , Daniel Borkmann , Linux Network Development Mailing List , LKML , "David S . Miller" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 11:47 AM Maciej =C5=BBenczykowski wrote: > > From: Maciej =C5=BBenczykowski > > 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 =3D { > .func =3D bpf_ktime_get_ns, > .gpl_only =3D false, > .ret_type =3D 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_MONOTON= IC) > 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 =C5=BBenczykowski 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.